/* =============================
   TrackYourShelves - Global Styles
   renderer/styles.css / assets/styles.css
============================= */
:root {
  --bg: #0e0f13;
  --bg-soft: #12131a;
  --panel: #151722;
  --panel-2: #1b1e2c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e9ecf2;
  --muted: #99a1b6;
  --accent: #5b6cff;
  --accent-2: #3e49c7;
  --good: #3bd16f;
  --warn: #ffb454;
  --bad: #ff6b6b;
  --shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --gap: 10px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  /* font scaling hook (UI.applyFontScale uses body font-size too) */
  --font-scale: 1;
}

/* Light theme overrides */
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f3f9;
  --border: rgba(0, 0, 0, 0.08);
  --text: #111827;
  --muted: #6b7280;
  --accent: #3448ff;
  --accent-2: #2231b0;
  --good: #12b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  height: 100%;
  overflow: hidden;
  transition: background 0.2s ease, color 0.2s ease;
  font-size: calc(16px * var(--font-scale));
}

/* Electron root */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =============================
   WEB APP SHELL (sidebar + main)
   Used by dashboard.html / settings.html / inventory.html etc.
============================= */
.app-shell {
  display: flex;
  height: 100vh;
  background: radial-gradient(
        1200px 800px at -10% -20%,
        rgba(91, 108, 255, 0.18),
        transparent 55%
      ),
    radial-gradient(
        900px 600px at 120% 10%,
        rgba(59, 209, 111, 0.1),
        transparent 60%
      ),
    var(--bg);
}

/* Sidebar nav */
.app-nav {
  width: 260px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(19, 22, 40, 0.96), rgba(10, 11, 20, 0.98));
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(91, 108, 255, 0.16), rgba(21, 23, 34, 0.9));
  border: 1px solid rgba(91, 108, 255, 0.4);
}
.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
}
.nav-logo-title {
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 15px;
}
.nav-logo-sub {
  font-size: 11px;
  color: var(--muted);
}
.nav-section-title {
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.16s ease, color 0.16s ease, transform 0.06s ease;
}
.nav-link .icon {
  width: 20px;
  text-align: center;
  opacity: 0.85;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  transform: translateX(1px);
}
.nav-link.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 0 20px rgba(91, 108, 255, 0.55);
}
.nav-link.active .icon {
  opacity: 1;
}
.nav-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
/* Make logout look like a pill button but reuse nav-link styles */
.nav-footer .nav-link {
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  font-size: 12px;
}

/* Main content */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* App header (page title + user chip) */
.app-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(
        900px 600px at 0% -40%,
        rgba(91, 108, 255, 0.26),
        transparent 55%
      ),
    linear-gradient(180deg, rgba(21, 23, 34, 0.98), rgba(13, 14, 22, 0.98));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 1;
}
.app-header-title h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.03em;
}
.app-header-sub {
  font-size: 12px;
  color: var(--muted);
}

/* User chip (top right) */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 13, 22, 0.82);
  font-size: 12px;
  color: var(--muted);
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}
.user-chip-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.user-chip-name {
  font-weight: 700;
  color: var(--text);
}
.user-chip-meta {
  font-size: 11px;
  color: var(--muted);
}

/* App content area */
.app-content {
  flex: 1;
  padding: 16px 18px 18px;
  overflow: auto;
}
/* Narrower on huge monitors so it doesn't look too stretched */
.app-content > .grid {
  max-width: 1240px;
}

/* Responsive: collapse sidebar on small screens (simple version) */
@media (max-width: 820px) {
  .app-shell {
    flex-direction: column;
  }
  .app-nav {
    flex-direction: row;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: 10px;
  }
  .nav-logo {
    min-width: 180px;
  }
  .nav-section-title {
    display: none;
  }
  .nav-list {
    flex-direction: row;
  }
  .nav-footer {
    margin-top: 0;
    margin-left: auto;
    border-top: none;
  }
  .app-main {
    height: calc(100vh - 68px);
  }
}

