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

/* ── Design tokens ───────────────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface-2:   #1c2333;
  --surface-3:   #21262d;
  --border:      rgba(255,255,255,0.07);
  --border-mid:  rgba(255,255,255,0.12);
  --text:        #e6edf3;
  --text-muted:  #7d8590;
  --text-subtle: #484f58;
  --blue:        #2f81f7;
  --blue-dim:    #1a4a8a;
  --green:       #3fb950;
  --red:         #f85149;
  --amber:       #d29922;
  --radius:      10px;
  --radius-sm:   6px;
  --shadow:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm:   0 1px 6px rgba(0,0,0,0.3);
  --transition:  0.15s ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }
.content-area { padding: 0 1.25rem; }

/* ── Cards / Containers ──────────────────────────────────────────────────── */
.form-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition);
}
.form-container:hover { border-color: var(--border-mid); }

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem;  font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 0.95rem; font-weight: 600; }

/* ── Labels ──────────────────────────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

/* ── Inputs ──────────────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47,129,247,0.15);
  background: var(--surface-3);
}
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
select { cursor: pointer; }
input[type="file"] { display: none; }
input[type="date"] { width: 100%; min-width: 0; }

.form-group { margin-bottom: 1rem; overflow: hidden; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  min-height: 36px;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}
button:hover  { background: #388bfd; }
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* Variants */
.delete-btn, button[class*="danger"], button[class*="red"] {
  background: transparent;
  color: var(--red);
  border-color: rgba(248,81,73,0.3);
}
.delete-btn:hover { background: rgba(248,81,73,0.12); border-color: var(--red); }

.refresh-btn, .sync-btn { background: var(--surface-3); color: var(--text); border-color: var(--border-mid); }
.refresh-btn:hover, .sync-btn:hover { background: var(--surface-2); border-color: var(--border-mid); }

.install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(63,185,80,0.15);
  color: var(--green);
  border: 1px solid rgba(63,185,80,0.3);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  min-height: 36px;
  transition: all var(--transition);
  text-decoration: none;
}
.install-btn:hover { background: rgba(63,185,80,0.22); text-decoration: none; }

.file-input-label {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  min-height: 36px;
  transition: all var(--transition);
}
.file-input-label:hover { background: var(--surface-2); color: var(--text); }

.button-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Sidebar shell (sb-*) ────────────────────────────────────────────────── */

/* Layout root */
.sb-root { min-height: 100vh; background: var(--bg); }

/* Top bar */
.sb-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

/* Brand */
.sb-brand { display: flex; align-items: center; gap: 10px; margin-left: 4px; }
.sb-brand-logo {
  width: 32px; height: 32px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 8px rgba(167,139,250,.4));
}
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.sb-brand-name {
  font-size: 15px; font-weight: 700; letter-spacing: -.01em;
  background: linear-gradient(to right, var(--brand-from, #fbbf24), var(--brand-to, #f59e0b));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.sb-brand-tag {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  background: linear-gradient(to right, var(--brand-from, #fbbf24), var(--brand-to, #f59e0b));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: .75;
}

/* Topbar right actions */
.sb-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.sb-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: transparent; border: none; color: var(--text-muted);
  cursor: pointer; transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.sb-icon-btn:hover { background: var(--surface-3); color: var(--text); }

.sb-action-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--transition), opacity var(--transition);
  white-space: nowrap; min-height: 32px;
}
.sb-action-btn:hover { opacity: .85; }
.sb-action-btn:active { transform: scale(.97); opacity: 1; }
.sb-action-green { background: rgba(63,185,80,.15); color: #3fb950; border-color: rgba(63,185,80,.25); }
.sb-action-green:hover { background: rgba(63,185,80,.25); opacity: 1; }
.sb-action-blue  { background: rgba(47,129,247,.15); color: #58a6ff; border-color: rgba(47,129,247,.25); }
.sb-action-blue:hover  { background: rgba(47,129,247,.25); opacity: 1; }
.sb-action-red   { background: rgba(248,81,73,.15);  color: #f85149; border-color: rgba(248,81,73,.25); }
.sb-action-red:hover   { background: rgba(248,81,73,.25);  opacity: 1; }
.sb-action-label { display: none; }
@media (min-width: 640px) { .sb-action-label { display: inline; } }

/* Credits badge */
.sb-credits {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: rgba(210,153,34,.12); color: #e3a008;
  border: 1px solid rgba(210,153,34,.25);
  font-size: 13px; font-weight: 600;
}

/* Sidebar panel */
.sb-sidebar {
  position: fixed;
  top: 56px; left: 0;
  width: 220px;
  height: calc(100vh - 56px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow: hidden;
  transition: width .22s ease;
  display: flex; flex-direction: column;
}
.sb-sidebar-collapsed { width: 56px; }

/* Nav scroll area */
.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px 16px;
  scrollbar-width: none;
}
.sb-nav::-webkit-scrollbar { display: none; }

/* Group label */
.sb-nav-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-subtle);
  padding: 14px 8px 4px; white-space: nowrap; overflow: hidden;
}

/* Nav divider */
.sb-nav-divider { height: 1px; background: var(--border); margin: 6px 4px 2px; }

/* Nav item */
.sb-nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 9px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; min-height: 36px;
  text-align: left; white-space: nowrap; overflow: hidden;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  position: relative;
}
.sb-nav-item:hover { background: var(--surface-3); color: var(--text); transform: none; }
.sb-nav-item:active { opacity: .8; transform: none; }

