/* Modern theme variables */
:root {
  --bg: #0b1220;
  --fg: #e6edf3;
  --muted: #92a7bd;
  --card: #0f172a;
  --elev: #111b34;
  --line: #2d3d59;
  --primary: #2b78ff;
  --primary-600: #1f66e0;
  --accent: #00b894;
  --accent-600: #00a07f;
  --danger: #ff6b6b;
  /* alerts */
  --alert-err-bg: #261417;
  --alert-err-border: #4b1c21;
  --alert-err-fg: #ffb3b3;
  /* skeleton */
  --sk-a: rgba(255,255,255,0.05);
  --sk-b: rgba(255,255,255,0.10);
  --sk-c: rgba(255,255,255,0.05);
  /* fields */
  --field-bg: #0e1626;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #f0f4f8;
  --fg: #1e293b;
  --muted: #475569;
  --card: #ffffff;
  --elev: #ffffff;
  --line: #cbd5e1;
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --accent: #10b981;
  --accent-600: #059669;
  --danger: #ef4444;
  --alert-err-bg: #fee2e2;
  --alert-err-border: #fca5a5;
  --alert-err-fg: #991b1b;
  --sk-a: rgba(0,0,0,0.04);
  --sk-b: rgba(0,0,0,0.08);
  --sk-c: rgba(0,0,0,0.04);
  --field-bg: #f8fafc;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
}

/* Containers */
.container { max-width: 1120px; margin: 0 auto; padding: 24px; }
.container--sm { max-width: 420px; }