/* =============================
   Layout helpers
============================= */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.flex {
  display: flex;
  gap: var(--gap);
  align-items: center;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* "main" is used for Electron, .app-main overrides for web */
main {
  padding: 14px;
  overflow: auto;
  flex: 1;
}

/* =============================
   Header / Brand / Tabs (Electron)
============================= */
header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.3px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.tiny {
  font-size: 11px;
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--panel-2);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.tab-btn {
  padding: 8px 12px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, transform 0.06s ease, opacity 0.15s ease;
}
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
:root[data-theme="light"] .tab-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}
.tab-btn:active {
  transform: translateY(1px);
}
.tab-btn.active {
  background: var(--accent);
  color: white;
}

/* =============================
   Pages
============================= */
.page {
  display: none;
}
.page.active {
  display: block;
}

/* =============================
   Cards / Rows
============================= */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.cardish {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
}
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* =============================
   Buttons / Inputs
============================= */
button,
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 800;
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s ease, background 0.15s ease;
  font-family: var(--font);
}
button:hover,
.btn:hover {
  opacity: 0.92;
}
button:active,
.btn:active {
  transform: translateY(1px);
}
button.ghost,
.btn.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
button.tiny {
  padding: 6px 8px;
  font-size: 12px;
}
button.small {
  padding: 8px 10px;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  font-family: var(--font);
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
}

label {
  font-size: 13px;
  color: var(--muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.badge.tiny {
  font-size: 11px;
  padding: 5px 8px;
}
.badge.low,
.metric-warning {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc3c3;
  border-color: rgba(255, 107, 107, 0.4);
}
.badge.ok {
  background: rgba(59, 209, 111, 0.14);
  color: #c4f7d8;
  border-color: rgba(59, 209, 111, 0.3);
}
.badge.warn {
  background: rgba(255, 180, 84, 0.16);
  color: #ffe3b3;
  border-color: rgba(255, 180, 84, 0.32);
}

/* =============================
   Tables / list styles
============================= */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}
th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* =============================
   Hero / metrics (web landing/panel)
============================= */
.hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(
        1200px 700px at 10% -10%,
        rgba(91, 108, 255, 0.18),
        transparent 50%
      ),
    radial-gradient(
        1000px 600px at 120% 10%,
        rgba(59, 209, 111, 0.12),
        transparent 55%
      ),
    linear-gradient(180deg, rgba(10, 11, 20, 0.95), rgba(12, 13, 20, 0.98));
  padding: 60px 0;
}
.hero-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
}
.hero-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px;
}
.hero-card-header,
.hero-card-footer {
  color: var(--muted);
  font-size: 12px;
}
.hero-card-title {
  font-weight: 800;
  color: var(--text);
}
.hero-metric {
  margin: 6px 0;
}
.hero-metric .metric-value {
  font-size: 24px;
  font-weight: 900;
}
.badge-pill,
.link-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

/* =============================
   Auth screens (web app)
============================= */
.auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  max-width: 420px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.auth-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.auth-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 13px;
  background: var(--accent);
  color: white;
}
.auth-header-text h1 {
  margin: 0;
  font-size: 22px;
}
.auth-status {
  border-radius: 10px;
  padding: 10px;
}
.auth-status.info {
  background: rgba(91, 108, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(91, 108, 255, 0.3);
}
.auth-status.error {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc3c3;
  border: 1px solid rgba(255, 107, 107, 0.4);
}
.auth-status.success {
  background: rgba(59, 209, 111, 0.12);
  color: #c4f7d8;
  border: 1px solid rgba(59, 209, 111, 0.3);
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
}
.auth-tab.is-active {
  background: var(--accent);
  color: #fff;
}
.auth-tab-panel {
  display: none;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.link-button {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 0;
  font-size: 12px;
  cursor: pointer;
}

/* =============================
   Panels and sections (web)
============================= */
.section {
  padding: 50px 0;
}
.section.alt {
  background: var(--panel-2);
}
.section-header h2,
.section-header h1 {
  margin: 0;
  font-size: 26px;
}
.section-header p {
  color: var(--muted);
  margin-top: 6px;
}
.section-sm {
  margin-top: 24px;
}
.section-sm h2 {
  margin: 0 0 6px 0;
}

/* =============================
   Lists
============================= */
.icon-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}
.icon-list li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.icon-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
  display: inline-block;
}

