/* King Mobile UI — Light theme inspired by modern mobile/sidebar/login references */
:root {
  --primary: #6236ff;
  --primary-light: #ede9fe;
  --primary-hover: #5028e0;
  --bg-app: #eef0f6;
  --bg-sidebar: #f5f5f7;
  --bg-card: #ffffff;
  --text-primary: #1e1e2d;
  --text-secondary: #8e8e93;
  --text-muted: #aeaeb2;
  --border: #e8e8ed;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-nav: 0 8px 32px rgba(98, 54, 255, 0.15);
  --radius-lg: 20px;
  --radius-xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; }
body { font-family: Inter, system-ui, -apple-system, sans-serif; color: var(--text-primary); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }

/* ===== APP SHELL ===== */
.app-body { min-height: 100vh; background: var(--bg-app); }
.app-shell { display: flex; min-height: 100vh; }
.app-main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-bottom: 88px; }
.app-main { flex: 1; padding: 1rem 1.25rem 2rem; max-width: 1200px; width: 100%; margin: 0 auto; }

@media (min-width: 768px) {
  .app-main-wrap { padding-bottom: 0; margin-left: 260px; }
  .app-main { padding: 1.75rem 2rem 2.5rem; }
}

/* ===== SIDEBAR (desktop) ===== */
.sidebar {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  z-index: 40;
  padding: 16px;
}
@media (min-width: 768px) { .sidebar { display: block; } }

.sidebar-inner {
  height: 100%;
  background: var(--bg-sidebar);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo, .sidebar-logo-fallback {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex-shrink: 0;
}
.sidebar-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary);
}
.sidebar-brand-name { display: block; font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
.sidebar-brand-tag { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sidebar-section {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 12px 6px; margin: 0;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  transition: background 0.15s, color 0.15s; margin-bottom: 2px;
}
.sidebar-link:hover { background: #ebebed; color: var(--text-primary); }
.sidebar-link-active {
  background: #ebebed; color: var(--text-primary); font-weight: 600;
}
.sidebar-icon { width: 20px; height: 20px; flex-shrink: 0; opacity: 0.75; }
.sidebar-link-active .sidebar-icon { opacity: 1; color: var(--primary); }

.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  margin: 10px; padding: 12px;
  background: #ebebed; border-radius: 16px;
}
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.sidebar-profile-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.sidebar-profile-role { font-size: 11px; color: var(--text-secondary); }
.sidebar-profile-info { flex: 1; min-width: 0; }
.sidebar-logout {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); transition: background 0.15s;
}
.sidebar-logout:hover { background: rgba(0,0,0,0.06); color: var(--primary); }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}
.mobile-header-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.mobile-header-logo, .mobile-header-logo-fallback {
  width: 32px; height: 32px; border-radius: 10px; object-fit: cover;
}
.mobile-header-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary);
}
.mobile-header-role {
  font-size: 11px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); padding: 4px 10px; border-radius: 999px;
}

/* ===== MOBILE BOTTOM NAV (pill style) ===== */
.mobile-bottom-nav {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 50;
}
.mobile-bottom-nav-inner {
  display: flex; align-items: center; justify-content: space-around;
  background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 8px 10px; box-shadow: var(--shadow-nav);
  border: 1px solid rgba(255,255,255,0.8);
}
.mobile-nav-item {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 16px; border: none; background: none;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
  min-width: 44px;
}
.mobile-nav-item-active {
  background: var(--primary); color: #fff;
  box-shadow: 0 4px 14px rgba(98, 54, 255, 0.35);
  padding: 10px 18px;
}
.mobile-nav-icon { width: 22px; height: 22px; }
.mobile-nav-label { font-size: 12px; font-weight: 600; white-space: nowrap; }