/* App shell */
.app-shell {
  display: grid;
  --sidebar-width: 260px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 260ms cubic-bezier(.2,.9,.2,1);
}
.sidebar { background: linear-gradient(180deg, #0c1326 0%, #0a1020 100%); border-right: 1px solid var(--line); padding: 16px; transition: padding 220ms ease; }
.sidebar { overflow: hidden; }
.content { padding: 24px; min-width: 0; }
:root[data-theme="light"] .sidebar { background: #ffffff; border-right: 1px solid #e2e8f0; }
.content { padding: 24px; }

/* Collapsed sidebar */
.app-shell.is-collapsed {
  --sidebar-width: 64px;
}
.app-shell.is-collapsed .sidebar { padding: 12px; }
/* animate hiding of textual elements instead of display:none so collapse can be smooth */
.brand__text, .sidebar__section-title, .recent-clear, .recent-list, .btn__label {
  transition: opacity 200ms ease, transform 200ms ease, max-width 200ms ease;
  will-change: opacity, transform;
}
.app-shell.is-collapsed .brand__text,
.app-shell.is-collapsed .sidebar__section-title,
.app-shell.is-collapsed .recent-clear,
.app-shell.is-collapsed .recent-list {
  opacity: 0;
  transform: translateX(-6px);
  pointer-events: none;
  max-height: 0;
}
.app-shell.is-collapsed .nav__item { display: grid; place-items: center; padding: 10px; font-size: 0; }
.app-shell.is-collapsed .nav__item .icon--mr { margin-right: 0; }
.app-shell.is-collapsed .btn__label { opacity: 0; transform: translateX(-6px); }

/* Keep brand logo visible and centered when sidebar is collapsed */
.app-shell.is-collapsed .brand { justify-content: center; }
.app-shell.is-collapsed .brand__logo { opacity: 1; transform: none; margin: 0 auto; width: 36px; height: 36px; }
.app-shell.is-collapsed .brand__logo-img { width: 100%; height: 100%; display: block; }

/* While collapsing, reduce pointer events on labels to avoid accidental clicks */
.app-shell.is-collapsing .btn__label,
.app-shell.is-collapsing .brand__text,
.app-shell.is-collapsing .sidebar__section-title,
.app-shell.is-collapsing .recent-list,
.app-shell.is-collapsing .recent-clear {
  pointer-events: none;
}
.btn--icon { display: inline-flex; align-items: center; gap: 8px; }
.btn--icon::before { content: ''; display: inline-block; width: 18px; height: 18px; background: currentColor;
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M3 12h18"/><path d="m15 5 7 7-7 7"/></svg>') no-repeat center / contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M3 12h18"/><path d="m15 5 7 7-7 7"/></svg>') no-repeat center / contain; }
.app-shell.is-collapsed #sidebarToggle::before { 
  mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M21 12H3"/><path d="m9 19-7-7 7-7"/></svg>') no-repeat center / contain;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path d="M21 12H3"/><path d="m9 19-7-7 7-7"/></svg>') no-repeat center / contain;
  display: inline-block;
  width: 18px;
  height: 18px;
  background: currentColor;
  vertical-align: middle;
}
.app-shell.is-collapsed .sidebar__nav { gap: 8px; }

/* Make the sidebar toggle visually match other collapsed squares */
.app-shell.is-collapsed #sidebarToggle {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  font-size: 0;
  margin: 8px auto 0 auto;
}

/* Improve provider/filter appearance when sidebar is collapsed */
.app-shell.is-collapsed .provider-tab,
.app-shell.is-collapsed .filter-tab {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  overflow: visible;
}
.app-shell.is-collapsed .provider-tab .btn__label,
.app-shell.is-collapsed .filter-tab .btn__label {
  /* labels are faded via .btn__label general rule to allow smooth animation */
  opacity: 0;
  transform: translateX(-6px);
}
.app-shell.is-collapsed .provider-tab .icon,
.app-shell.is-collapsed .filter-tab .icon { width:20px; height:20px; }

/* Provide clear focus/active visuals in collapsed state */
.app-shell.is-collapsed .provider-tab.is-active,
.app-shell.is-collapsed .filter-tab.is-active {
  background: linear-gradient(135deg, rgba(43,120,255,0.12), rgba(43,120,255,0.06));
  border-color: rgba(43,120,255,0.18);
}

/* Tooltips via title attribute remain available; ensure pointer cursor */
.app-shell.is-collapsed .provider-tab,
.app-shell.is-collapsed .filter-tab { cursor: pointer; }

/* Sidebar quick links (tickets, sim registry) styling */
.sidebar__quick-links { margin-top: 8px; }
.sidebar-quick-btn { display: block; text-align: center; width: 100%; margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1.5px solid var(--line); background: rgba(255,255,255,0.02); transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.sidebar-quick-btn:hover { background: rgba(255,255,255,0.05); border-color: #4a5a75; }
:root[data-theme="light"] .sidebar-quick-btn { background: #ffffff !important; border: 2px solid #94a3b8 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; }
:root[data-theme="light"] .sidebar-quick-btn:hover { background: #f8fafc !important; border-color: #64748b !important; box-shadow: 0 2px 5px rgba(0,0,0,0.12) !important; }
.sidebar-quick-btn .icon { vertical-align: middle; }

.app-shell.is-collapsed .sidebar-quick-btn {
  width: 44px; height: 44px; padding: 0; border-radius: 10px; display:inline-grid; place-items:center; font-size:0; margin: 8px auto 0 auto;
}
.app-shell.is-collapsed .sidebar-quick-btn .btn__label { opacity: 0; transform: translateX(-6px); }


/* Brand */
.brand { display: flex; gap: 12px; align-items: center; margin: 16px 0 20px; }
.brand--compact { margin-bottom: 24px; }
.brand__logo { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
/* Logo image inside brand */
.brand__logo-img { width: 100%; height: 100%; display: block; border-radius: 8px; }
.brand--login .brand__logo { background: transparent; padding: 0; }
.brand__text { line-height: 1.1; }
.brand__title { font-weight: 700; }
.brand__subtitle { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }

/* Topbar */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.topbar__title { font-size: 18px; font-weight: 600; }
.topbar__user { display: flex; align-items: center; gap: 12px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.card--elevated { background: linear-gradient(180deg, var(--elev), var(--card)); box-shadow: 0 8px 24px rgba(0,0,0,0.25); }
.card__title { margin: 0 0 6px; }
.card__subtitle { margin: 0 0 16px; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field__label { color: var(--muted); font-size: 13px; font-weight: 500; }
.input { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--field-bg); color: var(--fg); transition: all 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.3), 0 1px 3px rgba(0,0,0,0.25); }
:root[data-theme="light"] .input { border: 1.5px solid #cbd5e1; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
:root[data-theme="light"] .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.input--select { appearance: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: rgba(255,255,255,0.04); color: var(--fg); cursor: pointer; text-decoration: none; font-weight: 600; transition: all 0.15s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.btn:hover { background: rgba(255,255,255,0.08); border-color: #4a5a75; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.btn--primary { background: #3aa981; border-color: transparent; color: #0b1220; }
.btn--primary:hover { background: #2f8d6c; }

/* Light theme buttons */
:root[data-theme="light"] .btn { background: #ffffff; border: 1.5px solid #cbd5e1; color: #1e293b; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
:root[data-theme="light"] .btn:hover { background: #f8fafc; border-color: #94a3b8; box-shadow: 0 2px 4px rgba(0,0,0,0.08); }
:root[data-theme="light"] .btn--primary { color: #ffffff; border: none; box-shadow: 0 2px 4px rgba(37,99,235,0.2); }
:root[data-theme="light"] .btn--primary:hover { box-shadow: 0 4px 8px rgba(37,99,235,0.25); }
:root[data-theme="light"] .results .btn--primary { color: #ffffff; }
.btn--ghost { background: transparent; }
.btn--full { width: 100%; }
.btn i { width: 18px; height: 18px; display: inline-block; }
.btn__label { display: inline-block; transition: opacity 200ms ease, transform 200ms ease; }

/* Icon utilities */
.icon { width: 18px; height: 18px; vertical-align: middle; }
.icon--mr { margin-right: 8px; }

.btn-mon, .btn--primary {
  /* Primary action: gradient, white text, subtle elevation */
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #ffffff;
  border: 0;
  box-shadow: 0 2px 8px rgba(43,120,255,0.25), 0 8px 20px rgba(43,120,255,0.15);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn-mon:hover, .btn--primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(43,120,255,0.35), 0 12px 28px rgba(43,120,255,0.2); }
.btn-mon:active, .btn--primary:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(43,120,255,0.3); }
.btn-mon:focus-visible, .btn--primary:focus-visible { outline: 3px solid rgba(43,120,255,0.4); outline-offset: 2px; }

.btn-cms {
  /* CMS action: accent gradient, white text */
  background: linear-gradient(135deg, var(--accent), var(--accent-600));
  color: #ffffff;
  border: 0;
  box-shadow: 0 2px 8px rgba(0,184,148,0.25), 0 8px 20px rgba(0,184,148,0.15);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-cms:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,184,148,0.35), 0 12px 28px rgba(0,184,148,0.2); }
.btn-cms:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(0,184,148,0.3); }
.btn-cms:focus-visible { outline: 3px solid rgba(0,184,148,0.4); outline-offset: 2px; }

/* Compact button variant for tables/actions */
.btn--compact {
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 8px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--compact .btn__label { display: inline-block; }
:root[data-theme="dark"] .btn--compact { border-width: 1.5px; }

/* Small icon-only button variant that matches project style */
.btn--icon-sm {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--accent); /* use accent (green) like account icon */
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}
.btn--icon-sm:hover { background: var(--sk-a); border-color: var(--line); color: var(--accent-600); }
.btn--icon-sm svg { display: block; }
.btn--compact svg { width: 16px; height: 16px; }

/* tiny spinner for buttons */
.btn .spinner { display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,0.18); border-top-color: rgba(255,255,255,0.85); border-radius:50%; animation: spin .9s linear infinite; margin-left:6px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Utility for screen-reader-only text */
.visually-hidden { position: absolute !important; height: 1px; width: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; border: 0; padding: 0; margin: -1px; }

/* Alerts */
.alert { padding: 10px 12px; border-radius: 10px; margin: 10px 0; border: 1px solid var(--alert-err-border); }
.alert.error { background: var(--alert-err-bg); color: var(--alert-err-fg); }

/* Text helpers */
.muted { color: var(--muted); }

/* Search block */
.search-form { display: grid; grid-template-columns: 1fr 240px; gap: 10px; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 36px; }
.clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.input-wrap.has-value .clear-btn { opacity: 1; pointer-events: auto; }
.clear-btn:hover { background: rgba(0,0,0,0.08); }
:root[data-theme="light"] .clear-btn:hover { background: rgba(0,0,0,0.06); }

/* Results */
.results { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
thead { background: #0f192a; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { text-align: left; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: #0f1826; }

/* Light adjustments for table header/background hover */
:root[data-theme="light"] thead { background: #f3f6fb; }
:root[data-theme="light"] tbody tr:hover { background: #f8fafc; }

/* Legacy compat */
.header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.link{background:none;border:1px solid var(--line);color:var(--fg);cursor:pointer;padding:8px 10px;border-radius:8px}
.container.small{ max-width: 420px; }
.footer { text-align: center; padding: 12px 0; color: var(--muted); }

/* Sidebar nav */
.sidebar__nav { display: grid; gap: 6px; }
.nav__item { padding: 10px 12px; border-radius: 8px; color: var(--fg); text-decoration: none; display: block; border: 1px solid transparent; transition: all 0.15s ease; }
.nav__item--active, .nav__item:hover { background: var(--card); border-color: var(--line); }
:root[data-theme="dark"] .nav__item { border: 1px solid var(--line); background: rgba(255,255,255,0.02); }
:root[data-theme="dark"] .nav__item:hover { border-color: #4a5a75; background: rgba(255,255,255,0.05); }
:root[data-theme="light"] .nav__item { border: 2px solid #94a3b8 !important; background: #ffffff !important; box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; }
:root[data-theme="light"] .nav__item:hover { border-color: #64748b !important; background: #f8fafc !important; box-shadow: 0 2px 5px rgba(0,0,0,0.12) !important; }
.provider-tab { width: 100%; text-align: left; border: 1.5px solid var(--line); background: rgba(255,255,255,0.02); cursor: pointer; transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.provider-tab:hover { background: rgba(255,255,255,0.05); border-color: #4a5a75; }
.provider-tab.is-active { background: var(--card); border-color: var(--primary); }
:root[data-theme="light"] .provider-tab { background: rgba(0,0,0,0.01) !important; border: 1.5px solid #cbd5e1 !important; box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important; }
:root[data-theme="light"] .provider-tab:hover { background: #f8fafc !important; border-color: #94a3b8 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; }
:root[data-theme="light"] .provider-tab.is-active { background: #e0f2fe !important; border: 2px solid #2563eb !important; box-shadow: 0 1px 3px rgba(37,99,235,0.15) !important; }
.app-shell.is-collapsed .provider-tab { font-size: 0; padding: 10px; }
.filter-tab { width: 100%; text-align: left; border: 1.5px solid var(--line); background: rgba(255,255,255,0.02); cursor: pointer; transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.filter-tab:hover { background: rgba(255,255,255,0.05); border-color: #4a5a75; }
.filter-tab.is-active { background: var(--card); border-color: var(--primary); }
:root[data-theme="light"] .filter-tab { background: rgba(0,0,0,0.01) !important; border: 1.5px solid #cbd5e1 !important; box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important; }
:root[data-theme="light"] .filter-tab:hover { background: #f8fafc !important; border-color: #94a3b8 !important; box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important; }
:root[data-theme="light"] .filter-tab.is-active { background: #e0f2fe !important; border: 2px solid #2563eb !important; box-shadow: 0 1px 3px rgba(37,99,235,0.15) !important; }
.app-shell.is-collapsed .filter-tab { font-size: 0; padding: 10px; }

/* Sidebar sections */
.sidebar__section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sidebar__section-title { font-size: 12px; color: var(--muted); margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; }
.recent-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.recent-list li { display: flex; }
.recent-item { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 10px; border-radius: 8px; background: var(--card); border: 1.5px solid var(--line); color: var(--fg); cursor: pointer; text-decoration: none; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.recent-item:hover { background: #0f1826; border-color: #4a5a75; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
:root[data-theme="light"] .recent-item { background: #ffffff; border: 2px solid #94a3b8; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
:root[data-theme="light"] .recent-item:hover { background: #f8fafc; border-color: #64748b; box-shadow: 0 2px 5px rgba(0,0,0,0.12); }
.recent-item i { width: 16px; height: 16px; }
.recent-clear { width: 100%; background: rgba(255,255,255,0.02); border: 1.5px dashed var(--line); color: var(--muted); border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: 12px; transition: all 0.15s ease; }
.recent-clear:hover { background: rgba(255,255,255,0.05); border-color: #4a5a75; color: var(--fg); }
:root[data-theme="light"] .recent-clear { background: #ffffff; border: 2px dashed #94a3b8; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
:root[data-theme="light"] .recent-clear:hover { background: #f8fafc; border-color: #64748b; }
.recent-clear:hover { background: var(--card); color: var(--fg); }

/* Auth / Login */
.auth-layout { min-height: 100vh; display: flex; flex-direction: column; padding: 40px 20px; background: radial-gradient(ellipse at 30% 20%, rgba(43,120,255,0.18), transparent 70%), radial-gradient(ellipse at 80% 70%, rgba(0,184,148,0.14), transparent 70%), var(--bg); }
.auth-center { width: 100%; max-width: 420px; margin: auto; }
.brand--login { display: flex; gap: 14px; align-items: center; margin-bottom: 28px; justify-content: center; }
.brand--login .brand__logo { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; background: linear-gradient(135deg,#2b78ff,#00b894); }
.login-title { margin: 0 0 4px; font-size: 24px; font-weight: 600; text-align: center; }
.login-sub { margin: 0 0 20px; text-align: center; color: var(--muted); font-size: 14px; }
.divider { margin: 18px 0 6px; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; }
.auth-footer { text-align: center; margin-top: 32px; font-size: 12px; color: var(--muted); }
/* Auth animations */
.auth-card { animation: auth-in .52s cubic-bezier(.25,.46,.25,1.02); position: relative; }
@keyframes auth-in { 0% { opacity: 0; transform: translateY(14px) scale(.96); } 60% { opacity: 1; } 100% { opacity:1; transform: none; } }
/* Shake on error */
.shake { animation: shake .48s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
/* Theme toggle on auth */
.auth-theme-toggle { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.auth-theme-toggle:hover { background: rgba(255,255,255,0.08); }
:root[data-theme="light"] .auth-theme-toggle { background: rgba(0,0,0,0.04); }
:root[data-theme="light"] .auth-theme-toggle:hover { background: rgba(0,0,0,0.06); }
/* Auth button text color override */
.auth-card .btn.btn--primary { color: #fff; }

/* Animations */
.fade-in { animation: fade-in .2s ease-out; }
@keyframes fade-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }

/* Skeleton loaders */
.skeleton { position: relative; overflow: hidden; background: linear-gradient(90deg, var(--sk-a) 25%, var(--sk-b) 37%, var(--sk-c) 63%);
  background-size: 400% 100%; animation: shimmer 1.2s ease-in-out infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton-row { height: 42px; margin-bottom: 8px; }

/* Smooth page transition */
.page-enter { opacity: 0; transform: translateY(4px); }
.page-enter-active { opacity: 1; transform: none; transition: opacity .22s ease, transform .22s ease; }

/* Smooth theme transition (scoped) */
html.theme-anim, html.theme-anim body,
html.theme-anim .card, html.theme-anim .sidebar, html.theme-anim .content,
html.theme-anim .input, html.theme-anim .btn, html.theme-anim table,
html.theme-anim thead, html.theme-anim tbody tr, html.theme-anim th, html.theme-anim td,
html.theme-anim .brand__logo, html.theme-anim .topbar, html.theme-anim .nav__item,
html.theme-anim .alert, html.theme-anim .footer {
  transition: background-color .28s ease, color .28s ease, border-color .28s ease, box-shadow .28s ease;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-anim, html.theme-anim * { transition: none !important; }
}

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 9999; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--fg); box-shadow: 0 6px 24px rgba(0,0,0,0.25); animation: toast-in .22s ease; }
.toast--success { border-color: rgba(16, 185, 129, .35); }
.toast--error { border-color: rgba(239, 68, 68, .35); }
.toast--info { border-color: rgba(59,130,246,.35); }
.toast__icon { width: 18px; height: 18px; }

/* Responsive: tablet and phone adjustments */
@media (max-width: 900px) {
  .container { padding: 16px; }
  .app-shell {
    grid-template-columns: 1fr; /* single column */
  }
  .sidebar {
    position: relative;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }
  .content { padding: 16px; }
  .topbar { gap: 8px; flex-wrap: wrap; }
  .topbar__title { font-size: 16px; }
  /* search form stacks */
  .search-form { grid-template-columns: 1fr; }
  .search-form select, .search-form .input { width: 100%; }
  /* reduce table padding for small screens */
  th, td { padding: 8px 10px; }
  .brand { margin: 12px 0; }
}

@media (max-width: 600px) {
  /* compact mobile adjustments */
  .container { padding: 12px; }
  .sidebar { padding: 10px; }
  .brand__logo { width: 32px; height: 32px; }
  .brand__title { font-size: 14px; }
  .brand__subtitle { display: none; }
  .topbar__user { gap: 8px; }
  .btn { padding: 8px 10px; font-size: 14px; }
  .btn--compact { height: 30px; padding: 6px 8px; }
  .input { padding: 8px 10px; }
  /* Make tables horizontally scrollable with visible shadows removed */
  .results { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { border-radius: 8px; }
  /* Chat widget: move to bottom-right and use compact panel */
  .support-chat-widget { position: fixed; right: 12px; bottom: 12px; z-index: 1100; }
  .support-chat-panel { width: calc(100vw - 32px); max-width: 420px; right: 12px; left: auto; bottom: 72px; position: fixed; box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
  .support-chat-area { max-height: 240px; overflow:auto; }
  .support-chat-input { flex: 1; min-width: 0; }
  /* Private modal full-screen on mobile */
  .private-chat-modal { position: fixed; inset: 0; display: flex; flex-direction: column; z-index: 1200; }
  .private-chat-list { display: none; }
  .private-chat-conversation { flex: 1; padding: 12px; }
  .private-chat-composer { display:flex; gap:8px; padding: 8px; }
}

@media (max-width: 420px) {
  .topbar__title { font-size: 15px; }
  .sidebar__section { padding-top: 8px; }
  .nav__item { padding: 8px; }
  .btn__label { display: none; }
  .brand__logo { width: 30px; height: 30px; }
  .search-form { gap: 8px; }
}

/* Support chat widget (bottom-left) */
.support-chat-widget { position: fixed; left: 16px; bottom: 16px; z-index: 9998; transition: left .18s ease; }
.support-chat-widget .card { padding: 12px; box-shadow: 0 8px 28px rgba(0,0,0,0.28); }
.support-chat-widget .btn--icon-sm {
  width: auto;
  height: 36px;
  padding: 8px 12px;
  border-radius: 10px;
  /* ensure stable layout and centering of icon + label */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  min-width: 84px; /* avoid width jump when hovering */
  box-sizing: border-box;
  transition: background .14s ease, color .14s ease, border-color .14s ease, transform .14s ease;
}
.support-chat-widget .btn__label { font-weight: 700; white-space: nowrap; }

/* Override any generic hover/transform from other button variants to avoid visual nudge */
.support-chat-widget .btn--icon-sm:hover {
  transform: none !important;
  box-shadow: none !important;
}
.support-chat-widget .btn--icon-sm svg { display: block; width: 16px; height: 16px; flex: none; }
.support-chat-panel {
  width: 320px;
  max-width: calc(100vw - 40px);
  margin-top: 8px;
  /* start hidden but keep in flow for smooth animation */
  opacity: 0;
  transform: translateY(8px) scale(.99);
  transition: opacity .22s cubic-bezier(.2,.9,.2,1), transform .22s cubic-bezier(.2,.9,.2,1);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
}
.support-chat-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  max-height: 560px; /* allow content to show */
}
.support-chat-area { height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--card); }
.support-chat-input { flex: 1; }
.support-online-list { display: grid; gap: 6px; }

/* unread badge on chat toggle */
.support-chat-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  margin-left: 8px;
}

/* smaller message text for compactness */
.support-chat-area .message, .private-chat-modal .message { font-size: 13px; }
.support-chat-area .message .meta { font-size: 11px; }

/* online count pulse animation */
#supportOnlineCount {
  display: inline-block;
  transition: transform .18s ease, color .18s ease;
}
.count-pulse {
  animation: count-pop .5s cubic-bezier(.2,.9,.2,1);
}
@keyframes count-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* subtle slide+fade for panel children when opening */
.support-chat-panel.open .support-chat-area,
.support-chat-panel.open .support-chat-input,
.support-chat-panel.open .support-online-list {
  animation: content-fade .28s ease .06s both;
}
@keyframes content-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Align chat widget with sidebar when present. Using sibling selector because widget is placed after .app-shell */
.app-shell ~ .support-chat-widget { left: calc(260px + 16px); }
.app-shell.is-collapsed ~ .support-chat-widget { left: calc(64px + 16px); }

/* When sidebar collapsed, reduce min-width to keep button visually compact */
.app-shell.is-collapsed ~ .support-chat-widget .btn--icon-sm { min-width: 64px; padding: 8px; }

/* Small screens: keep widget near viewport edge */
@media (max-width: 720px) {
  .app-shell ~ .support-chat-widget, .app-shell.is-collapsed ~ .support-chat-widget { left: 16px; }
  .support-chat-widget .btn--icon-sm { min-width: 64px; }
}

/* sound toggle styles */
.support-sound-toggle { color: var(--muted); border: 1px solid transparent; background: transparent; transition: color .14s ease, background .14s ease; }
.support-sound-toggle[aria-pressed="true"] { color: var(--accent); }
.support-sound-toggle:hover { background: rgba(255,255,255,0.02); }

/* Private chat modal */
.private-chat-modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 760px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 32px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.45); display: grid; grid-template-columns: 260px 1fr; overflow: hidden; z-index: 10000; }
.private-chat-modal.hidden { display: none; }
.private-chat-header { display:flex; align-items:center; justify-content:space-between; padding:12px; border-bottom:1px solid var(--line); }
.private-chat-list { padding:12px; overflow:auto; border-right:1px solid var(--line); }
.dialog-item { display:flex; justify-content:space-between; align-items:center; gap:8px; padding:8px; border-radius:8px; cursor:pointer; background: transparent; color: var(--fg); border: 1px solid transparent; }
.dialog-item:hover { background: rgba(255,255,255,0.02); border-color: var(--line); }
.dialog-item.active { background: linear-gradient(90deg, rgba(43,120,255,0.06), transparent); border-color: rgba(43,120,255,0.12); }
.private-chat-conversation { padding:12px; display:flex; flex-direction:column; height:100%; }
.messages { flex:1; overflow:auto; padding-bottom:8px; }
.message { margin-bottom:10px; }
.message .meta { font-size:12px; color:var(--muted); margin-bottom:4px; }
.message.self { text-align:right; }
.private-chat-composer { display:flex; gap:8px; padding:12px; border-top:1px solid var(--line); }
.private-chat-composer .input { flex:1; }

@media (max-width: 820px){
  .private-chat-modal { width: calc(100vw - 24px); height: calc(100vh - 24px); grid-template-columns: 1fr; }
  .private-chat-list { border-right: none; border-bottom: 1px solid var(--line); }
}
.toast__close { margin-left: 8px; padding: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 6px; }
.toast__close:hover { background: rgba(0,0,0,0.08); }
:root[data-theme="light"] .toast__close:hover { background: rgba(0,0,0,0.06); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Empty states */
.empty { display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }
.empty__icon { width: 40px; height: 40px; margin-bottom: 8px; color: var(--muted); }
.empty__title { font-weight: 600; margin: 6px 0; color: var(--fg); }
.empty__desc { color: var(--muted); }
/* Dashboard enhancements */
.content { position: relative; }
.content::before { content:""; position:absolute; inset:0; pointer-events:none; background:
  radial-gradient(ellipse at 18% 22%, rgba(43,120,255,0.18), transparent 65%),
  radial-gradient(ellipse at 82% 78%, rgba(0,184,148,0.14), transparent 60%);
  opacity:.9;
}
.topbar { position: sticky; top:0; z-index: 30; backdrop-filter: blur(6px); background: linear-gradient(90deg, rgba(15,23,42,.92), rgba(15,23,42,.75)); padding: 12px 20px; border:1px solid var(--line); border-radius: 14px; margin-bottom:20px; }
.badges { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.badge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600; letter-spacing:.03em; padding:4px 10px 4px 8px; border-radius:20px; background:rgba(255,255,255,0.04); border:1px solid var(--line); color:var(--fg); position:relative; overflow:hidden; }
.badge::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--accent); box-shadow:0 0 0 4px rgba(255,255,255,0.04); }
.badge--prov-axenta { background: linear-gradient(135deg, rgba(43,120,255,.25), rgba(43,120,255,.08)); }
.badge--prov-wialon { background: linear-gradient(135deg, rgba(0,184,148,.25), rgba(0,184,148,.08)); }
.badge--mode { background: rgba(255,255,255,0.04); }
.search-card { position:relative; overflow:visible; }

/* Token owner badge (shown next to account name in search results) */
.token-owner-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(0,0,0,0.12), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.04);
  color: var(--muted);
}

/* Type badges for search results */
.type-badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.type-badge--account {
  background: rgba(43,120,255,0.15);
  color: #5b9aff;
  border: 1px solid rgba(43,120,255,0.3);
}
.type-badge--user {
  background: rgba(0,184,148,0.15);
  color: #00d9a7;
  border: 1px solid rgba(0,184,148,0.3);
}
.type-badge--unit,
.type-badge--object {
  background: rgba(255,193,7,0.15);
  color: #ffc947;
  border: 1px solid rgba(255,193,7,0.3);
}
:root[data-theme="light"] .type-badge--account {
  background: rgba(37,99,235,0.1);
  color: #1d4ed8;
  border-color: rgba(37,99,235,0.2);
}
:root[data-theme="light"] .type-badge--user {
  background: rgba(16,185,129,0.1);
  color: #059669;
  border-color: rgba(16,185,129,0.2);
}
:root[data-theme="light"] .type-badge--unit,
:root[data-theme="light"] .type-badge--object {
  background: rgba(245,158,11,0.1);
  color: #d97706;
  border-color: rgba(245,158,11,0.2);
}

/* Block status badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}
.status-badge--active { color: #22c55e; border-color: rgba(34,197,94,0.4); background: rgba(34,197,94,0.12); }
.status-badge--blocked { color: #f87171; border-color: rgba(248,113,113,0.45); background: rgba(248,113,113,0.16); }
:root[data-theme="light"] .status-badge { background: rgba(0,0,0,0.04); }
:root[data-theme="light"] .status-badge--active { color: #15803d; border-color: rgba(21,128,61,0.3); background: rgba(21,128,61,0.12); }
:root[data-theme="light"] .status-badge--blocked { color: #b91c1c; border-color: rgba(185,28,28,0.3); background: rgba(185,28,28,0.1); }

.search-card::after { content:""; position:absolute; inset:-1px; border-radius:12px; padding:1px; background:linear-gradient(135deg, rgba(43,120,255,.45), rgba(0,184,148,.45)); -webkit-mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask:linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite:xor; mask-composite:exclude; opacity:0; transition:opacity .35s ease; pointer-events:none; }
.search-card:focus-within::after, .search-card:hover::after { opacity:.5; }
.search-meta { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:14px; flex-wrap:wrap; }
.search-hint { font-size:12px; color: var(--muted); display:flex; align-items:center; gap:6px; }
.kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size:11px; padding:2px 6px; border:1px solid var(--line); border-radius:6px; background:rgba(255,255,255,0.06); color:var(--fg); }
:root[data-theme="light"] .kbd { background:rgba(0,0,0,0.04); }
.results table { transition: border-color .25s ease, background-color .25s ease; }
.results tbody tr { transition: background-color .18s ease; }
.results tbody tr:focus-within { outline:2px solid var(--primary); outline-offset:-2px; }
.pulse-border { animation: pulse-border 2.4s ease infinite; }
@keyframes pulse-border { 0% { box-shadow:0 0 0 0 rgba(43,120,255,.4); } 70% { box-shadow:0 0 0 10px rgba(43,120,255,0); } 100% { box-shadow:0 0 0 0 rgba(43,120,255,0); } }
.section__header h2 { margin:0 0 4px; font-size:18px; font-weight:600; }
.section__header small { color: var(--muted); font-size:12px; }
/* Compact mode */
.app-shell.is-compact .content { padding:12px; }
.app-shell.is-compact .topbar { padding:8px 12px; margin-bottom:12px; border-radius:10px; }
.app-shell.is-compact .card { padding:12px; border-radius:10px; }
.app-shell.is-compact .search-meta { margin-bottom:10px; }
.app-shell.is-compact .search-form { grid-template-columns: 1fr 200px; gap:8px; }
.app-shell.is-compact .input { padding:8px 10px; font-size:13px; }
.app-shell.is-compact table th, .app-shell.is-compact table td { padding:6px 8px; font-size:13px; }
.app-shell.is-compact .badge { padding:2px 8px; font-size:11px; }
.app-shell.is-compact .recent-list { max-height:140px; overflow:auto; }
.app-shell.is-compact .search-hint { display:none; }
.btn--sm { padding:6px 10px; border-radius:8px; font-size:13px; }
.app-shell.is-compact .btn { padding:8px 10px; }
.app-shell.is-compact .sidebar { padding:12px; }
.app-shell.is-compact .sidebar__section { margin-top:12px; padding-top:8px; }
.app-shell.is-compact .brand--compact { margin-bottom:16px; }

/* --- Light theme enhancements (UI polish) --- */
/* Improve visual hierarchy, contrasts and hover states specifically for light mode */
:root[data-theme="light"] .topbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: #d8dee6;
  box-shadow: 0 2px 6px rgba(15,23,42,0.05), 0 1px 0 rgba(255,255,255,0.6) inset;
}
:root[data-theme="light"] .sidebar {
  background: linear-gradient(180deg,#ffffff 0%,#f3f6fb 100%);
}
:root[data-theme="light"] .card {
  background: #ffffff;
  border-color: #dfe4eb;
  box-shadow: 0 2px 4px rgba(15,23,42,0.04), 0 4px 16px rgba(15,23,42,0.06);
}
:root[data-theme="light"] .card--elevated {
  background: linear-gradient(180deg,#ffffff,#f7f9fc);
  box-shadow: 0 4px 12px rgba(15,23,42,0.08), 0 1px 0 rgba(255,255,255,0.8) inset;
}

/* Buttons */
:root[data-theme="light"] .btn {
  background: #f1f5f9;
  border-color: #d4dbe4;
  color: #1f2937;
}
:root[data-theme="light"] .btn:hover { background:#e6edf4; }
:root[data-theme="light"] .btn--ghost { background: transparent; border-color: transparent; color: #475569; }
:root[data-theme="light"] .btn--ghost:hover { background:#eef3f9; border-color:#d4dbe4; }
:root[data-theme="light"] .btn--primary { background: var(--primary); border-color: var(--primary); color:#fff; }
:root[data-theme="light"] .btn--primary:hover { background: var(--primary-600); }

/* Navigation items */
:root[data-theme="light"] .nav__item { color:#1e293b; border:1px solid transparent; }
:root[data-theme="light"] .nav__item--active,
:root[data-theme="light"] .nav__item:hover { background:#eef3f9; border-color:#d0d9e3; }
:root[data-theme="light"] .provider-tab.is-active,
/* removed works-specific modal styles */

:root[data-theme="light"] .filter-tab.is-active { background:#eef3f9; border-color: var(--primary); }

/* Recent searches */
:root[data-theme="light"] .recent-item { background:#ffffff; border-color:#dfe4eb; color:#1f2937; }
:root[data-theme="light"] .recent-item:hover { background:#eef3f9; }
:root[data-theme="light"] .recent-clear { border-color:#d4dbe4; }
:root[data-theme="light"] .recent-clear:hover { background:#eef3f9; color:#1f2937; }

/* Table */
:root[data-theme="light"] table { background:#ffffff; border-color:#dfe4eb; }
:root[data-theme="light"] thead { background:#f1f5f9; }
:root[data-theme="light"] tbody tr:hover { background:#eef3f9; }
:root[data-theme="light"] th { color:#475569; }
:root[data-theme="light"] td { color:#1f2937; }

/* Inputs */
:root[data-theme="light"] .input { background:#ffffff; border-color:#cfd6df; color:#1f2937; }
:root[data-theme="light"] .input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.25); }

/* Badges */
:root[data-theme="light"] .badge { background:#eef3f9; border-color:#d0d9e3; color:#334155; }
:root[data-theme="light"] .badge--prov-axenta { background:linear-gradient(135deg, rgba(37,99,235,.18), rgba(37,99,235,.06)); }
:root[data-theme="light"] .badge--prov-wialon { background:linear-gradient(135deg, rgba(16,185,129,.18), rgba(16,185,129,.06)); }
:root[data-theme="light"] .badge--mode { background:#eef3f9; }

/* Search card glow intensity adjustment */
:root[data-theme="light"] .search-card::after { background:linear-gradient(135deg, rgba(37,99,235,.35), rgba(16,185,129,.35)); }

/* Clear search button hover */
:root[data-theme="light"] .clear-btn:hover { background:rgba(0,0,0,0.05); }

/* Toasts */
:root[data-theme="light"] .toast { background:#ffffff; border-color:#dfe4eb; color:#1f2937; box-shadow:0 4px 16px rgba(15,23,42,0.1); }

/* Empty state tweaks */
:root[data-theme="light"] .empty__title { color:#1f2937; }
:root[data-theme="light"] .empty__desc { color:#64748b; }

/* Background decorative gradients light variant */
:root[data-theme="light"] .content::before {
  background: radial-gradient(ellipse at 18% 22%, rgba(37,99,235,0.18), transparent 65%),
              radial-gradient(ellipse at 82% 78%, rgba(16,185,129,0.14), transparent 60%);
  opacity:.7;
}

/* Focus outlines for accessibility */
:root[data-theme="light"] .btn:focus-visible,
:root[data-theme="light"] .nav__item:focus-visible,
:root[data-theme="light"] .recent-item:focus-visible,
:root[data-theme="light"] .provider-tab:focus-visible,
:root[data-theme="light"] .filter-tab:focus-visible,
:root[data-theme="light"] .clear-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Override dark-specific hover backgrounds leaking into light */
:root[data-theme="light"] .recent-item:hover { background:#eef3f9; }

/* Compact mode minor adjustments */
:root[data-theme="light"] .app-shell.is-compact .topbar { background: rgba(255,255,255,0.9); }

/* Subtle divider color adjustments */
:root[data-theme="light"] .divider { background: linear-gradient(90deg, transparent, #d4dbe4, transparent); }

/* Improve contrast for muted text */
:root[data-theme="light"] .muted { color:#64748b; }

/* Adjust search hints kbd */
:root[data-theme="light"] .kbd { border-color:#d4dbe4; color:#1f2937; }

/* Provide subtle inner shadow on inputs in light mode */
:root[data-theme="light"] .input { box-shadow: 0 1px 2px rgba(15,23,42,0.05) inset; }

/* Table row focus */
:root[data-theme="light"] .results tbody tr:focus-within { outline:2px solid var(--primary); background:#e3ecf8; }

/* token owner badge shown in search results */
.token-owner-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 8px;
  font-size:12px;
  color:var(--muted);
  background:var(--surface);
  border-radius:12px;
  border:1px solid rgba(0,0,0,0.06);
}

/* Modal (centered popup) */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 9990; }
.modal[aria-hidden="false"] { display: flex; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(2,6,23,0.6); backdrop-filter: blur(3px); opacity: 0; transition: opacity .26s ease; }
.modal[aria-hidden="false"] .modal__backdrop { opacity: 1; }
.modal__sheet { position: relative; z-index: 9991; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; min-width: 320px; max-width: 760px; box-shadow: 0 18px 40px rgba(2,6,23,0.6); }
.modal__sheet h3 { margin: 0 0 8px; font-size: 18px; }
.modal__sheet .muted { margin-top: 6px; color: var(--muted); }
body.modal-open { overflow: hidden; }

@media (max-width: 520px) {
  .modal__sheet { width: calc(100% - 32px); margin: 0 16px; min-width: auto; }
}

/* Scale + fade animation for modal */
.modal__sheet { transform-origin: center center; transform: translateY(12px) scale(.96); opacity: 0; transition: transform .28s cubic-bezier(.2,.9,.2,1), opacity .2s ease; }
.modal[aria-hidden="false"] .modal__sheet { transform: translateY(0) scale(1); opacity: 1; }
.modal__sheet.modal-closing { transform: translateY(12px) scale(.96); opacity: 0; transition-duration: .18s; }

/* Respect reduced motion for modal animations */
@media (prefers-reduced-motion: reduce) {
  .modal__sheet, .modal__backdrop { transition: none !important; transform: none !important; opacity: 1 !important; }
}
