/* ============================================================
   ADX Admin Panel — Premium Dark + Green Theme
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Core palette */
  --c-bg:        #0d0f12;
  --c-surface:   #141720;
  --c-surface2:  #1a1e2a;
  --c-border:    #252b38;
  --c-border2:   #2e3545;

  /* Green accent */
  --c-green:     #00e676;
  --c-green-dim: #00b85e;
  --c-green-bg:  rgba(0,230,118,.08);
  --c-green-bdr: rgba(0,230,118,.2);

  /* Semantic */
  --c-yellow:    #fbbf24;
  --c-yellow-bg: rgba(251,191,36,.08);
  --c-yellow-bdr:rgba(251,191,36,.25);
  --c-red:       #f87171;
  --c-red-bg:    rgba(248,113,113,.08);
  --c-red-bdr:   rgba(248,113,113,.25);
  --c-blue:      #60a5fa;
  --c-blue-bg:   rgba(96,165,250,.08);

  /* Text */
  --c-text:      #e8eaf0;
  --c-text2:     #8892a4;
  --c-text3:     #5a6478;

  /* Misc */
  --radius:  10px;
  --radius-lg: 14px;
  --sidebar-w: 230px;
  --topbar-h:  62px;
  --shadow:    0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.5);
  --transition: .15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ─────────────────────────── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb { background: var(--c-border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text3); }

/* ─────────────────────────── LOGIN PAGE ────────────────────────────── */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,230,118,.12), transparent);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-hex {
  width: 42px;
  height: 42px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo-wordmark {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--c-text);
}

.login-subtitle {
  text-align: center;
  color: var(--c-text3);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 36px;
}

.login-form { display: flex; flex-direction: column; gap: 14px; }

.form-field { display: flex; flex-direction: column; gap: 7px; }

.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text2);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.label-note { font-weight: 400; text-transform: none; color: var(--c-text3); margin-left: 4px; }

.field-input, .field-select, .field-textarea {
  width: 100%;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  font-family: inherit;
  font-size: 16px;
  padding: 11px 14px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input::placeholder,
.field-textarea::placeholder { color: var(--c-text3); }
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--c-green);
  box-shadow: 0 0 0 3px rgba(0,230,118,.12);
}
.field-textarea { resize: vertical; min-height: 100px; }
.field-select { cursor: pointer; }
.field-color {
  width: 44px;
  height: 44px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface2);
  padding: 3px;
  cursor: pointer;
  flex-shrink: 0;
}

.field-row { display: flex; gap: 12px; align-items: flex-end; }
.field-row .form-field { flex: 1; }

/* ─────────────────────────── BUTTONS ───────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--c-green);
  color: #0d1117;
}
.btn-primary:hover {
  background: var(--c-green-dim);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,230,118,.25);
}
.btn-primary:active { transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--c-text2);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-surface2); color: var(--c-text); }

.btn-danger {
  background: var(--c-red-bg);
  color: var(--c-red);
  border: 1px solid var(--c-red-bdr);
}
.btn-danger:hover { background: rgba(248,113,113,.16); }

.btn-full { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }

/* icon-only */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--c-text2);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--c-surface2); color: var(--c-text); }
.btn-icon-danger:hover { background: var(--c-red-bg); color: var(--c-red); }

/* ─────────────────────────── FLASH ─────────────────────────────────── */
.flash-bar {
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0 -4px;
}
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
}
.flash::before { font-size: 15px; flex-shrink: 0; }
.flash-success {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
  color: var(--c-green);
}
.flash-success::before { content: '✓'; }
.flash-error {
  background: var(--c-red-bg);
  border-color: var(--c-red-bdr);
  color: var(--c-red);
}
.flash-error::before { content: '!'; }