/* Active item */
.sb-nav-active {
  background: rgba(47,129,247,.1) !important;
  color: #58a6ff !important;
  border-color: rgba(47,129,247,.18) !important;
}
.sb-nav-active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; border-radius: 99px; background: #2f81f7;
}
.sb-nav-active:hover { background: rgba(47,129,247,.16) !important; }

/* Icon-only (collapsed) */
.sb-nav-icon-only { justify-content: center; padding: 8px; }
.sb-nav-icon-only .sb-nav-lb { display: none; }

/* Sub-items */
.sb-nav-sub { padding-left: 30px; font-size: 12.5px; min-height: 32px; color: var(--text-subtle); }
.sb-nav-sub:hover { color: var(--text-muted); }
.sb-nav-sub.sb-nav-active { color: #58a6ff !important; }
.sb-nav-sub.sb-nav-active::before { left: 0; }

/* Icon */
.sb-nav-ic { width: 16px; height: 16px; flex-shrink: 0; color: inherit; }

/* Label */
.sb-nav-lb { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* Chevron */
.sb-nav-chevron { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-subtle); margin-left: auto; }

/* Main content area */
.sb-main {
  padding-top: 56px;
  margin-left: 220px;
  transition: margin-left .22s ease;
  min-height: 100vh;
}
.sb-main-collapsed { margin-left: 56px; }
.sb-content-slot { padding: 24px; max-width: 1280px; }

/* Mobile: sidebar slides over content */
@media (max-width: 1023px) {
  .sb-sidebar {
    transform: translateX(-100%);
    transition: transform .22s ease, width .22s ease;
    width: 220px !important;
    box-shadow: none;
  }
  .sb-sidebar:not(.sb-sidebar-collapsed) {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.6);
  }
  .sb-main, .sb-main-collapsed { margin-left: 0 !important; }
}

/* ── Legacy sidebar classes (kept for compatibility) ─────────────────────── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.sidebar-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  margin: 1px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  transition: all var(--transition);
  gap: 10px;
}
.sidebar-item:hover { background: var(--surface-3); color: var(--text); }
.sidebar-item.active {
  background: rgba(47,129,247,0.15);
  color: var(--blue);
  border: 1px solid rgba(47,129,247,0.25);
}

/* ── lp-nav-* (legacy alias → sb-nav-*) ─────────────────────────────────── */
.lp-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  min-height: 38px;
  text-align: left;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
}
.lp-nav-item:hover {
  background: var(--surface-3);
  color: var(--text);
  transform: none;
}
.lp-nav-item:active { transform: none; opacity: 0.85; }

