/* iTrusTech Asset Management System — black & gold enterprise theme */
:root {
  --gold: #D4AF37;
  --gold-bright: #E8C766;
  --gold-dim: #8a7226;
  --bg: #0B0B0B;
  --panel: #141414;
  --panel2: #1A1A1A;
  --panel3: #202020;
  --border: #2A2A2A;
  --border-soft: #232323;
  --text: #ECECEC;
  --text-dim: #A8A8A8;
  --text-faint: #6E6E6E;
  --green: #4CAF6D;
  --red: #E5555A;
  --blue: #4C8DFF;
  --orange: #E5A93F;
  --radius: 10px;
  --sidebar-w: 240px;
  --font-display: 'Cinzel', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: .02em; margin: 0 0 4px; color: #fff; }
.mono { font-family: var(--font-mono); }
::selection { background: var(--gold); color: #000; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ───────── layout shell ───────── */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: #0D0D0D; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 40;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; border-bottom: 1px solid var(--border-soft); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(145deg, var(--gold-bright), var(--gold-dim));
  display: flex; align-items: center; justify-content: center; color: #0B0B0B; flex: none;
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-text .t1 { font-family: var(--font-display); font-size: 16px; color: #fff; line-height: 1.1; }
.brand-text .t2 { font-size: 9.5px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }

.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin-bottom: 4px; }
.nav-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--text-dim);
  font-size: 13.5px; font-weight: 500; margin-bottom: 1px; position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--panel2); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, rgba(212,175,55,.16), rgba(212,175,55,.03)); color: var(--gold-bright); }
.nav-item.active svg { opacity: 1; }
.nav-item.active::before { content: ''; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 3px; background: var(--gold); border-radius: 2px; }
.nav-item .badge { margin-left: auto; background: var(--panel3); color: var(--text-dim); font-size: 10.5px; padding: 1px 7px; border-radius: 20px; }

