:root {
  --bg:        #F5F4F0;
  --surface:   #FFFFFF;
  --surface2:  #FAFAF8;
  --border:    #E2E0DA;
  --border2:   #D0CEC6;
  --text:      #1A1916;
  --text2:     #4A4844;
  --text3:     #8A8880;
  --gold:      #B8860B;
  --gold-l:    #D4A017;
  --gold-pale: #FDF6E3;
  --accent:    #1A1916;
  --danger:    #C0392B;
  --danger-l:  #FDEDEC;
  --warn:      #E67E22;
  --warn-l:    #FEF5EC;
  --ok:        #27AE60;
  --ok-l:      #EAFAF1;
  --info:      #2980B9;
  --info-l:    #EBF5FB;
  --maint:     #8E44AD;
  --maint-l:   #F5EEF8;
  --radius:    4px;
  --radius-lg: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.10), 0 2px 4px rgba(0,0,0,.06);
  --font-head: 'Roboto', sans-serif;
  --font-body: 'Roboto', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
img { max-width: 100%; display: block; }

/* ═══════════════ LOGIN ═══════════════ */
.login-page { min-height: 100vh; display: flex; }
.login-split { display: flex; width: 100%; min-height: 100vh; }
.login-brand {
  width: 45%; background: var(--accent); color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 56px; position: relative; overflow: hidden;
}
.login-brand::before {
  content: ''; position: absolute; top: -80px; right: -80px;
  width: 320px; height: 320px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 50%;
}
.login-brand::after {
  content: ''; position: absolute; bottom: -120px; left: -60px;
  width: 400px; height: 400px;
  border: 1px solid rgba(255,255,255,.05); border-radius: 50%;
}
.brand-mark { width: 64px; height: 64px; color: var(--gold-l); margin-bottom: 32px; }
.login-brand h1 { font-family: var(--font-head); font-size: 42px; font-weight: 800; letter-spacing: -1px; margin-bottom: 12px; }
.login-brand p { font-size: 15px; color: rgba(255,255,255,.6); line-height: 1.6; margin-bottom: 48px; }
.brand-features { display: flex; flex-direction: column; gap: 14px; }
.feat { display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,.7); }
.feat i { width: 18px; color: var(--gold-l); }
.login-form-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 48px; background: var(--bg); }
.login-card { width: 100%; max-width: 380px; }
.login-header { margin-bottom: 32px; }
.login-header h2 { font-family: var(--font-head); font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.login-header p { color: var(--text3); font-size: 13px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text2); margin-bottom: 7px; }
.field-icon { position: relative; }
.field-icon > i:first-child { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 13px; pointer-events: none; }
.field-icon input { width: 100%; padding: 11px 40px 11px 36px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--surface); font-size: 14px; transition: border-color .2s, box-shadow .2s; }
.field-icon input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,25,22,.08); }
.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); padding: 4px; font-size: 13px; }
.login-error { background: var(--danger-l); color: var(--danger); padding: 10px 12px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; border-left: 3px solid var(--danger); }
.btn-login { width: 100%; padding: 13px; background: var(--accent); color: #fff; border-radius: var(--radius); font-family: var(--font-head); font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .2s, transform .1s; margin-bottom: 20px; }
.btn-login:hover { background: #333; }
.btn-login:active { transform: scale(.99); }
.login-hint { text-align: center; font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
@media (max-width: 768px) {
  .login-brand { display: none; }
  .login-form-wrap { padding: 32px 24px; }
}

/* ═══════════════ APP SHELL ═══════════════ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  width: 228px; background: var(--accent); color: #fff; flex-shrink: 0;
  display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  transition: width .25s; z-index: 200;
}
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sb-logo span,
.sidebar.collapsed .sb-section-label,
.sidebar.collapsed .sb-item span,
.sidebar.collapsed .sb-badge,
.sidebar.collapsed .sb-user-info,
.sidebar.collapsed .sb-logout { display: none; }
.sidebar.collapsed .sb-item { justify-content: center; padding: 11px; }
.sidebar-head { padding: 0; }
.sb-logo { display: flex; align-items: center; gap: 10px; padding: 20px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sb-logo svg { width: 24px; height: 24px; color: var(--gold-l); flex-shrink: 0; }
.sb-logo span { font-family: var(--font-head); font-size: 18px; font-weight: 800; letter-spacing: -.5px; white-space: nowrap; }
.sb-collapse { position: absolute; right: 12px; top: 18px; color: rgba(255,255,255,.4); padding: 4px 6px; font-size: 13px; }
.sb-collapse:hover { color: #fff; }
.sidebar-head { position: relative; }
.sb-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.sb-section { margin-bottom: 4px; }
.sb-section-label { font-size: 10px; font-weight: 600; letter-spacing: 1px; color: rgba(255,255,255,.3); padding: 8px 16px 4px; white-space: nowrap; overflow: hidden; }
.sb-item { display: flex; align-items: center; gap: 11px; padding: 10px 16px; color: rgba(255,255,255,.6); font-size: 13px; transition: background .15s, color .15s; border-radius: 0; white-space: nowrap; position: relative; }
.sb-item i { width: 16px; text-align: center; font-size: 14px; flex-shrink: 0; }
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.active { background: rgba(255,255,255,.1); color: #fff; }
.sb-item.active::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold-l); border-radius: 0 2px 2px 0; }
.sb-badge { background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; margin-left: auto; }
.sb-user { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 10px; }
.sb-avatar { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.sb-user-info { flex: 1; overflow: hidden; }
.sb-user-info > div:first-child { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-role-chip { font-size: 10px; color: var(--gold-l); font-family: var(--font-mono); }
.sb-logout { color: rgba(255,255,255,.3); padding: 4px; font-size: 13px; flex-shrink: 0; }
.sb-logout:hover { color: var(--danger); }

/* ═══════════════ TOPBAR ═══════════════ */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.topbar { height: 52px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; flex-shrink: 0; }
.topbar-l { display: flex; align-items: center; gap: 12px; }
.mobile-menu { display: none; color: var(--text2); padding: 6px; font-size: 15px; }
.breadcrumb { font-size: 13px; font-weight: 600; color: var(--text2); }
.topbar-r { display: flex; align-items: center; gap: 6px; }
.tb-btn { width: 34px; height: 34px; border-radius: var(--radius); color: var(--text2); display: flex; align-items: center; justify-content: center; font-size: 15px; position: relative; }
.tb-btn:hover { background: var(--bg); }
.notif-dot { width: 7px; height: 7px; background: var(--danger); border-radius: 50%; position: absolute; top: 5px; right: 5px; border: 1px solid var(--surface); }
.notif-wrap { position: relative; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: 1000; overflow: hidden; }
.notif-panel-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.notif-read-all { font-size: 11px; color: var(--info); font-weight: 400; }
.notif-item { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--bg); }
.notif-item.unread { background: var(--gold-pale); }
.notif-item .notif-title { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.notif-item .notif-msg { font-size: 11px; color: var(--text2); margin-bottom: 3px; }
.notif-item .notif-time { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }
.empty-sm { padding: 24px; text-align: center; font-size: 12px; color: var(--text3); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: var(--radius); cursor: pointer; position: relative; font-size: 13px; font-weight: 500; }
.user-chip:hover { background: var(--bg); }
.chip-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text2); }
.chip-caret { font-size: 10px; color: var(--text3); }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); min-width: 160px; z-index: 1000; overflow: hidden; }
.user-dropdown a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--text2); }
.user-dropdown a:hover { background: var(--bg); }
.user-dropdown a i { width: 14px; text-align: center; }