.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35);
  z-index: 60; backdrop-filter: blur(2px);
}
.sheet-menu {
  position: fixed; bottom: 88px; left: 16px; right: 16px; z-index: 70;
  background: var(--bg-card); border-radius: var(--radius-xl);
  padding: 12px; box-shadow: var(--shadow-nav);
}
.sheet-menu-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); padding: 8px 12px 4px;
}
.sheet-menu-link {
  display: block; padding: 12px 14px; border-radius: 12px;
  font-size: 14px; font-weight: 500; color: var(--text-primary);
}
.sheet-menu-link:hover { background: #f5f5f7; }
.sheet-menu-link-danger { color: #ef4444; }
.sheet-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

/* ===== LOGIN PAGE ===== */
.login-body { min-height: 100vh; margin: 0; }
.login-page {
  min-height: 100vh; position: relative; overflow: hidden;
  background: linear-gradient(160deg, #7eb8ff 0%, #b8d4ff 35%, #dcecff 70%, #eef4ff 100%);
}
.login-bg-rings {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(98,54,255,0.08) 0%, transparent 45%);
}
.login-center {
  position: relative; z-index: 2;
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px 40px;
}
.login-glass-card {
  width: 100%; max-width: 420px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 32px 32px 28px;
  box-shadow: 0 20px 60px rgba(98, 54, 255, 0.12), 0 4px 20px rgba(0,0,0,0.06);
  text-align: center;
}
.login-card-brand {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 28px;
}
.login-card-logo, .login-card-logo-fallback {
  width: 64px; height: 64px; border-radius: 18px; object-fit: cover;
  box-shadow: 0 4px 16px rgba(98, 54, 255, 0.15);
}
.login-card-logo-fallback {
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light); color: var(--primary);
}
.login-card-name {
  font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.25;
}
.login-form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
.login-form .alert-error { margin-bottom: 4px; text-align: left; }
.login-footer-note { margin-top: 24px; font-size: 12px; color: var(--text-secondary); }

.input-icon-wrap { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex;
}
.input-with-icon { padding-left: 44px !important; background: rgba(255,255,255,0.9) !important; }

.btn-login-submit {
  width: 100%; margin-top: 8px; padding: 14px 20px;
  border: none; border-radius: 14px;
  background: linear-gradient(180deg, #2d2d3a 0%, #1a1a24 100%);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.btn-login-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }

/* ===== COMPONENTS ===== */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: #fff; cursor: pointer;
  background: var(--primary); transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 18px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  background: var(--bg-card); color: var(--text-primary); transition: background 0.15s;
}
.btn-secondary:hover { background: #f9f9fb; }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 12px; padding: 10px 18px;
  font-size: 14px; font-weight: 600; color: #fff; cursor: pointer;
  background: #ef4444; transition: background 0.15s;
}
.btn-danger:hover { background: #dc2626; }

.tab-btn {
  display: inline-flex; align-items: center; padding: 8px 16px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card); font-size: 14px; font-weight: 500;
  color: var(--text-primary); transition: all 0.15s;
}
.tab-btn-active { background: var(--primary); color: #fff; border-color: var(--primary); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow);
}

.input {
  width: 100%; border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 16px; font-size: 14px; outline: none;
  background: #f9f9fb; color: var(--text-primary); transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(98, 54, 255, 0.12);
  background: #fff;
}
.input::placeholder { color: var(--text-muted); }

.label {
  display: block; margin-bottom: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-secondary);
}

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.badge-new { background: #d1fae5; color: #047857; }
.badge-repaired { background: #fef3c7; color: #b45309; }
.badge-used { background: #dbeafe; color: #1d4ed8; }
.badge-wasted { background: #fee2e2; color: #b91c1c; }

.table-wrap {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--border); background: var(--bg-card); box-shadow: var(--shadow);
}
.table { width: 100%; min-width: 100%; text-align: left; font-size: 14px; }
.table th {
  background: #f9f9fb; padding: 12px 16px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-secondary);
}
.table td { border-top: 1px solid var(--border); padding: 12px 16px; color: var(--text-primary); }

.page-header { margin-bottom: 24px; }
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; line-height: 1.45; max-width: 42rem; }
.page-header.flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-header.flex.items-center { align-items: center; }
.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 16px;
}
.page-toolbar .input { flex: 1; min-width: 180px; }
.page-stack { display: flex; flex-direction: column; gap: 16px; }

.modal-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  pointer-events: none;
}
.modal-overlay[style*="display: none"] { pointer-events: none; }
.modal-overlay:not([style*="display: none"]) { pointer-events: auto; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(15, 17, 23, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 480px; max-height: min(92vh, 720px);
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.12), 0 24px 48px rgba(98, 54, 255, 0.08);
  overflow: hidden;
  pointer-events: auto;
}
.modal-handle {
  width: 40px; height: 4px; border-radius: 999px;
  background: #d1d1d6; margin: 10px auto 0;
}
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 20px 0;
}
.modal-header-text { min-width: 0; flex: 1; }
.modal-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 4px;
}
.modal-title { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.modal-close {
  flex-shrink: 0; width: 36px; height: 36px; border: none; border-radius: 12px;
  background: #f2f2f7; color: var(--text-secondary); font-size: 24px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: #e8e8ed; color: var(--text-primary); }
.modal-body {
  flex: 1; overflow-y: auto; padding: 16px 20px 8px;
  -webkit-overflow-scrolling: touch;
}
.modal-subtitle {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.45;
  word-break: break-word;
}
.modal-progress-wrap { margin-bottom: 18px; }
.modal-progress-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.modal-step-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--text-primary);
  background: var(--primary-light); color: var(--primary);
  padding: 6px 12px; border-radius: 999px; font-weight: 600;
}
.modal-progress-pct { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.modal-progress-track {
  height: 6px; border-radius: 999px; background: #ececf1; overflow: hidden;
}
.modal-progress-fill {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #8b6cff);
  transition: width 0.25s ease;
}
.input-lg { padding: 14px 16px; font-size: 16px; border-radius: 14px; }
.modal-hint { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.modal-error {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca;
}
.modal-actions {
  display: flex; flex-direction: column-reverse; gap: 10px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border); background: #fafafa;
}
.modal-btn { width: 100%; min-height: 48px; font-size: 15px; font-weight: 600; }

.modal-enter { transition: opacity 0.2s ease; }
.modal-enter-start { opacity: 0; }
.modal-enter-end { opacity: 1; }
.modal-leave { transition: opacity 0.15s ease; }
.modal-leave-start { opacity: 1; }
.modal-leave-end { opacity: 0; }
.modal-enter-start .modal-sheet,
.modal-leave-end .modal-sheet { transform: translateY(100%); }
.modal-enter-end .modal-sheet,
.modal-leave-start .modal-sheet { transform: translateY(0); }
.modal-sheet { transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1); }