/* =============================
   Misc
============================= */
.badge-pill {
  font-size: 11px;
}
.grid.three {
  grid-template-columns: repeat(3, 1fr);
}
.grid.two {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 900px) {
  .grid.three {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 700px) {
  .hero-content {
    grid-template-columns: 1fr;
  }
}

/* Remember Me row (Login only) */
.form-row.remember-me {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 6px 0 14px 0;
}

.form-row.remember-me label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.form-row.remember-me input[type="checkbox"]{
  width: 16px !important;
  height: 16px !important;
}

/* =============================
   Buttons
============================= */

button {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, transform .06s ease, opacity .15s ease, border .15s ease, box-shadow .15s ease;
  width: auto;
}

button:hover {
  background: var(--accent-2);
  box-shadow: 0 0 0 1px rgba(91,108,255,0.45);
}

button:active { transform: translateY(1px); }

button.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
button.ghost:hover { background: rgba(255,255,255,0.06); }
:root[data-theme="light"] button.ghost:hover { background: rgba(0,0,0,0.04); }

button.warn { background: var(--bad); }
button.warn:hover { opacity: 0.9; box-shadow: 0 0 0 1px rgba(255,107,107,0.4); }

button.small {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
}

button.tiny {
  padding: 2px 6px;
  font-size: 11px;
  border-radius: 7px;
}

/* =============================
   Status messages / errors
============================= */

.status {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.status.error,
.auth-error {
  color: #ffb3b3;
}

.status.success {
  color: #8bffb3;
}

/* =============================
   Badges
============================= */

.badge {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.badge.ok {
  background: rgba(59,209,111,0.15);
  color: var(--good);
  border-color: rgba(59,209,111,0.35);
}

/* low = orange */
.badge.warn,
.badge.low {
  background: rgba(255,180,84,0.15);
  color: var(--warn);
  border-color: rgba(255,180,84,0.35);
}

/* out/critical = red */
.badge.out,
.badge.bad {
  background: rgba(255,107,107,0.12);
  color: var(--bad);
  border-color: rgba(255,107,107,0.35);
}

.badge.tiny{
  font-size: 11px;
  padding: 2px 6px;
}

/* =============================
   Dashboard Widgets (Grid + Drag + Smooth Resize)
============================= */

.dash-header { padding: 12px; }

/* Responsive widget grid (12col desktop, 6col tablet, 2col mobile) */
.widgets-grid{
  display:grid;
  grid-template-columns:repeat(12, minmax(0,1fr));
  gap:12px;
  align-items:start;
}
@media (max-width:1100px){
  .widgets-grid{ grid-template-columns:repeat(6, minmax(0,1fr)); }
}
@media (max-width:720px){
  .widgets-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}

/* widget card base */
.widget-card{
  padding:10px 12px;
  gap:8px;
  min-height:120px;
  position:relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);

  /* smooth snap after resize/reorder */
  transition:
    width .16s ease,
    grid-column .16s ease,
    transform .12s ease,
    box-shadow .12s ease,
    border-color .12s ease;
  will-change: width, grid-column;
}

.widget-head{
  padding-bottom:6px;
  border-bottom:1px solid var(--panel-2);
  cursor:grab;
  user-select:none;
}
.widget-head:active{ cursor:grabbing; }

.widget-title{
  font-weight:900;
  font-size:14px;
}

.widget-controls button{
  line-height: 1;
}

.widget-body{ min-height:62px; }
.widget-foot{
  padding-top:6px;
  border-top:1px dashed var(--panel-2);
}

.glance-stat{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-height:60px;
}
.glance-num{
  font-size:34px;
  font-weight:900;
  line-height:1;
}

/* Drag placeholder + dragging state */
.widget-placeholder{
  background:var(--panel-2);
  border:2px dashed var(--accent);
  border-radius:12px;
  opacity:.6;
}
.widget-card.dragging{
  opacity:.95;
  box-shadow:0 14px 35px rgba(0,0,0,.45);
  border:1px solid var(--accent);
  border-radius:12px;

  /* disable snap while held */
  transition: none !important;
  will-change: transform;
}
.widget-card.resizing{
  outline:2px solid var(--accent);
  transition: none !important;
}

/* Resize handle bottom-right */
.resize-handle{
  position:absolute;
  right:6px;
  bottom:6px;
  width:16px;
  height:16px;
  cursor:nwse-resize;
  opacity:.65;
  border-right:3px solid var(--muted);
  border-bottom:3px solid var(--muted);
  border-radius:2px;
  transition: opacity .12s ease, border-color .12s ease;
}
.resize-handle:hover{
  opacity: 1;
  border-right-color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tips look good when skinny */
.tips-list{
  margin: 0;
  padding-left: 16px;
  line-height: 1.4;
}
.tips-list li{ margin: 4px 0; }

/* =============================
   Modal
============================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 999;
}

.modal.active { display: flex; }

.modal .box {
  width: min(920px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}

/* =============================
   AUTH PAGE UPGRADE
============================= */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(91,108,255,0.18), transparent 50%),
    radial-gradient(1000px 700px at 100% 10%, rgba(59,209,111,0.08), transparent 55%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-logo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 22px;
}

.auth-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
}

.auth-sub {
  font-size: 13px;
  color: var(--muted);
}

.auth-tabs {
  display: flex;
  gap: 6px;
  background: var(--panel-2);
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.auth-tab.active {
  background: var(--accent);
  color: white;
}

.auth-page { display: none; }
.auth-page.active { display: block; }

.auth-h2 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 900;
}

.auth-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.auth-btn {
  width: auto !important;
  min-width: 120px;
  padding: 9px 14px;
  border-radius: 10px;
  font-weight: 900;
}

.auth-btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.auth-error {
  margin-top: 6px;
  font-size: 12px;
  color: #ffb3b3;
}

/* =============================
   Compact Density Mode
   (UI.applyDensity toggles body.compact)
============================= */

body.compact {
  --gap: 6px;
}

body.compact main { padding: 10px; }

body.compact header {
  padding: 10px 12px;
  gap: 8px;
}

body.compact .brand h1 { font-size: 20px; }

body.compact .tabs {
  padding: 4px;
  gap: 4px;
}

body.compact .tab-btn {
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 8px;
}

body.compact .card {
  padding: 10px;
  border-radius: 14px;
}

body.compact .row {
  padding: 8px 10px;
  border-radius: 10px;
}

body.compact input,
body.compact select,
body.compact textarea {
  padding: 8px 10px;
  font-size: 13px;
}

body.compact textarea { min-height: 52px; }

body.compact button {
  padding: 8px 10px;
  font-size: 12px;
}

body.compact button.small {
  padding: 5px 8px;
  font-size: 11px;
}

body.compact button.tiny {
  padding: 2px 6px;
  font-size: 10.5px;
}

body.compact .widget-card {
  padding: 8px 10px;
  min-height: 105px;
}

body.compact .glance-num { font-size: 30px; }

/* =============================
   Scrollbars
============================= */

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
:root[data-theme="light"] *::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.12);
}

*::-webkit-scrollbar-track {
  background: transparent;
}
