/* Admin Panel CSS -- Theme 5: Deep Dark + Teal  v2.82 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* =========================================================================
   CSS variables -- dark mode (default)
   ========================================================================= */
:root {
  --accent:      #0d9488;
  --accent-lt:   rgba(13,148,136,.15);
  --accent-hv:   #0f766e;
  --accent-text: #5eead4;

  --green:       #10b981;
  --green-lt:    rgba(16,185,129,.15);
  --green-text:  #6ee7b7;
  --amber:       #f59e0b;
  --amber-lt:    rgba(245,158,11,.12);
  --amber-text:  #fcd34d;
  --red:         #ef4444;
  --red-lt:      rgba(239,68,68,.12);
  --red-text:    #f87171;
  --gray:        #94a3b8;
  --gray-lt:     rgba(255,255,255,.05);

  --bg:          #060d16;
  --bg-2:        #0a1628;
  --bg-3:        #0d1e35;
  --card-bg:     #0a1628;
  --border:      rgba(20,184,166,.1);
  --border-2:    rgba(255,255,255,.07);
  --text:        #e2e8f0;
  --text-2:      #64748b;
  --text-3:      rgba(148,163,184,.35);

  --nav-bg:      #0a1628;
  --nav-border:  rgba(20,184,166,.1);
  --nav-text:    rgba(148,163,184,.55);
  --nav-active:  #5eead4;
  --nav-active-border: #0d9488;

  --radius:      6px;
  --radius-lg:   10px;
  --shadow:      0 4px 24px rgba(0,0,0,.35);
  --body-bg:     #02080f;
}

/* =========================================================================
   Light mode
   ========================================================================= */
body.light {
  --accent:      #0d9488;
  --accent-lt:   #f0fdfa;
  --accent-hv:   #0f766e;
  --accent-text: #0f766e;
  --green:       #059669;
  --green-lt:    #f0fdf4;
  --green-text:  #065f46;
  --amber:       #d97706;
  --amber-lt:    #fffbeb;
  --amber-text:  #92400e;
  --red:         #dc2626;
  --red-lt:      #fef2f2;
  --red-text:    #991b1b;
  --gray:        #64748b;
  --gray-lt:     #f1f5f9;
  --bg:          #f0faf9;
  --bg-2:        #f8fdfc;
  --bg-3:        #e0f2f1;
  --card-bg:     #ffffff;
  --border:      #e0f2f1;
  --border-2:    #cbd5e1;
  --text:        #0f172a;
  --text-2:      #475569;
  --text-3:      #94a3b8;
  --nav-bg:      #ffffff;
  --nav-border:  #e0f2f1;
  --nav-text:    #64748b;
  --nav-active:  #0d9488;
  --nav-active-border: #0d9488;
  --body-bg:     #e8f5f4;
  color-scheme: light;
}

/* =========================================================================
   Base
   ========================================================================= */
html { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Inter', sans-serif;
  font-size: 13px; color: var(--text);
  background: var(--body-bg); line-height: 1.5; min-height: 100%;
}

/* =========================================================================
   Shell -- top nav layout (no sidebar)
   ========================================================================= */
