:root {
  --sidebar-bg-start: #1e1b4b;
  --sidebar-bg-end: #4c1d95;
  --sidebar-w: 220px;
  --topbar-h: 54px;
  --primary: #7c3aed;
  --primary-light: #f3e8ff;
  --primary-border: #e9d5ff;
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --green: #059669;
  --green-light: #d1fae5;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --red: #dc2626;
  --red-light: #fee2e2;
  --pink: #db2777;
  --pink-light: #fce7f3;
  --teal: #0d9488;
  --gray-50: #faf5ff;
  --gray-100: #f3e8ff;
  --gray-200: #e9d5ff;
  --gray-300: #d8b4fe;
  --gray-400: #a78bfa;
  --gray-500: #7c3aed;
  --gray-600: #6d28d9;
  --gray-700: #4c1d95;
  --gray-800: #3b0764;
  --gray-900: #1e1b4b;
  --text-dark: #1e1b4b;
  --text-mid: #4c1d95;
  --text-muted: #94a3b8;
  --border: #e9d5ff;
  --bg-page: #f8f7ff;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(124,58,237,.08);
  --shadow-md: 0 4px 16px rgba(124,58,237,.12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif; background: var(--bg-page); color: var(--text-dark); font-size: 14px; line-height: 1.5; }

/* SIDEBAR */
.sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: linear-gradient(160deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%); display: flex; flex-direction: column; z-index: 100; overflow-y: auto; overflow-x: hidden; }
.sidebar-logo { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-logo h1 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; background: linear-gradient(90deg,#fff,#c4b5fd); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-logo h1 span { background: linear-gradient(90deg,#a78bfa,#60a5fa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-logo p { color: rgba(255,255,255,.35); font-size: 11px; margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 10px 0; }
.nav-group { padding: 10px 18px 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.3); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 18px; color: rgba(255,255,255,.55); font-size: 13px; text-decoration: none; border-left: 3px solid transparent; transition: all .15s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-link.active { color: #fff; background: rgba(255,255,255,.12); border-left-color: #a78bfa; }
.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.nav-link.sub { padding-left: 42px; font-size: 12px; }
.nav-link.sub svg { width: 13px; height: 13px; }
.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 6px 0; }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#a78bfa,#60a5fa); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info p { color: #e2e8f0; font-size: 12px; font-weight: 600; }
.sidebar-user-info span { color: rgba(255,255,255,.35); font-size: 11px; }
.sidebar-logout { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: rgba(255,255,255,.4); font-size: 12px; cursor: pointer; background: none; border: none; width: 100%; margin-top: 8px; font-family: inherit; transition: color .15s; }
.sidebar-logout:hover { color: rgba(255,255,255,.7); }
.sidebar-logout svg { width: 14px; height: 14px; }

/* MAIN */
.main-wrap { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); height: var(--topbar-h); display: flex; align-items: center; padding: 0 20px; gap: 12px; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 var(--border); }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text-dark); flex: 1; }
.topbar-search { flex: 1; max-width: 300px; background: var(--gray-50); border: 1px solid var(--border); border-radius: 20px; padding: 7px 16px; font-size: 13px; color: var(--text-dark); outline: none; transition: all .15s; }
.topbar-search:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.topbar-actions { display: flex; gap: 8px; }
.page-content { flex: 1; padding: 20px 24px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: all .15s; white-space: nowrap; font-family: inherit; }
.btn-primary { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,.3); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(124,58,237,.4); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--primary); border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-success { background: linear-gradient(135deg, #059669, #0d9488); color: #fff; box-shadow: 0 4px 12px rgba(5,150,105,.25); }
.btn-success:hover { transform: translateY(-1px); }
.btn-danger { background: #fff; color: var(--red); border: 1.5px solid #fca5a5; }
.btn-danger:hover { background: var(--red-light); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn svg { width: 14px; height: 14px; }

/* CARDS */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 14px; font-weight: 700; color: var(--text-dark); }
.card-body { padding: 18px; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { border-radius: var(--radius); padding: 16px 18px; cursor: pointer; transition: all .2s; color: #fff; position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-card.blue { background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.stat-card.green { background: linear-gradient(135deg, #059669, #0d9488); }
.stat-card.amber { background: linear-gradient(135deg, #d97706, #ea580c); }
.stat-card.red { background: linear-gradient(135deg, #dc2626, #db2777); }
.stat-card.purple { background: linear-gradient(135deg, #7c3aed, #db2777); }
.stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .75; margin-bottom: 4px; }
.stat-value { font-size: 32px; font-weight: 700; color: #fff; line-height: 1; }
.stat-sub { font-size: 11px; opacity: .7; margin-top: 6px; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { background: var(--gray-50); color: var(--text-mid); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
tbody tr { border-bottom: 1px solid #faf5ff; transition: background .1s; }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 11px 14px; font-size: 13px; color: #334155; }
tbody tr:last-child { border-bottom: none; }

/* BADGES */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-available { background: var(--green-light); color: #065f46; }
.badge-assigned { background: var(--blue-light); color: #1d4ed8; }
.badge-in_repair { background: var(--amber-light); color: #92400e; }
.badge-retired { background: #f1f5f9; color: #64748b; }
.badge-open { background: var(--red-light); color: #991b1b; }
.badge-in_progress { background: var(--amber-light); color: #92400e; }
.badge-resolved { background: var(--green-light); color: #065f46; }
.badge-closed { background: #f1f5f9; color: #64748b; }
.badge-critical { background: var(--red-light); color: #991b1b; }
.badge-high { background: #fff7ed; color: #9a3412; }
.badge-medium { background: var(--amber-light); color: #92400e; }
.badge-low { background: var(--green-light); color: #065f46; }
.badge-warranty { background: var(--blue-light); color: #1d4ed8; }
.badge-amc { background: var(--primary-light); color: #6d28d9; }
.badge-admin { background: var(--primary-light); color: #6d28d9; }
.badge-manager { background: var(--blue-light); color: #1d4ed8; }
.badge-user { background: #f1f5f9; color: #64748b; }
.badge-active { background: var(--green-light); color: #065f46; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-expiring { background: var(--amber-light); color: #92400e; }
.badge-expired { background: var(--red-light); color: #991b1b; }

/* FORMS */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: 12.5px; font-weight: 700; color: var(--text-dark); }
input, select, textarea { border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; color: var(--text-dark); width: 100%; outline: none; transition: all .15s; font-family: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--text-muted); }

/* ALERTS */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; display: flex; align-items: center; gap: 10px; border-left: 4px solid; }
.alert-success { background: var(--green-light); border-color: var(--green); color: #065f46; }
.alert-error { background: var(--red-light); border-color: var(--red); color: #991b1b; }
.alert-warning { background: var(--amber-light); border-color: var(--amber); color: #92400e; }

/* FILTER */
.filter-bar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.filter-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-form input, .filter-form select { max-width: 200px; width: auto; }

/* MISC */
.asset-code { font-family: monospace; font-size: 11.5px; background: var(--primary-light); padding: 2px 7px; border-radius: 4px; color: var(--primary); font-weight: 600; }
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.text-muted { color: var(--text-muted); }
.font-semibold { font-weight: 600; }
.person-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,#a78bfa,#60a5fa); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.ms-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.ms-tab { padding: 9px 18px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; transition: all .15s; font-weight: 500; }
.ms-tab:hover { color: var(--text-dark); }
.ms-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(30,27,75,.4); z-index: 200; display: none; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px; box-shadow: 0 20px 60px rgba(124,58,237,.2); }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text-dark); }
.qr-container { text-align: center; padding: 16px; }
.qr-container img { max-width: 180px; border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 8px; }
@media (max-width: 768px) { .sidebar { display: none; } .main-wrap { margin-left: 0; } .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr; } .stats-grid { grid-template-columns: 1fr 1fr; } }