/* ─────────────────────────── LAYOUT ────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

/* ─────────────────────────── SIDEBAR ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--c-border);
}

.brand-hex {
  width: 34px; height: 34px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--c-text);
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--c-text3);
  padding: 10px 12px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--c-text2);
  font-weight: 500;
  font-size: 13.5px;
  transition: all var(--transition);
  position: relative;
}
.nav-link:hover { background: var(--c-surface2); color: var(--c-text); }
.nav-link.active {
  background: var(--c-green-bg);
  color: var(--c-green);
  border: 1px solid var(--c-green-bdr);
}
.nav-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: var(--c-border);
  margin: 8px 4px;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--c-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.footer-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.footer-avatar {
  width: 30px; height: 30px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-green);
  flex-shrink: 0;
}
.footer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  truncate: clip;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  color: var(--c-text3);
  font-size: 16px;
  transition: all var(--transition);
  flex-shrink: 0;
}
.logout-link:hover { background: var(--c-red-bg); color: var(--c-red); }

/* ─────────────────────────── MAIN ──────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.topbar-breadcrumb { font-size: 11px; color: var(--c-text3); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.content { flex: 1; padding: 28px; }

/* ─────────────────────────── TABLE ─────────────────────────────────── */
.table-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border);
  gap: 12px;
}
.table-info { font-size: 13px; color: var(--c-text2); }
.table-info strong { color: var(--c-text); font-weight: 600; }

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  background: var(--c-surface2);
  border-bottom: 1px solid var(--c-border);
}
.data-table tbody tr {
  border-bottom: 1px solid var(--c-border);
  transition: background var(--transition);
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }
.data-table tbody tr.row-inactive { opacity: .45; }
.data-table td {
  padding: 13px 16px;
  vertical-align: middle;
}

.cell-domain .domain-name {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--c-text);
  transition: color var(--transition);
}
.cell-domain a:hover .domain-name { color: var(--c-green); }
.cell-domain .domain-ext { color: var(--c-text3); }

.cell-muted { color: var(--c-text2); font-size: 13px; }
.cell-actions { display: flex; gap: 4px; align-items: center; }

.text-warn   { color: var(--c-yellow); }
.text-danger { color: var(--c-red); }
.text-subtle { color: var(--c-text3); }

/* ─────────────────────────── BADGES ────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-green  { background: var(--c-green-bg);  border-color: var(--c-green-bdr); color: var(--c-green); }
.badge-green  .badge-dot { background: var(--c-green); box-shadow: 0 0 6px var(--c-green); }
.badge-yellow { background: var(--c-yellow-bg); border-color: var(--c-yellow-bdr); color: var(--c-yellow); }
.badge-yellow .badge-dot { background: var(--c-yellow); }
.badge-red    { background: var(--c-red-bg);    border-color: var(--c-red-bdr);   color: var(--c-red); }
.badge-red    .badge-dot { background: var(--c-red); }
.badge-gray   { background: rgba(255,255,255,.04); border-color: var(--c-border2); color: var(--c-text3); }
.badge-gray   .badge-dot { background: var(--c-text3); }

/* ─────────────────────────── STATUS TOGGLE ─────────────────────────── */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.status-pill-active {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
  color: var(--c-green);
}
.status-pill-active:hover { background: rgba(0,230,118,.14); }
.status-pill-inactive {
  background: rgba(255,255,255,.04);
  border-color: var(--c-border2);
  color: var(--c-text3);
}
.status-pill-inactive:hover { background: rgba(255,255,255,.07); color: var(--c-text2); }
.status-indicator {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill-active .status-indicator {
  background: var(--c-green);
  box-shadow: 0 0 8px var(--c-green);
  animation: pulse 2s infinite;
}
.status-pill-inactive .status-indicator { background: var(--c-text3); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* ─────────────────────────── PROJECT TAG ───────────────────────────── */
.proj-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid;
}
.proj-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-tag-lg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
}

/* ─────────────────────────── SELECT INLINE ─────────────────────────── */
.select-cell {
  font-family: inherit;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  background: var(--c-surface2);
  color: var(--c-text2);
  cursor: pointer;
  outline: none;
  max-width: 140px;
  transition: border-color var(--transition);
}
.select-cell:focus { border-color: var(--c-green); color: var(--c-text); }