.admin-shell {
  display: flex; flex-direction: column; min-height: 100vh;
  max-width: 1200px; margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* =========================================================================
   Top Navigation
   ========================================================================= */
.admin-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  padding: 0 20px; height: 50px;
  display: flex; align-items: stretch;
  position: sticky; top: 0; z-index: 200; flex-shrink: 0;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; margin-right: 24px; flex-shrink: 0;
  border-bottom: 2px solid transparent; padding: 0;
}
.nav-logo-svg {
  width: 28px; height: 28px;
  background: linear-gradient(135deg,#16a34a,#15803d);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-logo-img { width: 28px; height: 28px; object-fit: contain; border-radius: 5px; }
.brand-link { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -.2px; white-space: nowrap; }
.nav-links { display: flex; align-items: stretch; gap: 0; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 0 13px; font-size: 12px; font-weight: 500;
  color: var(--nav-text); text-decoration: none;
  border-bottom: 2px solid transparent; border-top: 2px solid transparent;
  transition: color .12s, border-color .12s; white-space: nowrap;
}
.nav-link:hover { color: var(--text); border-bottom-color: rgba(13,148,136,.3); }
.nav-link.active { color: var(--nav-active); border-bottom-color: var(--nav-active-border); }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700; min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px;
}
/* nav-dropdown removed v2.99 (now v3.00) -- dropdown replaced with direct nav links */
.nav-end { display: flex; align-items: center; gap: 8px; margin-left: auto; padding-left: 12px; }
.dark-toggle {
  background: none; border: 1px solid var(--border-2);
  color: var(--text-2); cursor: pointer; padding: 5px 8px;
  border-radius: var(--radius); font-size: 14px; line-height: 1; transition: all .12s;
}
.dark-toggle:hover { border-color: var(--accent); color: var(--accent-text); }
.nav-logout {
  font-size: 11px; color: var(--text-2); text-decoration: none;
  padding: 5px 10px; border: 1px solid var(--border-2);
  border-radius: var(--radius); transition: all .12s; white-space: nowrap;
}
.nav-logout:hover { color: var(--red-text); border-color: var(--red); }

/* Breadcrumb bar */
.admin-topbar {
  background: var(--bg-2); border-bottom: 1px solid var(--border);
  padding: 0 20px; height: 36px;
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.topbar-breadcrumb { font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.topbar-breadcrumb a { color: var(--text-2); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--accent-text); }
.topbar-breadcrumb .sep { color: var(--border-2); }
.topbar-breadcrumb .current { color: var(--text-2); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* =========================================================================
   Main area
   ========================================================================= */
.admin-body { flex: 1; display: flex; flex-direction: column; }
.admin-main { padding: 20px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-header h1 { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -.3px; }

/* =========================================================================
   Login page
   ========================================================================= */
.login-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.25rem;
}
.login-wrap { width: 100%; max-width: 400px; }
/* login-brand removed -- login page uses admin-nav instead */
.login-icon-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; background: var(--accent-lt);
  border: 1px solid rgba(13,148,136,.3); border-radius: 10px;
  margin: 0 auto 1rem; color: var(--accent);
}
.login-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.75rem;
  border-top: 2px solid var(--accent); box-shadow: var(--shadow);
}
.login-logo  { text-align: center; margin-bottom: 1.5rem; }
.login-title { display: block; font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -.3px; }
.login-sub   { display: block; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.login-card .field label { color: var(--text-2); }
.login-divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.login-footer { text-align: center; margin-top: 1.25rem; }
.login-footer a { font-size: 12px; color: var(--text-2); text-decoration: none; }
.login-footer a:hover { color: var(--accent-text); }

/* =========================================================================
   Cards
   ========================================================================= */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 12px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.card-header h2 { font-size: 13px; font-weight: 600; color: var(--text); }
.card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.card-header a { font-size: 12px; color: var(--accent-text); text-decoration: none; }
.card-header a:hover { text-decoration: underline; }
.info-card { background: var(--accent-lt); border-color: rgba(13,148,136,.25); }
.info-card h3 { font-size: 12px; font-weight: 600; color: var(--accent-text); margin-bottom: 4px; }
.info-card p  { font-size: 12px; color: var(--text-2); }
.info-card code {
  display: block; font-family: 'SFMono-Regular',Consolas,monospace;
  font-size: 11px; background: rgba(13,148,136,.08);
  padding: 3px 7px; border-radius: 4px; margin: 3px 0; color: var(--accent-text);
}

/* =========================================================================
   KPI cards
   ========================================================================= */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  border-top: 3px solid var(--accent);
}
.stat-card-blue    { border-top-color: #3b82f6; }
.stat-card-green   { border-top-color: var(--green); }
.stat-card-amber   { border-top-color: var(--amber); }
.stat-card-red     { border-top-color: var(--red); }
.stat-card-default { border-top-color: var(--border-2); }
.stat-label { font-size: 10px; color: var(--text-2); font-weight: 500; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -1px; display: block; line-height: 1; }
.stat-value.green { color: var(--green); }
.stat-value.amber { color: var(--amber); }
.dashboard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =========================================================================
   Health grid
   ========================================================================= */
.health-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.health-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-3); border-radius: var(--radius); border: 1px solid var(--border); font-size: 12px; }
.health-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.health-dot.green { background: var(--green); box-shadow: 0 0 0 2px var(--green-lt); }
.health-dot.red   { background: var(--red);   box-shadow: 0 0 0 2px var(--red-lt); }
.health-dot.amber { background: var(--amber); box-shadow: 0 0 0 2px var(--amber-lt); }
.health-label  { flex: 1; color: var(--text); font-size: 11px; font-weight: 500; }
.health-status { font-size: 11px; font-weight: 600; }
.health-status.ok   { color: var(--green); }
.health-status.err  { color: var(--red); }
.health-status.warn { color: var(--amber); }
.version-badge { font-size: 10px; color: var(--text-2); background: var(--bg-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; font-family: 'SFMono-Regular',Consolas,monospace; }

/* =========================================================================
   Tables
   ========================================================================= */
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { text-align: left; padding: 7px 10px; font-size: 10px; font-weight: 600; color: var(--text-2); letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid var(--border); background: var(--bg-3); }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.unread td    { background: rgba(13,148,136,.05); }
.data-table tr:hover td     { background: var(--bg-3); }
.data-table tr.unread:hover td { background: rgba(13,148,136,.09); }
.muted { color: var(--text-2); }
.empty-state { text-align: center; color: var(--text-2); padding: 2rem; font-size: 13px; }
.domain-link { color: var(--accent-text); text-decoration: none; font-weight: 500; font-size: 12px; }
.domain-link:hover { text-decoration: underline; }

/* =========================================================================
   Toolbar
   ========================================================================= */
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; flex-wrap: wrap; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-form input,.search-form select { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; background: var(--card-bg); color: var(--text); }
.search-form input { width: 200px; }
.filter-tabs { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card-bg); }
.tab { padding: 6px 14px; font-size: 12px; color: var(--text-2); text-decoration: none; border-right: 1px solid var(--border); background: var(--card-bg); transition: background .12s; cursor: pointer; }
.tab:last-child { border-right: none; }
.tab:hover  { background: var(--bg-3); }
.tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--bg-3); border-bottom: 1px solid var(--border); font-size: 12px; }
.bulk-actions { display: flex; gap: 6px; }