.lp-nav-active {
  background: rgba(47,129,247,0.12) !important;
  border-color: rgba(47,129,247,0.2) !important;
  color: #58a6ff !important;
}
.lp-nav-active:hover { background: rgba(47,129,247,0.18) !important; }

/* Collapsed (icon-only) state */
.lp-nav-collapsed {
  justify-content: center;
  padding: 9px;
}

/* Sub-items */
.lp-nav-sub {
  padding-left: 36px;
  font-size: 12.5px;
  color: var(--text-subtle);
  min-height: 34px;
}
.lp-nav-sub:hover { color: var(--text-muted); }
.lp-nav-sub.lp-nav-active { color: #58a6ff !important; padding-left: 36px; }

/* Icon wrapper */
.lp-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: inherit;
}

/* Label */
.lp-nav-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Chevron pushed to the right */
.lp-nav-chevron {
  flex-shrink: 0;
  color: var(--text-subtle);
  margin-left: auto;
  transition: transform var(--transition);
}

/* Section divider inside nav */
.lp-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 4px;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: transparent;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  min-width: 80px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition); }
tbody tr:hover td { background: var(--surface-3); }

/* ── Cards: Addons & Users ───────────────────────────────────────────────── */
.addon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.users-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 1rem; }

.addon-item, .user-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.addon-item:hover, .user-item:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-sm);
}

.addon-item img {
  max-width: 72px;
  height: auto;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.addon-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}