/* ─────────────────────────── MODAL ─────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .18s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--c-border);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-title-icon {
  width: 32px; height: 32px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.modal-close {
  width: 30px; height: 30px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--c-text3);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}
.modal-close:hover { background: var(--c-surface2); color: var(--c-text); }

.modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--c-border);
}

/* ─────────────────────────── TOGGLE SWITCH ─────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.toggle {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--c-surface2);
  border: 1px solid var(--c-border2);
  border-radius: 24px;
  cursor: pointer;
  transition: all .2s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--c-text3);
  transition: all .2s;
}
.toggle input:checked + .toggle-track {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
}
.toggle input:checked + .toggle-track::before {
  background: var(--c-green);
  transform: translateX(20px);
  box-shadow: 0 0 8px rgba(0,230,118,.4);
}
.toggle-label { font-size: 13.5px; color: var(--c-text2); font-weight: 500; }

/* ─────────────────────────── PLACEHOLDER ───────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
}
.empty-icon {
  width: 72px; height: 72px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}
.empty-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--c-text); }
.empty-desc  { font-size: 14px; color: var(--c-text2); line-height: 1.6; margin-bottom: 24px; max-width: 320px; }

/* stub section */
.stub-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  max-width: 440px;
  margin: 40px auto;
}
.stub-icon {
  width: 68px; height: 68px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 20px;
}
.stub-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.stub-desc  { font-size: 13.5px; color: var(--c-text2); line-height: 1.65; margin-bottom: 24px; }
.stub-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  color: var(--c-green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.stub-badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-green);
  animation: pulse 2s infinite;
}

/* ─────────────────────────── SETTINGS ──────────────────────────────── */
.settings-layout { display: flex; flex-direction: column; gap: 24px; max-width: 620px; }

.settings-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.section-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--c-border);
}
.section-head-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-head-icon {
  width: 28px; height: 28px;
  background: var(--c-green-bg);
  border: 1px solid var(--c-green-bdr);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.section-head-desc { font-size: 13px; color: var(--c-text2); }

.section-body { padding: 18px 24px; }

.add-row { display: flex; gap: 10px; align-items: flex-end; }
.add-row .form-field { flex: 1; }

.proj-list { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.proj-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: border-color var(--transition);
}
.proj-item:hover { border-color: var(--c-border2); }
.proj-item-left { display: flex; align-items: center; gap: 10px; }

.no-projects { padding: 14px 0; color: var(--c-text3); font-size: 13px; }

/* ─────────────────────────── FILTER BAR ──────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-search {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.filter-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
}
.filter-input {
  width: 100%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  font-family: inherit;
  font-size: 16px;
  padding: 9px 36px 9px 36px;
  outline: none;
  transition: border-color var(--transition);
}
.filter-input:focus { border-color: var(--c-green); }
.filter-input::placeholder { color: var(--c-text3); }
.filter-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--c-text3);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
}
.filter-clear:hover { color: var(--c-text); }

.filter-select {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text2);
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
  min-width: 130px;
}
.filter-select:focus { border-color: var(--c-green); color: var(--c-text); }

.filter-reset { color: var(--c-red) !important; border-color: var(--c-red-bdr) !important; }
.filter-reset:hover { background: var(--c-red-bg) !important; }

/* ─────────────────────────── TAGS ──────────────────────────── */
.cell-tags {
  max-width: 180px;
}
.cell-tags .proj-tag {
  margin: 2px 2px 2px 0;
  display: inline-flex;
}
.btn-tag-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 5px;
  border: 1px dashed var(--c-border2);
  background: transparent;
  color: var(--c-text3);
  font-size: 13px;
  cursor: pointer;
  margin: 2px 0;
  transition: all var(--transition);
  vertical-align: middle;
}
.btn-tag-edit:hover { border-color: var(--c-green); color: var(--c-green); }

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-checkbox { display: flex; }
.tag-check-input { display: none; }
.tag-check-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  border: 1.5px solid;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  opacity: .5;
}
.tag-check-input:checked + .tag-check-label {
  opacity: 1;
  box-shadow: 0 0 0 2px currentColor;
}
.tag-check-label:hover { opacity: .85; }