/* =========================================================================
   DNS badges
   ========================================================================= */
.dns-badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; letter-spacing: .2px; }
.dns-green  { background: var(--green-lt); color: var(--green-text); border: 1px solid rgba(16,185,129,.2); }
.dns-amber  { background: var(--amber-lt); color: var(--amber-text); border: 1px solid rgba(245,158,11,.2); }
.dns-orange { background: var(--amber-lt); color: var(--amber-text); border: 1px solid rgba(245,158,11,.2); }
.dns-red    { background: var(--red-lt);   color: var(--red-text);   border: 1px solid rgba(239,68,68,.2); }
.dns-gray   { background: var(--gray-lt);  color: var(--gray); }
.dns-retry {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--accent-text); cursor: pointer;
  text-decoration: none; padding: 2px 7px;
  border: 1px solid rgba(13,148,136,.3); border-radius: 4px;
  margin-left: 4px; transition: all .12s; background: var(--accent-lt);
  font-weight: 600;
}
.dns-retry:hover { background: rgba(13,148,136,.25); border-color: var(--accent); }

/* =========================================================================
   Badges
   ========================================================================= */
.badge { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.badge-green  { background: var(--green-lt);  color: var(--green-text); }
.badge-gray   { background: var(--gray-lt);   color: var(--gray); }
.badge-blue   { background: var(--accent-lt); color: var(--accent-text); }
.badge-amber  { background: var(--amber-lt);  color: var(--amber-text); }
.count-badge  { font-size: 11px; color: var(--text-2); background: var(--bg-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; }
.tpl-badge    { font-size: 10px; font-weight: 500; color: var(--accent-text); background: var(--accent-lt); padding: 2px 8px; border-radius: 4px; }

/* =========================================================================
   Toggle switch
   ========================================================================= */
.toggle-switch { position: relative; display: inline-block; width: 34px; height: 18px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: var(--border-2); border-radius: 18px; transition: .2s; }
.slider::before { content: ''; position: absolute; width: 12px; height: 12px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.toggle-switch input:checked + .slider { background: var(--accent); }
.toggle-switch input:checked + .slider::before { transform: translateX(16px); }

/* =========================================================================
   Forms
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.field input[type=text],.field input[type=email],.field input[type=password],
.field input[type=number],.field input[type=tel],.field input[type=url],
.field input[type=datetime-local],.field select,.field textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 8px 10px; font-size: 13px; font-family: inherit;
  color: var(--text); background: var(--bg-3);
  outline: none; width: 100%; transition: border-color .12s, box-shadow .12s;
}
.field input:focus,.field select:focus,.field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,148,136,.15);
}
.field textarea { resize: vertical; min-height: 72px; }
.field small { font-size: 11px; color: var(--text-2); }
.field .req { color: var(--red); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field-checkbox label { font-size: 13px; color: var(--text); font-weight: 400; cursor: pointer; display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 1rem; flex-wrap: wrap; }

/* Domain edit action bar */
.edit-actions { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--card-bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); margin-top: 4px; }
.edit-actions-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 13px; font-size: 12px; font-family: inherit; font-weight: 500; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--bg-3); color: var(--text); cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s, color .12s; white-space: nowrap; }
.btn:hover { background: var(--card-bg); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hv); border-color: var(--accent-hv); }
.btn-success { background: var(--green-lt); color: var(--green-text); border-color: rgba(16,185,129,.3); }
.btn-success:hover { background: rgba(16,185,129,.25); }
.btn-danger  { background: var(--red-lt); color: var(--red-text); border-color: rgba(239,68,68,.3); }
.btn-danger:hover  { background: rgba(239,68,68,.2); }
.btn-full { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-xs { padding: 3px 8px; font-size: 10px; }

/* =========================================================================
   Alerts
   ========================================================================= */
.alert { padding: 10px 13px; border-radius: var(--radius); font-size: 12px; margin-bottom: 12px; line-height: 1.5; display: flex; align-items: flex-start; gap: 8px; }
.alert::before { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-lt); color: var(--green-text); border-left: 3px solid var(--green); }
.alert-success::before { content: '\2713'; }
.alert-danger  { background: var(--red-lt);   color: var(--red-text);   border-left: 3px solid var(--red); }
.alert-danger::before  { content: '\2715'; }
.alert-warning { background: var(--amber-lt); color: var(--amber-text); border-left: 3px solid var(--amber); }
.alert-warning::before { content: '\26A0'; }