/* ═══════════════ PAGE WRAP ═══════════════ */
.page-wrap { flex: 1; overflow-y: auto; padding: 20px; }

/* ═══════════════ CARDS ═══════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden; }
.card-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--gold); }
.card-body { padding: 20px; }

/* ═══════════════ STATS GRID ═══════════════ */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-card.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.stat-card.gold { background: var(--gold); color: #fff; border-color: var(--gold); }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.stat-card:not(.accent):not(.gold) .stat-icon { background: var(--bg); color: var(--gold); }
.stat-card.accent .stat-icon, .stat-card.gold .stat-icon { background: rgba(255,255,255,.15); color: #fff; }
.stat-num { font-family: var(--font-head); font-size: 30px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 12px; opacity: .7; }

/* ═══════════════ DASHBOARD CHARTS ═══════════════ */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.chart-wrap { height: 200px; position: relative; }

/* ═══════════════ FILTER BAR ═══════════════ */
.filter-bar { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface2); }
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); font-size: 12px; }
.search-wrap input { width: 100%; padding: 8px 12px 8px 32px; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 13px; background: var(--surface); }
.search-wrap input:focus { outline: none; border-color: var(--accent); }
.filter-sel { padding: 8px 10px; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); }
.filter-sel:focus { outline: none; border-color: var(--accent); }