/* ─────────────────────────── INLINE CELL EDIT ─────────────────────────── */
.cell-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--c-text2);
  font-family: inherit;
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
  width: 100%;
  min-width: 80px;
  transition: all var(--transition);
}
.cell-input:hover {
  border-color: var(--c-border);
  background: var(--c-surface2);
  color: var(--c-text);
}
.cell-input:focus {
  border-color: var(--c-green);
  background: var(--c-surface2);
  color: var(--c-text);
  box-shadow: 0 0 0 3px rgba(0,230,118,.1);
}
.cell-input-date {
  color-scheme: dark;
  min-width: 120px;
}
.inline-edit-form { display: block; }

/* ─────────────────────────── UPTIME ──────────────────────────── */
.uptime-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.uptime-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.uptime-up {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
  color: var(--c-green);
}
.uptime-up .uptime-dot {
  background: var(--c-green);
  box-shadow: 0 0 6px var(--c-green);
  animation: pulse 2s infinite;
}
.uptime-down {
  background: var(--c-red-bg);
  border-color: var(--c-red-bdr);
  color: var(--c-red);
}
.uptime-down .uptime-dot { background: var(--c-red); }
.uptime-degraded {
  background: var(--c-yellow-bg);
  border-color: var(--c-yellow-bdr);
  color: var(--c-yellow);
}
.uptime-degraded .uptime-dot { background: var(--c-yellow); }
.uptime-unknown {
  background: rgba(255,255,255,.04);
  border-color: var(--c-border2);
  color: var(--c-text3);
}
.uptime-unknown .uptime-dot { background: var(--c-text3); }

.table-hint { font-size: 12px; color: var(--c-text3); }

/* Monitor toggle pill */
.monitor-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.monitor-on {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
  color: var(--c-green);
}
.monitor-on:hover { background: rgba(0,230,118,.14); }
.monitor-on .monitor-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-green);
  box-shadow: 0 0 7px var(--c-green);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
.monitor-off {
  background: rgba(255,255,255,.04);
  border-color: var(--c-border2);
  color: var(--c-text3);
}
.monitor-off:hover { background: rgba(255,255,255,.07); color: var(--c-text2); }
.monitor-off .monitor-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-text3);
  flex-shrink: 0;
}

/* Filter tabs */
.filter-tabs {
  display: flex;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}
.filter-tab {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text2);
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.filter-tab:hover { background: var(--c-surface2); color: var(--c-text); }
.filter-tab.active {
  background: var(--c-green-bg);
  color: var(--c-green);
  font-weight: 600;
}

/* Dim row when monitor off */
.row-monitor-off { opacity: .55; }

/* ─────────────────────────── UPTIME SUMMARY ─────────────────────────── */
.uptime-summary {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  margin-top: 16px;
}
.uptime-summary-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.uptime-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uptime-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.uptime-chip:hover { transform: translateY(-1px); }
.uptime-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* chip by status */
.uptime-chip-up {
  background: var(--c-green-bg);
  border-color: var(--c-green-bdr);
  color: var(--c-green);
}
.uptime-chip-up .uptime-chip-dot {
  background: var(--c-green);
  box-shadow: 0 0 6px var(--c-green);
  animation: pulse 2s infinite;
}
.uptime-chip-down {
  background: var(--c-red-bg);
  border-color: var(--c-red-bdr);
  color: var(--c-red);
}
.uptime-chip-down .uptime-chip-dot { background: var(--c-red); }
.uptime-chip-degraded {
  background: var(--c-yellow-bg);
  border-color: var(--c-yellow-bdr);
  color: var(--c-yellow);
}
.uptime-chip-degraded .uptime-chip-dot { background: var(--c-yellow); }
.uptime-chip-unknown {
  background: rgba(255,255,255,.04);
  border-color: var(--c-border2);
  color: var(--c-text3);
}
.uptime-chip-unknown .uptime-chip-dot { background: var(--c-text3); }

.history-cnt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--c-surface2);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text2);
  margin-left: 2px;
}