/* =========================================================================
   Pagination
   ========================================================================= */
.pagination { display: flex; gap: 3px; margin-top: 10px; }
.pg-link { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; color: var(--text-2); text-decoration: none; background: var(--card-bg); transition: background .12s; }
.pg-link:hover  { background: var(--bg-3); }
.pg-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* =========================================================================
   Settings / Branding
   ========================================================================= */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(260px,100%),1fr)); gap: 12px; }
.logo-preview,.branding-preview { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-3); border-radius: var(--radius); margin-bottom: 8px; border: 1px solid var(--border); min-height: 56px; }

/* =========================================================================
   Detail panel
   ========================================================================= */
.detail-panel { background: var(--bg-3); border-radius: var(--radius); padding: 12px; }
.detail-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 8px; }
.detail-grid > div { display: flex; flex-direction: column; gap: 2px; }
.detail-grid span   { font-size: 10px; color: var(--text-2); }
.detail-grid strong { font-size: 12px; }
.detail-comments span { font-size: 10px; color: var(--text-2); display: block; margin-bottom: 3px; }
.detail-comments p    { font-size: 12px; line-height: 1.6; }
.actions { display: flex; gap: 5px; align-items: center; white-space: nowrap; }

/* =========================================================================
   Template gallery
   ========================================================================= */
