/* modals.css – Data modal, Admin modal, Password gate styles */

/* ── DATA MODAL ── */
#dm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#dm-overlay.open {
  display: flex;
  animation: dmFade .25s ease;
}
@keyframes dmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
#dm-box {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 18px;
  width: min(620px, 96vw);
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: dmSlide .3s ease;
}
@keyframes dmSlide {
  from { transform: translateY(28px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.dm-hdr {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.dm-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 17px;
}
.dm-close {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  transition: var(--t);
  padding: 4px;
}
.dm-close:hover {
  color: var(--text-primary);
}
.dm-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}
.dm-mode-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.dm-mode-card.rev-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold) !important;
  box-shadow: 0 8px 24px rgba(212, 168, 67, 0.15);
}
.dm-mode-card.pnl-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan) !important;
  box-shadow: 0 8px 24px rgba(29, 211, 235, 0.15);
}
.dm-mode-period {
  display: flex;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  flex-wrap: wrap;
  transition: background 0.3s, border-color 0.3s;
}
.dm-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}
.dm-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t);
  text-align: center;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:5px
}
.dm-tab i{font-size:15px}
.dm-tab.on {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.dm-mode-bar {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.dm-mode-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t);
  border: 1px solid var(--border);
  background: var(--bg-base);
  font-family: 'DM Sans', sans-serif;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.dm-mode-btn:hover {
  border-color: var(--gold);
  color: var(--text-primary);
}
.dm-mode-btn.on {
  background: linear-gradient(135deg, rgba(212,168,67,.18), rgba(212,168,67,.06));
  border-color: rgba(212,168,67,.4);
  color: var(--gold);
}
.dm-mode-btn i { font-size: 14px; }
.dm-panel {
  display: none;
}
.dm-panel.on {
  display: block;
}
.dm-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 7px;
  display: block;
}
.dm-input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border2);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: var(--t);
  margin-bottom: 14px;
}
.dm-input:focus {
  border-color: var(--cyan);
}
.dm-input[type=number]{-moz-appearance:textfield}
.dm-input[type=number]::-webkit-inner-spin-button,
.dm-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.dm-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dm-btn.prim {
  background: linear-gradient(135deg, var(--cyan), #0097a7);
  color: #000;
}
.dm-btn.prim:hover {
  opacity: .88;
}
.dm-btn.sec {
  background: linear-gradient(135deg, var(--gold), #b8860b);
  color: #000;
  margin-top: 8px;
}
.dm-btn.sec:hover {
  opacity: .88;
}
.dm-drop {
  border: 2px dashed var(--border2);
  border-radius: var(--radius);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--t);
  position: relative;
  margin-bottom: 14px;
}
.dm-drop:hover,
.dm-drop.drag {
  border-color: var(--cyan);
  background: rgba(0, 188, 212, .05);
}
.dm-drop-icon {
  font-size: 40px;
  margin-bottom: 10px;
}
.dm-drop-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.dm-drop-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}
.dm-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dm-hint {
  background: var(--bg-base);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}