/* ═══════════════ TABLE ═══════════════ */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text3); border-bottom: 1px solid var(--border); background: var(--surface2); white-space: nowrap; }
tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
.asset-thumb { width: 40px; height: 40px; border-radius: var(--radius); overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-thumb i { font-size: 16px; color: var(--gold); }
.asset-code { font-family: var(--font-mono); font-size: 11px; color: var(--text3); margin-top: 2px; }

/* ═══════════════ BADGES ═══════════════ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-active   { background: var(--ok-l);    color: var(--ok);    }
.badge-lost     { background: var(--danger-l); color: var(--danger); }
.badge-maintenance { background: var(--maint-l); color: var(--maint); }
.badge-disposed { background: var(--border);   color: var(--text3); }
.badge-admin    { background: var(--accent); color: #fff; }
.badge-viewer   { background: var(--bg); color: var(--text2); border: 1px solid var(--border2); }
.badge-new      { background: var(--info-l); color: var(--info); }

/* condition stars */
.stars { display: inline-flex; gap: 2px; }
.stars i { font-size: 11px; }
.star-on  { color: var(--gold); }
.star-off { color: var(--border2); }

/* ═══════════════ PAGINATION ═══════════════ */
.pagination { display: flex; align-items: center; gap: 4px; padding: 14px 20px; border-top: 1px solid var(--border); }
.page-btn { padding: 5px 10px; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 12px; color: var(--text2); min-width: 30px; text-align: center; }
.page-btn:hover:not(:disabled) { background: var(--bg); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }
.page-info { margin-left: auto; font-size: 12px; color: var(--text3); font-family: var(--font-mono); }

/* ═══════════════ BUTTONS ═══════════════ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 600; font-family: var(--font-body); transition: all .15s; white-space: nowrap; cursor: pointer; }
.btn-primary   { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-primary:hover { background: #333; }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn-danger:hover { background: #a93226; }
.btn-warning   { background: var(--warn); color: #fff; border: 1px solid var(--warn); }
.btn-warning:hover { background: #ca6f1e; }
.btn-success   { background: var(--ok); color: #fff; border: 1px solid var(--ok); }
.btn-success:hover { background: #229954; }
.btn-gold      { background: var(--gold); color: #fff; border: 1px solid var(--gold); }
.btn-gold:hover { background: var(--gold-l); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* icon-only action buttons */
.icon-btn { width: 28px; height: 28px; border-radius: var(--radius); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; border: 1px solid var(--border2); color: var(--text2); transition: all .15s; }
.icon-btn:hover { background: var(--bg); }
.icon-btn.danger:hover { background: var(--danger-l); color: var(--danger); border-color: var(--danger); }
.icon-btn.primary:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ═══════════════ FORM ═══════════════ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--text2); }
.form-control { padding: 9px 12px; border: 1px solid var(--border2); border-radius: var(--radius); font-size: 13px; color: var(--text); background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(26,25,22,.06); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text3); }
.form-section { margin-bottom: 24px; }
.form-section-title { font-family: var(--font-head); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ═══════════════ ASSET DETAIL ═══════════════ */
.detail-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; }
.gallery-main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); margin-bottom: 10px; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.gallery-main i { font-size: 48px; color: var(--gold); opacity: .3; }
.gallery-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.gallery-thumb { width: 60px; height: 60px; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border); cursor: pointer; }
.gallery-thumb.active { border-color: var(--gold); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.info-item { background: var(--surface); padding: 12px 16px; }
.info-item label { font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--text3); display: block; margin-bottom: 4px; }
.info-item .val { font-size: 13px; color: var(--text); }
.info-item .val.mono { font-family: var(--font-mono); color: var(--gold); font-size: 15px; font-weight: 500; }
.info-item .val.big { font-size: 18px; font-weight: 700; font-family: var(--font-head); }
.info-item.span2 { grid-column: 1 / -1; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 4px; background: var(--surface2); }
.tab-btn { padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--text3); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s, border-color .15s; display: flex; align-items: center; gap: 6px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-content { display: none; padding: 20px; }
.tab-content.active { display: block; }