.tpl-inline-preview { position: relative; width: 100%; height: 420px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-3); }
.tpl-inline-preview iframe { width: 100%; height: 100%; border: none; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(200px,1fr)); gap: 12px; }
.tpl-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s; }
.tpl-card:hover { border-color: var(--accent); }
.tpl-card-preview { height: 130px; overflow: hidden; position: relative; background: var(--bg-3); cursor: pointer; }
.tpl-card-preview iframe { width: 160%; height: 160%; border: none; transform: scale(.625); transform-origin: 0 0; pointer-events: none; }
.tpl-card-preview-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom,transparent 40%,rgba(0,0,0,.4)); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.tpl-card-preview:hover .tpl-card-preview-overlay { opacity: 1; }
.tpl-card-body { padding: 10px 12px; }
.tpl-card-num  { font-size: 9px; color: var(--text-2); margin-bottom: 2px; }
.tpl-card-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.tpl-card-actions { display: flex; gap: 6px; }
.tpl-info-bar { display: flex; gap: 10px; align-items: center; padding: 8px 10px; background: var(--bg-3); border-radius: var(--radius); margin-bottom: 10px; font-size: 11px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =========================================================================
   Analytics
   ========================================================================= */
.an-card   { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 10px; }
.an-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.an-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 10px; margin-bottom: 14px; }
.an-val   { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.5px; }
.an-label { font-size: 10px; color: var(--text-2); margin-top: 2px; }
.an-sub   { font-size: 11px; color: var(--text-2); }
.chart-wrap { position: relative; height: 180px; margin: 10px 0; }
.chart-title { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.chart-legend { display: flex; gap: 14px; margin-top: 8px; }
.chart-svg  { display: block; width: 100%; }
.day-tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.day-tab  { padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 11px; cursor: pointer; text-decoration: none; color: var(--text-2); background: var(--card-bg); }
.day-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.bot-bar-wrap { background: var(--bg-3); border-radius: 3px; height: 6px; overflow: hidden; margin-top: 4px; }
.bot-bar-fill { height: 100%; border-radius: 3px; background: var(--amber); }
.dom-bar   { background: var(--bg-3); border-radius: 3px; height: 4px; margin-top: 3px; }
.dom-share { height: 100%; border-radius: 3px; background: var(--accent); }
.ref-url   { font-size: 11px; color: var(--accent-text); font-family: monospace; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 960px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .health-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-cols { grid-template-columns: 1fr; }
  .footer-stats { gap: 8px; }
}
@media (max-width: 680px) {
  .admin-nav { padding: 0 12px; }
  .admin-main { padding: 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .field-row  { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .health-grid { grid-template-columns: 1fr; }
  .nav-link { padding: 0 8px; font-size: 11px; }
  .brand-link { display: none; }
  .footer-stats { display: none; }
  .admin-footer { justify-content: center; }
}

/* =========================================================================
   Footer
   ========================================================================= */
.admin-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
  width: 100%;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.footer-logo {
  width: 16px; height: 16px;
  background: linear-gradient(135deg,#16a34a,#15803d);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.footer-name { font-size: 11px; color: var(--text-2); font-weight: 500; }
.footer-ver {
  font-size: 9px; color: var(--accent-text);
  padding: 1px 5px; border: 1px solid rgba(13,148,136,.2);
  border-radius: 3px; font-family: 'SFMono-Regular',Consolas,monospace;
}
.footer-sep { width: 1px; height: 12px; background: var(--border-2); flex-shrink: 0; }
.footer-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-2);
}
.footer-stat strong { color: var(--text); font-weight: 600; }
.footer-stat .badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.footer-stat .badge-dot.red { background: var(--red); }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .15s; }
.modal-overlay.is-open { opacity: 1; pointer-events: all; }
.modal-box { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 28px 28px 20px; max-width: 420px; width: 92%; transform: translateY(-10px) scale(.98); transition: transform .15s; }
.modal-overlay.is-open .modal-box { transform: translateY(0) scale(1); }
.modal-icon  { font-size: 26px; margin-bottom: 12px; line-height: 1; }
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.modal-body  { font-size: 13px; color: var(--text-2); line-height: 1.6; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Homepage */
.hp-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.hp-fl { font-size: 12px; color: var(--text-2); }
.hp-fr { display: flex; gap: 12px; font-size: 11px; color: var(--text-3); }
.hp-btn2 { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; font-size: 12px; }