.dm-hint b {
  color: var(--text-secondary);
  font-weight: 600;
}
.dm-status {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
  display: none;
  align-items: center;
  gap: 8px;
}
.dm-status.ok {
  display: flex;
  background: rgba(46, 204, 113, .12);
  color: var(--green);
  border: 1px solid rgba(46, 204, 113, .25);
}
.dm-status.err {
  display: flex;
  background: rgba(231, 76, 60, .12);
  color: var(--red);
  border: 1px solid rgba(231, 76, 60, .25);
}
.dm-status.loading {
  display: flex;
  background: rgba(0, 188, 212, .1);
  color: var(--cyan);
  border: 1px solid rgba(0, 188, 212, .25);
}
.dm-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.col-map {
  margin-top: 14px;
}
.col-map-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 8px;
}
.col-map-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.col-map-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-base);
  border-radius: 6px;
  font-size: 11px;
}
.col-map-lbl {
  color: var(--text-muted);
  width: 130px;
  flex-shrink: 0;
}
.col-map-val {
  color: var(--cyan);
  font-weight: 600;
  font-family: monospace;
}
.dm-tab-auto.active-url {
  background: rgba(212, 168, 67, .14) !important;
  color: var(--gold) !important;
}
.dm-tab-auto.active-url::after {
  content: '●';
  font-size: 7px;
  vertical-align: super;
  margin-left: 4px;
  color: var(--gold);
}
.ar-hint {
  border-color: rgba(212, 168, 67, .22) !important;
  background: rgba(212, 168, 67, .05) !important;
}
.ar-hint b {
  color: var(--gold);
}
.ar-stored-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(212, 168, 67, .15);
  color: var(--gold);
  font-weight: 700;
  border: 1px solid rgba(212, 168, 67, .3);
  margin-left: 8px;
}
#ar-local-group .dm-input[readonly] {
  cursor: default;
  opacity: .85;
  font-size: 11px;
}
#ar-local-pick {
  font-size: 11px;
  padding: 6px 14px;
  background: rgba(212, 168, 67, .08);
  color: var(--gold);
  border-color: rgba(212, 168, 67, .25);
  cursor: pointer;
}
#ar-local-pick:hover {
  background: rgba(212, 168, 67, .15);
}
.dm-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.dm-source-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 188, 212, .12);
  color: var(--cyan);
  font-weight: 600;
  border: 1px solid rgba(0, 188, 212, .2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dm-source-badge i { font-size: 11px; }

/* ── ADMIN SETTINGS ── */
#as-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#as-overlay.open {
  display: flex;
}
#as-box {
  width: min(1060px, 96vw);
  max-height: 92vh;
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.as-hdr {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.as-title {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 17px;
}
.as-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.as-close {
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.as-close:hover {
  color: var(--text-primary);
}
.as-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 0;
  flex: 1;
}
.as-nav {
  border-right: 1px solid var(--border);
  padding: 14px;
  background: var(--bg-base);
  overflow: auto;
}
.as-tab {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  color: var(--text-secondary);
  font: 600 12px 'DM Sans';
  text-align: left;
  cursor: pointer;
}
.as-tab.on,
.as-tab:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(212, 168, 67, .1);
}
.as-panel {
  display: none;
  padding: 18px;
  overflow: auto;
}
.as-panel.on {
  display: block;
}
.as-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.as-card {
  border: 1px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.as-card h4 {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: 10px;
}
.as-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.as-row label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.as-input,
.as-select {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border2);
  color: var(--text-primary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: 12px 'DM Sans';
  outline: none;
}
.as-input:focus,
.as-select:focus {
  border-color: var(--gold);
}
.as-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}
.as-list {
  display: grid;
  gap: 10px;
}
.as-item {
  display: grid;
  grid-template-columns: 28px 1fr 160px 110px;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.as-chart-item {
  grid-template-columns: 1fr 135px 90px;
}
.as-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.as-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.as-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
@media (max-width: 850px) {
  .as-body {
    grid-template-columns: 1fr;
  }
  .as-nav {
    display: flex;
    gap: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .as-tab {
    white-space: nowrap;
  }
  .as-grid {
    grid-template-columns: 1fr;
  }
  .as-item,
  .as-chart-item {
    grid-template-columns: 1fr;
  }
}

/* ── ADMIN PANEL EXTENSIONS ── */
.as-panels {
  display: grid;
  grid-template-rows: 1fr;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.as-section-hdr {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.as-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.as-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.as-btn {
  padding: 8px 16px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  color: var(--text-primary);
  font: 600 12px 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all .15s;
}
.as-btn:hover { border-color: var(--gold); color: var(--gold); }
.as-btn-sm { padding: 5px 10px; font-size: 11px; }
.as-btn-del { border-color: rgba(231,76,60,.3); color: #e74c3c; }
.as-btn-del:hover { background: rgba(231,76,60,.1); }
.as-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.as-meta { font-size: 10px; color: var(--text-muted); font-family: 'DM Sans', monospace; }
.as-empty { padding: 30px; text-align: center; color: var(--text-muted); font-size: 12px; }
.as-toggle {
  position: relative;
  width: 36px; height: 20px;
  display: inline-block;
  cursor: pointer;
}
.as-toggle input { opacity: 0; width: 0; height: 0; }
.as-toggle .as-slider {
  position: absolute; inset: 0;
  background: var(--border2);
  border-radius: 20px;
  transition: .2s;
}
.as-toggle input:checked + .as-slider { background: var(--gold); }
.as-toggle .as-slider::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px; left: 2px;
  transition: .2s;
}
.as-toggle input:checked + .as-slider::after { transform: translateX(16px); }

/* Function chips */
.as-func-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.as-func-chip {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border2);
  background: var(--bg-card2);
  color: var(--text-secondary);
  font: 500 10px 'DM Sans', monospace;
  cursor: pointer;
  transition: all .12s;
}
.as-func-chip:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,188,212,.08); }
.as-func-chip.field { border-color: rgba(212,168,67,.3); }
.as-func-chip.field:hover { border-color: var(--gold); color: var(--gold); background: rgba(212,168,67,.08); }

/* Formula items */
.as-fm-list { display: grid; gap: 10px; }
.as-fm-item {
  display: grid;
  grid-template-columns: 1fr 2fr 80px 40px 28px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.as-fm-ok { color: #2ecc71; font-size: 11px; }
.as-fm-err { color: #e74c3c; font-size: 11px; }
.as-fm-test { font-size: 11px; margin-top: 6px; }
.as-fm-test-result { font-size: 12px; font-weight: 700; margin-top: 4px; padding: 6px; border-radius: 6px; background: var(--bg-base); }

/* Rule items */
.as-rules-list { display: grid; gap: 8px; }
.as-rule-item {
  border: 1px solid var(--border);
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.as-rule-hdr {
  display: grid;
  grid-template-columns: 1fr 120px 120px 120px 120px 40px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-base);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.as-rule-body {
  display: grid;
  grid-template-columns: 1fr 120px 120px 120px 120px 40px;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
}
.as-rule-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }

/* Widget grid */
.as-widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

/* Data info */
.as-data-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.as-data-info .as-card { padding: 14px; }
.as-data-info .as-card h4 { margin-bottom: 6px; }
.as-data-info .as-note { margin-bottom: 4px; }

/* Responsive overrides for extended panels */
@media (max-width: 850px) {
  .as-grid2, .as-grid3 { grid-template-columns: 1fr; }
  .as-fm-item { grid-template-columns: 1fr; }
  .as-rule-hdr, .as-rule-body { grid-template-columns: 1fr 1fr; }
  .as-data-info { grid-template-columns: 1fr; }
}

/* ── PASSWORD GATE ── */
#pw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 13, 26, .82);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}
#pw-overlay.open {
  display: flex;
}
#pw-box {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, .35);
  border-radius: 16px;
  padding: 36px 40px 32px;
  width: 360px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: pw-fadein .22s ease;
}
#pw-box::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: linear-gradient(105deg, transparent 30%, rgba(212,168,67,.08) 45%, rgba(212,168,67,.15) 50%, rgba(212,168,67,.08) 55%, transparent 70%);
  background-size: 200% 100%;
  animation: pwShine 5s ease-in-out 1 forwards;
  pointer-events: none;
}
@keyframes pw-fadein {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes pw-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes pwShine {
  0% { background-position: 200% 0; }
  50% { background-position: -50% 0; }
  100% { background-position: 200% 0; }
}
#pw-box.pw-shake {
  animation: pw-shake .45s ease;
}
.pw-icon {
  font-size: 38px;
  text-align: center;
  margin-bottom: 10px;
}
.pw-title {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold, #d4a843);
  text-align: center;
  margin-bottom: 4px;
}
.pw-sub {
  font-size: 12px;
  color: var(--text-muted, #8da6c8);
  text-align: center;
  margin-bottom: 22px;
}
.pw-label {
  font-size: 11px;
  color: var(--text-muted, #8da6c8);
  margin-bottom: 6px;
  display: block;
}
.pw-input-wrap {
  position: relative;
  margin-bottom: 8px;
}
#pw-input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(212, 168, 67, .3);
  border-radius: 8px;
  padding: 10px 42px 10px 14px;
  color: var(--text-primary, #eef2ff);
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
#pw-input:focus {
  border-color: var(--gold, #d4a843);
}
.pw-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted, #8da6c8);
  user-select: none;
}
#pw-error {
  display: none;
  color: #e74c3c;
  font-size: 11px;
  margin-bottom: 14px;
  text-align: center;
  background: rgba(231, 76, 60, .1);
  border-radius: 6px;
  padding: 6px;
}
.pw-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.pw-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.pw-btn:hover {
  opacity: .85;
}
.pw-btn.cancel {
  background: rgba(255, 255, 255, .08);
  color: var(--text-muted, #8da6c8);
}
.pw-btn.unlock {
  background: var(--gold, #d4a843);
  color: #050d1a;
}
.pw-lock-icon {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 18px;
  opacity: .4;
}

/* ── LOGIN OVERLAY ── */
#login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
}
#login-overlay.open { display: flex; }
#login-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 90% 50% at 50% 30%, rgba(212,168,67,.08) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 15% 75%, rgba(0,188,212,.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 35% at 85% 25%, rgba(212,168,67,.05) 0%, transparent 45%),
    radial-gradient(ellipse 40% 30% at 50% 10%, rgba(212,168,67,.03) 0%, transparent 40%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(0,188,212,.04) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, #050d1a 0%, #020811 100%);
}
#login-overlay::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(212,168,67,.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 65%, rgba(212,168,67,.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(212,168,67,.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 45%, rgba(0,188,212,.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 75%, rgba(212,168,67,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 85%, rgba(0,188,212,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 45% 35%, rgba(212,168,67,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 10%, rgba(212,168,67,.2) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 60% 90%, rgba(212,168,67,.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 50%, rgba(0,188,212,.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 40%, rgba(212,168,67,.15) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 75% 55%, rgba(212,168,67,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 10%, rgba(0,188,212,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 85%, rgba(212,168,67,.15) 0%, transparent 100%),
    radial-gradient(1px 1px at 50% 50%, rgba(212,168,67,.1) 0%, transparent 100%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}
/* floating orbs */
#login-overlay .login-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: orbFloat 8s ease-in-out infinite alternate;
}
#login-overlay .login-orb:nth-child(1) { width: 300px; height: 300px; background: rgba(212,168,67,.04); top: -60px; left: -80px; animation-duration: 10s; }
#login-overlay .login-orb:nth-child(2) { width: 200px; height: 200px; background: rgba(0,188,212,.035); bottom: 40px; right: -40px; animation-duration: 7s; animation-delay: -2s; }
#login-overlay .login-orb:nth-child(3) { width: 180px; height: 180px; background: rgba(212,168,67,.025); bottom: -50px; left: 30%; animation-duration: 9s; animation-delay: -4s; }
@keyframes orbFloat { from { transform: translate(0, 0) scale(1); } to { transform: translate(30px, -20px) scale(1.1); } }

/* closing animation */
#login-overlay.closing { animation: overlayOut .35s ease forwards; }
#login-card.closing { animation: cardOut .35s cubic-bezier(.55,.06,.68,.19) forwards; }
@keyframes overlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes cardOut { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(20px) scale(.94); } }
#login-card {
  position: relative;
  background: linear-gradient(160deg, rgba(13,31,54,.88), rgba(6,16,32,.95));
  border: 1px solid rgba(212,168,67,.2);
  border-radius: 24px;
  padding: 44px 40px 36px;
  width: 360px;
  max-width: 92vw;
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 80px rgba(212,168,67,.03);
  animation: loginFade .5s cubic-bezier(.22,1,.36,1);
  text-align: center;
  overflow: hidden;
}
#login-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(212,168,67,.6), transparent);
  border-radius: 50%;
}
#login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 1px;
  background: linear-gradient(160deg, rgba(212,168,67,.15), transparent 35%, transparent 65%, rgba(212,168,67,.08));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: loginBorderGlow 4s ease-in-out infinite;
}
@keyframes loginFade { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes loginBorderGlow { 0%, 100% { opacity: .3; } 50% { opacity: .7; } }
.login-theme-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(212,168,67,.25);
  background: rgba(212,168,67,.06);
  color: rgba(212,168,67,.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .25s ease;
  z-index: 1;
}
.login-theme-btn:hover {
  background: rgba(212,168,67,.15);
  color: rgba(212,168,67,.95);
  border-color: rgba(212,168,67,.5);
  transform: rotate(30deg) scale(1.1);
}
body.lm .login-theme-btn {
  border-color: rgba(212,168,67,.2);
  background: rgba(212,168,67,.04);
  color: rgba(212,168,67,.55);
}
body.lm .login-theme-btn:hover {
  background: rgba(212,168,67,.12);
  color: rgba(212,168,67,.8);
  border-color: rgba(212,168,67,.35);
}
.login-logo { width: 56px; height: 56px; margin: 0 auto 12px; position: relative; }
.login-logo::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,.15) 0%, transparent 70%);
  animation: loginGlow 3s ease-in-out infinite alternate;
}
@keyframes loginGlow { from { opacity: .5; transform: scale(1); } to { opacity: 1; transform: scale(1.08); } }
.login-logo img { width: 100%; height: 100%; object-fit: contain; position: relative; z-index: 1; }
.login-title { font-family: 'Syne', sans-serif; font-size: 23px; font-weight: 800; background: linear-gradient(135deg, var(--gold, #d4a843), #e8c56a, #b8860b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 3px; letter-spacing: -.3px; }
.login-sub { font-size: 10.5px; color: rgba(141,166,200,.7); margin-bottom: 26px; letter-spacing: .3px; }
.login-field { position: relative; margin-bottom: 14px; }
.login-field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.login-field-icon i { font-size: 15px; color: rgba(212,168,67,.55); transition: color .25s; }
.login-field:focus-within .login-field-icon i { color: rgba(212,168,67,.8); }
.login-field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(212,168,67,.25);
  border-radius: 12px;
  padding: 13px 14px 13px 42px;
  color: var(--text-primary, #eef2ff);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.login-field input:focus {
  border-color: rgba(212,168,67,.5);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 24px rgba(212,168,67,.06);
}
.login-field input::placeholder { color: rgba(141,166,200,.35); }
.login-field input::placeholder { color: rgba(141,166,200,.35); }
#login-error { display: none; font-size: 11px; color: #ff6b6b; margin-bottom: 14px; background: rgba(231,76,60,.08); padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(231,76,60,.15); animation: loginErr .3s ease; }
@keyframes loginErr { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
#login-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold, #d4a843), #c9a03a);
  color: #050d1a;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .3px;
  position: relative;
  overflow: hidden;
}
#login-btn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(212,168,67,.25); }
#login-btn:active { transform: translateY(0); box-shadow: none; }
#login-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
#login-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,.1) 50%, transparent 70%);
  transition: transform .5s;
  transform: translateX(-100%);
}
#login-btn:hover::before { transform: translateX(100%); }
#login-guest-btn {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  border: 1px solid rgba(212,168,67,.35);
  border-radius: 12px;
  background: transparent;
  color: var(--gold, #d4a843);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
  display: none !important; /* flex */
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .3px;
}
#login-guest-btn:hover {
  background: rgba(212,168,67,.06);
  border-color: rgba(212,168,67,.6);
  box-shadow: 0 4px 16px rgba(212,168,67,.1);
  transform: translateY(-1px);
}
#login-guest-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
#login-guest-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.login-developed { font-size: 9px; color: rgba(212,168,67,.55); margin-top: 22px; letter-spacing: .5px; font-family: 'DM Sans', sans-serif; display: flex; align-items: center; justify-content: center; gap: 4px; }
.login-developed span { color: rgba(212,168,67,.85); font-weight: 600; letter-spacing: .8px; text-transform: uppercase; }
.login-developed .login-copyright { color: rgba(212,168,67,.45); font-weight: 400; letter-spacing: 0; }

/* light mode overrides for login page */
body.lm #login-overlay::before {
  background:
    radial-gradient(ellipse 90% 50% at 50% 30%, rgba(212,168,67,.06) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 15% 75%, rgba(0,188,212,.04) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 50% 50%, #f1f5f9 0%, #e2e8f0 100%);
}
body.lm #login-card {
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(248,250,252,.98));
  box-shadow: 0 24px 80px rgba(0,0,0,.1), 0 0 80px rgba(212,168,67,.03);
}
body.lm #login-card::before { background: linear-gradient(90deg, transparent, rgba(212,168,67,.4), transparent); }
body.lm .login-sub { color: rgba(100,116,139,.7); }
body.lm .login-field input { background: rgba(0,0,0,.03); border-color: rgba(212,168,67,.2); color: #0f172a; }
body.lm .login-field input:focus { background: rgba(0,0,0,.05); border-color: rgba(212,168,67,.4); }
body.lm .login-field input::placeholder { color: rgba(100,116,139,.35); }
body.lm .login-field-icon i { color: rgba(212,168,67,.5); }
body.lm .login-developed { color: rgba(71,85,105,.65); }
body.lm .login-developed span { color: rgba(164,125,43,.9); font-weight: 700; }
body.lm .login-developed .login-copyright { color: rgba(71,85,105,.5); }

/* ── PASSWORD CHANGE MODAL ── */
#pc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 9500;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#pc-overlay.open { display: flex; }
#pc-overlay.open #pc-box { animation: dmSlide .3s ease; }
#pc-box {
  background: var(--bg-card);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: 380px;
  max-width: 92vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.pc-hdr { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.pc-title { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.pc-close { cursor: pointer; color: var(--text-muted); font-size: 20px; padding: 4px; }
.pc-close:hover { color: var(--text-primary); }
.pc-body { padding: 22px; }
.pc-field { margin-bottom: 14px; }
.pc-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 5px; }
.pc-field input { width: 100%; box-sizing: border-box; background: var(--bg-base); border: 1px solid var(--border2); color: var(--text-primary); padding: 10px 14px; border-radius: var(--radius-sm); font: 13px 'DM Sans'; outline: none; transition: border-color .2s; }
.pc-field input:focus { border-color: var(--gold); }
#pc-error { display: none; font-size: 11px; color: #e74c3c; margin-bottom: 12px; background: rgba(231,76,60,.08); padding: 6px; border-radius: 6px; text-align: center; }
#pc-btn { width: 100%; padding: 11px; border: none; border-radius: 10px; background: linear-gradient(135deg, var(--gold, #d4a843), #b8860b); color: #050d1a; font-family: 'Syne', sans-serif; font-weight: 700; font-size: 13px; cursor: pointer; transition: opacity .2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
#pc-btn:hover { opacity: .88; }
#pc-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── MODERN CALENDAR SELECTORS ── */
input[type="month"], input[type="date"] {
  color-scheme: dark; /* Forces Chrome/Edge/Safari to render a beautiful dark calendar popout! */
}
/* light mode overrides for password gate modal */
body.lm #pw-overlay {
  background: rgba(0,0,0,0.35);
}
body.lm #pw-box {
  background: #fff;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}
body.lm #pw-input {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.12);
  color: #0f172a;
}
body.lm #pw-input:focus {
  border-color: var(--gold, #d4a843);
}
body.lm .pw-eye {
  color: rgba(0,0,0,0.3);
}
body.lm .pw-sub,
body.lm .pw-label {
  color: rgba(0,0,0,0.45);
}

input[type="month"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.65) sepia(1) saturate(5) hue-rotate(150deg);
  opacity: 0.75;
  transition: all 0.2s ease;
}
input[type="month"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.15);
}