html.modal-open, html.modal-open body { overflow: hidden; }

@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal-sheet {
    border-radius: var(--radius-lg);
    max-height: min(85vh, 640px);
  }
  .modal-handle { display: none; }
  .modal-header { padding: 24px 24px 0; }
  .modal-body { padding: 16px 24px 8px; }
  .modal-actions {
    flex-direction: row; justify-content: flex-end;
    padding: 16px 24px 24px;
  }
  .modal-btn { width: auto; min-width: 120px; }
}

@media (min-width: 640px) {
  .modal-enter-start .modal-sheet,
  .modal-leave-end .modal-sheet { transform: translateY(16px) scale(0.98); opacity: 0; }
  .modal-enter-end .modal-sheet,
  .modal-leave-start .modal-sheet { transform: translateY(0) scale(1); opacity: 1; }
  .modal-sheet { transition: transform 0.22s ease, opacity 0.22s ease; }
}

/* Direct purchase — table row per line */
.direct-purchase-page { width: 100%; max-width: 100%; margin: 0 auto; }

.purchase-lines-card { padding: 20px; }
.purchase-lines-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.purchase-lines-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.purchase-lines-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 36px; }
.btn-compact { padding: 8px 10px; font-size: 12px; min-height: 38px; white-space: nowrap; }

.purchase-empty {
  padding: 28px 16px; text-align: center; font-size: 14px; color: var(--text-secondary);
  border: 1px dashed var(--border); border-radius: 14px; background: #fafafa;
  margin-bottom: 16px;
}

.purchase-table-wrap { margin-bottom: 0; }
.purchase-lines-table { min-width: 880px; }
.purchase-lines-table th,
.purchase-lines-table td { vertical-align: middle; padding: 10px 12px; }
.purchase-lines-table .input-compact {
  padding: 8px 10px; font-size: 13px; min-height: 38px;
}
.purchase-col-no { width: 40px; text-align: center; color: var(--text-muted); font-weight: 600; }
.purchase-col-type { width: 88px; }
.purchase-col-product { min-width: 220px; }
.purchase-col-qty { width: 72px; }
.purchase-col-cost { width: 110px; }
.purchase-col-serials { width: 88px; text-align: center; }
.purchase-col-total { width: 120px; text-align: right; white-space: nowrap; }
.purchase-col-action { width: 44px; text-align: center; }