.addon-title { font-size: 0.95rem; font-weight: 600; color: var(--text); word-break: break-word; }
.addon-version { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.addon-description { margin: 8px 0; color: var(--text-muted); font-size: 13px; line-height: 1.5; }
.addon-url {
  word-break: break-all;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: var(--text-muted);
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge, [class*="badge"] {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Progress ────────────────────────────────────────────────────────────── */
.sync-progress {
  padding: 1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.sync-status { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar { height: 4px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--blue); width: 0; border-radius: 99px; transition: width 0.3s ease; }

/* ── States ──────────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.loading i { color: var(--blue); }

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius);
}
.empty-state i { font-size: 40px; display: block; margin-bottom: 1rem; color: var(--text-subtle); }

.error {
  background: rgba(248,81,73,0.1);
  border: 1px solid rgba(248,81,73,0.25);
  color: #ffa198;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ── Modals ──────────────────────────────────────────────────────────────── */
.modal {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.modal-header { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 1rem; }
.modal-footer { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 1rem; }

/* ── Notifications ───────────────────────────────────────────────────────── */
.notification {
  padding: 10px 14px;
  border-left: 3px solid var(--blue);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  margin: 8px 0;
}
.notification.success { border-color: var(--green); }
.notification.error   { border-color: var(--red); }
.notification.warning { border-color: var(--amber); }

/* ── User info ───────────────────────────────────────────────────────────── */
.user-info-section { flex: 1; min-width: 0; }
.user-info-section h3 { word-break: break-word; font-size: 0.9rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bg-gray-800.border-b { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .addon-grid { grid-template-columns: 1fr; gap: 12px; }
  .button-group { flex-direction: column; width: 100%; }
  button { width: 100%; margin-right: 0; margin-bottom: 6px; }
  .form-container { padding: 1rem; }
  .fixed.left-0.top-16 {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 40;
    width: 272px !important;
    max-width: 272px;
  }
  .fixed.left-0.top-16.w-64 {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.6);
  }
  .pt-16.transition-all { margin-left: 0 !important; }
  .sync-progress { position: sticky; top: 80px; z-index: 10; }
  .addon-header { flex-direction: column; align-items: flex-start; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  input[type="date"] { width: 100%; min-width: 0; }
  .user-item .flex.gap-2, .addon-item .flex.gap-2 { flex-direction: column; width: 100%; }
  .user-item button, .addon-item button { width: 100%; }
}

@media (max-width: 480px) {
  .form-container { padding: 0.875rem; border-radius: var(--radius-sm); }
  .addon-item, .user-item { padding: 0.875rem; }
  h1 { font-size: 1.1rem !important; }
  h2 { font-size: 1rem !important; }
  button { padding: 9px 12px; font-size: 13px; }
  .fixed.left-0.top-16 { width: 256px !important; max-width: 256px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .form-container, .addon-item, .user-item { padding: 0.75rem 1rem; }
  .fixed.top-0 { height: 48px !important; }
  .pt-16 { padding-top: 48px !important; }
  .fixed.left-0.top-16 { top: 48px !important; height: calc(100vh - 48px) !important; }
}

@media (hover: none) and (pointer: coarse) {
  button, .sidebar-item, input, select { min-height: 44px; }
  button:hover, .sidebar-item:hover, .addon-item:hover, .user-item:hover { transform: none; }
  button:active { opacity: 0.8; }
}

/* ── Sidebar backdrop ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body::after {
    content: '';
    position: fixed;
    inset: 64px 0 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    z-index: 30;
    pointer-events: none;
  }
  body.sidebar-open::after { opacity: 1; visibility: visible; pointer-events: auto; }
  body.sidebar-open { overflow: hidden; }
}

/* ── Tailwind overrides ───────────────────────────────────────────────────── */
/* Make Tailwind gray palette match our tokens */
.bg-gray-900  { background-color: var(--bg) !important; }
.bg-gray-800  { background-color: var(--surface) !important; }
.bg-gray-700  { background-color: var(--surface-2) !important; }
.bg-gray-600  { background-color: var(--surface-3) !important; }
.border-gray-700 { border-color: var(--border) !important; }
.border-gray-600 { border-color: var(--border-mid) !important; }
.text-gray-400 { color: var(--text-muted) !important; }
.text-gray-500 { color: var(--text-subtle) !important; }
.text-gray-200, .text-gray-100 { color: var(--text) !important; }

/* Cleaner Tailwind cards */
.rounded-lg  { border-radius: var(--radius) !important; }
.rounded-md  { border-radius: var(--radius-sm) !important; }
.shadow      { box-shadow: var(--shadow-sm) !important; }
.shadow-lg   { box-shadow: var(--shadow) !important; }

/* Tailwind inputs */
.border.border-gray-600 {
  border: 1px solid var(--border-mid) !important;
}
input.bg-gray-700, select.bg-gray-700, textarea.bg-gray-700 {
  background: var(--surface-2) !important;
}

/* Buttons from Tailwind */
.bg-blue-600  { background-color: var(--blue) !important; }
.bg-blue-700  { background-color: #1a6fd4 !important; }
.hover\:bg-blue-700:hover { background-color: #388bfd !important; }
.bg-red-600   { background-color: var(--red) !important; }
.bg-green-600 { background-color: var(--green) !important; }
.bg-amber-600 { background-color: #f0883e !important; }
.hover\:bg-amber-700:hover { background-color: #d4762f !important; }

/* Sidebar active state */
.bg-blue-700.text-white { background-color: rgba(47,129,247,0.15) !important; color: var(--blue) !important; }

/* Top bar */
.fixed.top-0.left-0.right-0 { border-bottom: 1px solid var(--border-mid) !important; }

/* Sidebar panel */
#appSidebar {
  background: var(--surface) !important;
  border-right: 1px solid var(--border) !important;
}
#appSidebar nav { padding: 10px 8px; }

/* Top bar panel */
#appTopbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border-mid) !important;
  box-shadow: 0 1px 0 var(--border) !important;
}

/* Dividers */
.divide-y > * + * { border-top: 1px solid var(--border) !important; }
.border-t { border-top: 1px solid var(--border) !important; }
.border-b { border-bottom: 1px solid var(--border) !important; }

/* ── Accessibility ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body { background: white; color: black; }
  .form-container, .addon-item, .user-item { box-shadow: none; border: 1px solid #ddd; }
  .no-print, .sidebar, .fixed.top-0, button { display: none !important; }
  .pt-16 { padding-top: 0 !important; margin-left: 0 !important; }
}