.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--border-soft); font-size: 11px; color: var(--text-faint); display: flex; justify-content: space-between; }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; flex: none; display: flex; align-items: center; gap: 14px; padding: 0 24px;
  border-bottom: 1px solid var(--border); background: rgba(11,11,11,.85); backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 30;
}
.topbar .spacer { flex: 1; }
.menu-btn { display: none; background: none; border: none; color: var(--text); cursor: pointer; padding: 6px; }
.tenant-pill {
  display: flex; align-items: center; gap: 8px; background: var(--panel2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 12.5px; color: var(--text-dim);
}
.tenant-pill strong { color: var(--gold-bright); font-weight: 600; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px solid var(--border); color: var(--text-dim); position: relative; cursor: pointer;
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--gold-dim); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .dot { position: absolute; top: -3px; right: -3px; background: var(--red); color: #fff; font-size: 9.5px;
  min-width: 15px; height: 15px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 20px; background: var(--panel2); border: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(145deg, var(--gold), var(--gold-dim)); color: #0B0B0B; font-weight: 700; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.user-chip .name { font-size: 12.5px; font-weight: 600; line-height: 1.1; }
.user-chip .role { font-size: 10.5px; color: var(--text-faint); }
.topbar .clock { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }

.content { padding: 24px 28px 48px; max-width: 1600px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--text-dim); font-size: 13px; margin: 0; }
.page-head .actions { display: flex; gap: 10px; }

.impersonate-bar, .maintenance-bar {
  background: linear-gradient(90deg, #3a2a05, #241a02); border-bottom: 1px solid var(--gold-dim); color: var(--gold-bright);
  font-size: 12.5px; padding: 8px 20px; display: flex; align-items: center; gap: 12px; justify-content: center;
}
.maintenance-bar { background: linear-gradient(90deg, #3a0505, #240202); border-color: #7a2323; color: #f0a0a0; }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel2); color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--gold-dim); color: var(--gold-bright); }
.btn-gold { background: linear-gradient(145deg, var(--gold-bright), var(--gold)); color: #0B0B0B; border: none; }
.btn-gold:hover { filter: brightness(1.08); color: #0B0B0B; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: #fff; background: rgba(229,85,90,.12); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ───────── cards / kpis ───────── */
.grid { display: grid; gap: 16px; }
.grid-6 { grid-template-columns: repeat(6, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1300px) { .grid-6 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-6, .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-head h3 { font-size: 13.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); font-family: var(--font-body); font-weight: 700; }
.card-head .link { font-size: 12px; color: var(--gold); }

.kpi { padding: 16px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.kpi-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--panel3); display: flex; align-items: center; justify-content: center; color: var(--gold); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-label { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.kpi-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: #fff; }
.kpi-delta { font-size: 11.5px; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; }
.kpi-delta.up { color: var(--green); } .kpi-delta.down { color: var(--red); } .kpi-delta.flat { color: var(--text-faint); }

/* ───────── tables ───────── */
.table-wrap { overflow-x: auto; }
table.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid-table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; white-space: nowrap;
}
table.grid-table th a { color: inherit; }
table.grid-table td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.grid-table tbody tr:hover { background: var(--panel2); }
table.grid-table td.num, table.grid-table th.num { text-align: right; font-family: var(--font-mono); }
.table-link { color: var(--gold-bright); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.empty-state svg { width: 40px; height: 40px; margin-bottom: 12px; opacity: .4; }

/* ───────── badges ───────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: rgba(76,175,109,.14); color: var(--green); }
.badge-red { background: rgba(229,85,90,.14); color: var(--red); }
.badge-gold { background: rgba(212,175,55,.14); color: var(--gold-bright); }
.badge-blue { background: rgba(76,141,255,.14); color: var(--blue); }
.badge-gray { background: rgba(255,255,255,.06); color: var(--text-dim); }
.badge-orange { background: rgba(229,169,63,.14); color: var(--orange); }

/* ───────── forms ───────── */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.field .req { color: var(--gold); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search],
input[type=tel], input[type=file], select, textarea {
  width: 100%; background: var(--panel2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  color: var(--text); font-family: var(--font-body); font-size: 13.5px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(212,175,55,.12); }
textarea { resize: vertical; min-height: 80px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23A8A8A8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; padding-top: 26px; }
.checkbox-row input { width: 17px; height: 17px; accent-color: var(--gold); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border-soft); }
.hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; min-width: 240px; flex: 1; max-width: 320px; }
.toolbar .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-faint); }
.toolbar .search input { padding-left: 34px; }
.toolbar select { width: auto; min-width: 130px; }

/* ───────── auth ───────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 0%, #1a1608 0%, #0B0B0B 60%); padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 34px 32px; }
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-brand .brand-mark { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 12px; }
.auth-brand .brand-mark svg { width: 28px; height: 28px; }
.auth-brand h1 { font-size: 19px; }
.auth-brand p { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.field-gap { margin-bottom: 16px; }

/* ───────── auth (split premium layout) ───────── */
.auth-split { min-height: 100vh; display: flex; background: #0B0B0B; }
.auth-left {
  flex: 1.15; position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 56px 60px; overflow: hidden; background: radial-gradient(circle at 18% 14%, #241d09 0%, #0B0B0B 55%), #0B0B0B;
  border-right: 1px solid var(--border-soft);
}
.auth-left::before {
  content: ''; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image:
    linear-gradient(115deg, transparent 0%, transparent 48%, rgba(212,175,55,.05) 49%, rgba(212,175,55,.05) 51%, transparent 52%, transparent 100%),
    repeating-linear-gradient(135deg, rgba(212,175,55,.035) 0 1px, transparent 1px 34px);
}
.auth-left::after {
  content: ''; position: absolute; width: 560px; height: 560px; border-radius: 50%; right: -220px; bottom: -260px;
  background: radial-gradient(circle, rgba(212,175,55,.14) 0%, transparent 70%); pointer-events: none;
}
.auth-left-top, .auth-left-bottom { position: relative; z-index: 1; }
.auth-emblem { display: flex; align-items: center; gap: 12px; margin-bottom: 64px; }
.auth-emblem .brand-mark { width: 42px; height: 42px; border-radius: 10px; }
.auth-emblem .brand-mark svg { width: 22px; height: 22px; }
.auth-emblem .t1 { font-family: var(--font-display); font-size: 16px; color: #fff; line-height: 1.1; }
.auth-emblem .t2 { font-size: 9.5px; letter-spacing: .16em; color: var(--gold); text-transform: uppercase; }
.auth-headline { font-family: var(--font-display); font-size: 34px; line-height: 1.28; color: #fff; max-width: 460px; margin-bottom: 16px; }
.auth-headline span { color: var(--gold-bright); }
.auth-sub { color: var(--text-dim); font-size: 14px; max-width: 400px; line-height: 1.6; margin-bottom: 44px; }
.auth-features { display: flex; flex-direction: column; gap: 20px; }
.auth-feature { display: flex; align-items: flex-start; gap: 14px; }
.auth-feature .fi {
  width: 36px; height: 36px; flex: none; border-radius: 9px; background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.25); display: flex; align-items: center; justify-content: center; color: var(--gold-bright);
}
.auth-feature .fi svg { width: 17px; height: 17px; }
.auth-feature .ft { font-size: 13.5px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.auth-feature .fd { font-size: 12px; color: var(--text-faint); line-height: 1.5; }
.auth-left-bottom { font-size: 11.5px; color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
.auth-left-bottom .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border); }

.auth-right { flex: 1; min-width: 380px; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-panel { width: 100%; max-width: 380px; }
.auth-panel-brand { display: none; margin-bottom: 28px; }
.auth-panel h1 { font-size: 24px; margin-bottom: 6px; }
.auth-panel .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 30px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.input-icon input { padding-left: 38px; }
.input-icon:focus-within svg { color: var(--gold); }
.auth-panel .btn-gold { padding: 12px 16px; font-size: 13.5px; margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 26px; font-size: 11.5px; color: var(--text-faint); }
.auth-foot .dot { color: var(--border); margin: 0 6px; }

@media (max-width: 900px) {
  .auth-left { display: none; }
  .auth-right { min-width: 0; }
  .auth-panel-brand { display: flex; align-items: center; gap: 10px; justify-content: center; }
  .auth-panel-brand .brand-mark { width: 40px; height: 40px; border-radius: 10px; }
  .auth-panel-brand .brand-mark svg { width: 20px; height: 20px; }
  .auth-panel-brand .t1 { font-family: var(--font-display); font-size: 16px; color: #fff; }
  .auth-panel-brand .t2 { font-size: 9px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
  .auth-panel { text-align: center; }
  .auth-panel form { text-align: left; }
}

/* ───────── misc ───────── */
.flash-stack { position: fixed; top: 74px; right: 22px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
.flash { padding: 12px 16px; border-radius: 9px; font-size: 13px; border: 1px solid; background: var(--panel); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.flash-success { border-color: rgba(76,175,109,.4); color: var(--green); }
.flash-error { border-color: rgba(229,85,90,.4); color: var(--red); }
.flash-info { border-color: rgba(76,141,255,.4); color: var(--blue); }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-dim { color: var(--text-dim); } .text-faint { color: var(--text-faint); } .text-gold { color: var(--gold-bright); }
.text-green { color: var(--green); } .text-red { color: var(--red); }
.progress { height: 6px; background: var(--panel3); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.progress.danger > div { background: var(--red); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--gold-bright); border-color: var(--gold); }
.pill-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-tabs a { padding: 6px 13px; border-radius: 20px; font-size: 12px; font-weight: 600; background: var(--panel2); border: 1px solid var(--border); color: var(--text-dim); }
.pill-tabs a.active { background: rgba(212,175,55,.14); border-color: var(--gold-dim); color: var(--gold-bright); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 460px; width: 100%; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 7px; font-size: 12.5px; background: var(--panel2); border: 1px solid var(--border); color: var(--text-dim); }
.pagination .active { background: var(--gold); color: #0B0B0B; border-color: var(--gold); }
.stat-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.stat-row:last-child { border: none; }
.avatar-lg { width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(145deg, var(--gold), var(--gold-dim)); color: #0B0B0B; font-weight: 800; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }
.detail-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.detail-header .meta { font-size: 12.5px; color: var(--text-dim); }
.credential-box { background: #14130a; border: 1px solid var(--gold-dim); border-radius: 9px; padding: 14px 16px; margin-bottom: 18px; }
.credential-box .row { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 13px; padding: 4px 0; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 1px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item::before { content: ''; position: absolute; left: -22px; top: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }
.timeline-item .t { font-size: 11px; color: var(--text-faint); }
.upgrade-box { text-align: center; padding: 60px 24px; max-width: 460px; margin: 0 auto; }
.logo-lockup { display: flex; align-items: center; gap: 8px; justify-content: center; }

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-btn { display: flex; }
}