/* Info cards (history page) */
.info-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 22px;
  min-width: 140px;
}
.info-card-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-text3);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 6px;
}
.info-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-text);
}

/* ─────────────────────────── LOG BOX ──────────────────────────── */
.check-desc {
  font-size: 13.5px;
  color: var(--c-text2);
  line-height: 1.6;
}
.log-box {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  height: 220px;
  overflow-y: auto;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--c-text2);
}
.log-placeholder { color: var(--c-text3); font-style: italic; }
.log-line { display: block; }
.log-line.info    { color: var(--c-text2); }
.log-line.warning { color: var(--c-yellow); }
.log-line.error   { color: var(--c-red); }
.log-line.success { color: var(--c-green); }
.log-spinner {
  display: inline-block;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────── ALERT (login) ──────────────────────────── */
.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius);
  background: var(--c-red-bg);
  border: 1px solid var(--c-red-bdr);
  color: var(--c-red);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE — ADX Admin Panel
   Breakpoints: 768px (tablet), 480px (phone)
   ═══════════════════════════════════════════════════ */

/* ── Burger button (hidden on desktop) ── */
.sidebar-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.sidebar-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.sidebar-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-burger.open span:nth-child(2) { opacity: 0; }
.sidebar-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay behind sidebar on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 768px) {

  /* Layout: stack vertically */
  .layout { flex-direction: column; }

  /* Sidebar: fixed drawer, slides in from left */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main: full width, no left margin */
  .main {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
  }

  /* Topbar: show burger */
  .topbar {
    padding: 0 14px;
    gap: 10px;
  }
  .sidebar-burger { display: flex; }
  .topbar-left { flex: 1; min-width: 0; }
  .topbar-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-breadcrumb { display: none; }
  .topbar-actions { gap: 6px; flex-wrap: wrap; }
  .topbar-actions .btn { font-size: 12px; padding: 5px 10px; }

  /* Content padding */
  .content { padding: 12px; }

  /* Filter bar: wrap */
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-search { width: 100%; }
  .filter-select { flex: 1; min-width: 120px; }
  .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }

  /* Tables: horizontal scroll */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  .data-table th, .data-table td { font-size: 12px; padding: 8px 10px; }

  /* Settings */
  .settings-layout { max-width: 100%; }

  /* Modals: full width */
  .modal { width: calc(100vw - 24px); max-width: 100%; margin: 12px; max-height: calc(100vh - 24px); }
  .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; }

  /* Domain cell */
  .cell-domain { max-width: 140px; }
  .domain-name { font-size: 12px; }

  /* URL cell in feeds */
  .cse-url-link { font-size: 11px; }

  /* History bar */
  .history-bar { gap: 1px; }
  .history-bar-item { min-width: 6px; }

  /* Uptime dots */
  .uptime-status { font-size: 11px; }

  /* Info cards */
  .info-cards { grid-template-columns: repeat(2, 1fr); }

  /* Add row in settings */
  .add-row { flex-wrap: wrap; }
  .add-row .form-field { width: 100%; }
  .form-row { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {

  .topbar { height: auto; min-height: 54px; padding: 8px 12px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .content { padding: 8px; }

  /* Tables: smaller text */
  .data-table th, .data-table td { font-size: 11px; padding: 6px 8px; }

  /* Contacts grid */
  .contacts-grid { grid-template-columns: 1fr 1fr; }

  /* Toolbar */
  .table-toolbar { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Filter tabs scroll */
  .filter-tabs { gap: 4px; }
  .filter-tab { font-size: 11px; padding: 4px 8px; }

  /* Modals */
  .modal { margin: 8px; width: calc(100vw - 16px); }

  /* Info cards: 1 col */
  .info-cards { grid-template-columns: 1fr; }

  /* Partner selector in feeds */
  .filter-select { font-size: 11px; }

  /* Stub card */
  .stub-card { padding: 32px 16px; }
}

/* ═══════════════════════════════════════════════════
   MOBILE RESPONSIVE — ADX Admin Panel
   Breakpoints: 768px (tablet), 480px (phone)
   ═══════════════════════════════════════════════════ */

/* ── Burger button (hidden on desktop) ── */
.sidebar-burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.sidebar-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.sidebar-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.sidebar-burger.open span:nth-child(2) { opacity: 0; }
.sidebar-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Overlay behind sidebar on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

@media (max-width: 768px) {

  /* Layout: stack vertically */
  .layout { flex-direction: column; }

  /* Sidebar: fixed drawer, slides in from left */
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    z-index: 200;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main: full width, no left margin */
  .main {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
  }

  /* Topbar: show burger */
  .topbar {
    padding: 0 14px;
    gap: 10px;
  }
  .sidebar-burger { display: flex; }
  .topbar-left { flex: 1; min-width: 0; }
  .topbar-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-breadcrumb { display: none; }
  .topbar-actions { gap: 6px; flex-wrap: wrap; }
  .topbar-actions .btn { font-size: 12px; padding: 5px 10px; }

  /* Content padding */
  .content { padding: 12px; }

  /* Filter bar: wrap */
  .filter-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filter-search { width: 100%; }
  .filter-select { flex: 1; min-width: 120px; }
  .filter-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }

  /* Tables: horizontal scroll */
  .table-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  .data-table th, .data-table td { font-size: 12px; padding: 8px 10px; }

  /* Settings */
  .settings-layout { max-width: 100%; }

  /* Modals: full width */
  .modal { width: calc(100vw - 24px); max-width: 100%; margin: 12px; max-height: calc(100vh - 24px); }
  .modal-body { max-height: calc(100vh - 200px); overflow-y: auto; }

  /* Domain cell */
  .cell-domain { max-width: 140px; }
  .domain-name { font-size: 12px; }

  /* URL cell in feeds */
  .cse-url-link { font-size: 11px; }

  /* History bar */
  .history-bar { gap: 1px; }
  .history-bar-item { min-width: 6px; }

  /* Uptime dots */
  .uptime-status { font-size: 11px; }

  /* Info cards */
  .info-cards { grid-template-columns: repeat(2, 1fr); }

  /* Add row in settings */
  .add-row { flex-wrap: wrap; }
  .add-row .form-field { width: 100%; }
  .form-row { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {

  .topbar { height: auto; min-height: 54px; padding: 8px 12px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
  .content { padding: 8px; }

  /* Tables: smaller text */
  .data-table th, .data-table td { font-size: 11px; padding: 6px 8px; }

  /* Contacts grid */
  .contacts-grid { grid-template-columns: 1fr 1fr; }

  /* Toolbar */
  .table-toolbar { flex-direction: column; align-items: flex-start; gap: 4px; }

  /* Filter tabs scroll */
  .filter-tabs { gap: 4px; }
  .filter-tab { font-size: 11px; padding: 4px 8px; }

  /* Modals */
  .modal { margin: 8px; width: calc(100vw - 16px); }

  /* Info cards: 1 col */
  .info-cards { grid-template-columns: 1fr; }

  /* Partner selector in feeds */
  .filter-select { font-size: 11px; }

  /* Stub card */
  .stub-card { padding: 32px 16px; }
}

/* ── Sidebar submenu ── */
.nav-item-group { position: relative; }
.nav-item-group > .nav-link-parent {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none;
}
.nav-item-group > .nav-link-parent .nav-arrow {
  font-size: 10px; color: var(--c-muted); transition: transform .2s; margin-left: auto; padding-left: 6px;
}
.nav-item-group.open > .nav-link-parent .nav-arrow { transform: rotate(90deg); }
.nav-submenu {
  display: none; flex-direction: column; gap: 2px;
  padding: 4px 0 4px 16px;
}
.nav-item-group.open > .nav-submenu { display: flex; }
.nav-submenu .nav-link {
  font-size: 12px; padding: 6px 10px;
  color: var(--c-muted);
}
.nav-submenu .nav-link:hover { color: var(--c-text); background: var(--c-surface2); }
.nav-submenu .nav-link.active { color: var(--c-accent); background: var(--c-surface2); }