/* Depreciation card */
.dep-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.dep-row:last-child { border: none; }
.dep-bar { height: 6px; background: var(--border); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.dep-bar-fill { height: 100%; background: var(--gold); border-radius: 3px; transition: width 1s; }

/* History */
.history-list { display: flex; flex-direction: column; gap: 0; }
.history-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.history-item:last-child { border: none; }
.history-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex-shrink: 0; margin-top: 5px; }
.history-action { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.history-meta { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }

/* Image grid */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.img-item { position: relative; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--border); }
.img-item.primary { border-color: var(--gold); }
.img-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; cursor: pointer; }
.img-badge-primary { position: absolute; top: 5px; left: 5px; background: var(--gold); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 3px; }
.img-actions { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,.6); display: flex; gap: 4px; padding: 6px; justify-content: center; opacity: 0; transition: opacity .15s; }
.img-item:hover .img-actions { opacity: 1; }
.img-action-btn { padding: 3px 7px; border-radius: 3px; font-size: 11px; font-weight: 600; color: #fff; cursor: pointer; border: none; }
.img-action-btn.star { background: var(--gold); }
.img-action-btn.del { background: var(--danger); }

/* Upload zone */
.upload-zone { border: 2px dashed var(--border2); border-radius: var(--radius-lg); padding: 28px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; color: var(--text3); }
.upload-zone:hover { border-color: var(--gold); background: var(--gold-pale); }
.upload-zone i { font-size: 28px; margin-bottom: 8px; color: var(--gold); display: block; }
.upload-zone p { font-size: 13px; }
.upload-zone small { font-size: 11px; }

/* Lost alert */
.lost-banner { background: var(--danger-l); border: 1px solid var(--danger); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.lost-banner i { color: var(--danger); font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.lost-banner strong { font-size: 14px; font-weight: 700; color: var(--danger); display: block; margin-bottom: 3px; }
.lost-banner small { font-size: 12px; color: var(--text2); }

/* Maintenance banner */
.maint-banner { background: var(--warn-l); border: 1px solid var(--warn); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.maint-banner i { color: var(--warn); font-size: 18px; flex-shrink: 0; margin-top: 2px; }

/* QR modal */
.qr-wrap { text-align: center; padding: 24px; }
.qr-wrap img { max-width: 220px; margin: 0 auto 14px; border: 8px solid white; box-shadow: var(--shadow-md); }
.qr-code-text { font-family: var(--font-mono); font-size: 18px; font-weight: 500; color: var(--text); }

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 20px 60px rgba(0,0,0,.25); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-close { color: var(--text3); font-size: 16px; padding: 4px; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* ═══════════════ TOAST ═══════════════ */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); font-size: 13px; font-weight: 500; pointer-events: all; animation: slideUp .25s; max-width: 320px; }
.toast.success { background: var(--ok);    color: #fff; }
.toast.error   { background: var(--danger); color: #fff; }
.toast.warning { background: var(--warn);  color: #fff; }
.toast.info    { background: var(--info);  color: #fff; }
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ═══════════════ SPINNER ═══════════════ */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .6s linear infinite; }
.spinner-lg { width: 36px; height: 36px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════ EMPTY STATE ═══════════════ */
.empty-state { text-align: center; padding: 56px 24px; color: var(--text3); }
.empty-state i { font-size: 40px; margin-bottom: 16px; display: block; opacity: .3; }
.empty-state h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .detail-layout { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-full { grid-column: 1; }
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; left: -228px; height: 100vh; top: 0; }
  .sidebar.open { left: 0; box-shadow: var(--shadow-md); }
  .sidebar.collapsed { width: 228px; left: -228px; }
  .mobile-menu { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3 { grid-template-columns: 1fr; }
  .page-wrap { padding: 14px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ═══════════════ MISC ═══════════════ */
.value-chip { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--gold); }
.text-danger { color: var(--danger); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-muted { color: var(--text3); }
.mono { font-family: var(--font-mono); }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ═══════════ DASHBOARD ════════════ */
.dash-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .dash-2col { grid-template-columns: 1fr; } }


/* ═══════════ EXPAND ROW ════════════ */
.expand-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 10px;
  transition: all .2s;
}
.expand-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.expand-btn.open  { background: var(--accent); color: #fff; border-color: var(--accent); }
.expand-btn.open i { transform: rotate(90deg); }
.expand-btn i { transition: transform .2s; }

.expand-row td { padding: 0 !important; }
.expand-panel { overflow: hidden; animation: expandIn .2s ease; }
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.asset-row:hover td { background: var(--bg) !important; }
.asset-row td { transition: background .1s; }

.sb-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.8px; color:var(--text3); padding:10px 18px 4px; }