.purchase-type-badge {
  display: inline-block; padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.purchase-type-badge.is-mobile { background: var(--primary-light); color: var(--primary); }
.purchase-type-badge.is-accessory { background: #dbeafe; color: #1d4ed8; }

.purchase-line-total { font-size: 14px; font-weight: 700; color: var(--primary); }
.purchase-na { color: var(--text-muted); font-size: 14px; }
.purchase-line-remove {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: #fee2e2; color: #ef4444; font-size: 20px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.purchase-line-remove:hover { background: #fecaca; }
.purchase-serial-btn { width: 100%; }

.purchase-grand-total {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 20px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.purchase-grand-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.purchase-grand-value { font-size: 24px; font-weight: 700; color: var(--text-primary); }
.purchase-save-btn { width: 100%; min-height: 48px; font-size: 15px; }

@media (min-width: 640px) {
  .purchase-grand-total {
    flex-direction: row; align-items: center; justify-content: space-between;
  }
  .purchase-save-btn { width: auto; min-width: 200px; }
}

[x-cloak] { display: none !important; }

.stat-value { color: var(--primary); }
.stat-value-green { color: #10b981; }
.stat-value-blue { color: #3b82f6; }
.stat-value-amber { color: #f59e0b; }
.stat-value-red { color: #ef4444; }

.alert { border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.alert-success { border: 1px solid #a7f3d0; background: #ecfdf5; color: #065f46; }
.alert-error { border: 1px solid #fecaca; background: #fef2f2; color: #991b1b; }
.flash-wrap { padding: 0 0 12px; }

/* ===== LEGACY CLASS OVERRIDES (views) ===== */
.app-main .text-white { color: var(--text-primary) !important; }
.app-main .text-slate-100, .app-main .text-slate-200 { color: var(--text-primary) !important; }
.app-main .text-slate-300, .app-main .text-slate-400 { color: var(--text-secondary) !important; }
.app-main .text-slate-500, .app-main .text-slate-600 { color: var(--text-muted) !important; }
.app-main .text-king-400, .app-main a.text-king-400 { color: var(--primary) !important; }
.app-main .text-emerald-300, .app-main .text-emerald-400 { color: #10b981 !important; }
.app-main .text-amber-400 { color: #f59e0b !important; }
.app-main .text-blue-400 { color: #3b82f6 !important; }
.app-main .text-red-300, .app-main .text-red-400 { color: #ef4444 !important; }
.app-main .bg-surface-700, .app-main .bg-surface-800 { background: #f9f9fb !important; }
.app-main .border-surface-600 { border-color: var(--border) !important; }
.app-main .hover\:bg-surface-600:hover, .app-main .hover\:bg-surface-700:hover { background: #f0f0f5 !important; }
.app-main .hover\:border-king-500\/50:hover, .app-main .hover\:border-amber-500\/50:hover { border-color: var(--primary) !important; }

/* ===== UTILITIES ===== */
.flex { display: flex; }
.grid { display: grid; }
.hidden { display: none; }
.inline-flex { display: inline-flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-7 { grid-column: span 7; }
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-4 { width: 1rem; } .h-4 { height: 1rem; }
.w-5 { width: 1.25rem; } .h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; } .h-6 { height: 1.5rem; }
.max-w-xl { max-width: 36rem; }
.max-h-48 { max-height: 12rem; }
.max-h-96 { max-height: 24rem; }
.min-w-full { min-width: 100%; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.mb-1\.5 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.ml-2 { margin-left: 8px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-3 { padding: 12px; }
.p-8 { padding: 32px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-16 { padding-top: 64px; padding-bottom: 64px; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-4xl { font-size: 36px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, monospace; }
.uppercase { text-transform: uppercase; }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.border-t { border-top: 1px solid var(--border); }
.text-right { text-align: right; }
.\!py-2 { padding-top: 8px !important; padding-bottom: 8px !important; }
.\!px-3 { padding-left: 12px !important; padding-right: 12px !important; }
.\!py-1 { padding-top: 4px !important; padding-bottom: 4px !important; }
.\!text-xs { font-size: 12px !important; }
.\!w-full { width: 100% !important; }
.col-span-2 { grid-column: span 2 / span 2; }

@media (min-width: 768px) {
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .md\:col-span-3 { grid-column: span 3; }
  .md\:col-span-4 { grid-column: span 4; }
  .md\:flex { display: flex; }
}
@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media print { .no-print { display: none !important; } }
[x-cloak] { display: none !important; }
