/* Maxtronics IT Asset Desk — styles taken from the approved design (Inter, navy sidebar, teal accent). */
:root {
  --ink: #14202B;
  --ink-2: #33424F;
  --muted: #5B6B7A;
  --line: #DCE3E9;
  --line-soft: #EEF1F4;
  --field: #CBD5DD;
  --page: #EEF1F4;
  --card: #FFFFFF;
  --navy: #0F1F2E;
  --navy-text: #E7EEF4;
  --navy-muted: #9FB2C3;
  --mint: #2DD4BF;
  --teal: #0A7A6E;
  --teal-dark: #07574E;
  --teal-soft: #E3F4F1;
  --danger: #7A1F1F;
  --danger-soft: #FBDADA;
  --warn: #6B4200;
  --warn-soft: #FDEBC8;
  --blue: #1B3F7A;
  --blue-soft: #E1ECFB;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  flex: 0 0 232px; background: var(--navy); color: var(--navy-text);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 28px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: inherit; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--mint); color: var(--navy);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--navy-muted); }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .nav span {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-decoration: none; color: #C5D3DF;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.is-active { background: var(--mint); color: var(--navy); font-weight: 600; }
.nav span.is-soon { color: #6F8396; cursor: default; }
.nav .soon { margin-left: auto; font-size: 10px; letter-spacing: .5px; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: rgba(255,255,255,.07); }
.nav svg { flex: none; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-foot button {
  width: 100%; height: 36px; border-radius: 9px; border: 1px solid rgba(255,255,255,.16);
  background: transparent; color: #C5D3DF; font-size: 13px; font-weight: 600;
}
.sidebar-foot button:hover { background: rgba(255,255,255,.08); color: #fff; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 32px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.search { flex: 1 1 280px; max-width: 480px; position: relative; }
.search svg { position: absolute; left: 14px; top: 12px; }
.search input {
  width: 100%; height: 42px; border-radius: 10px; border: 1px solid var(--field); background: #F6F9FB;
  padding: 0 14px 0 42px; font-size: 14px;
}
.spacer { flex: 1 1 auto; }
.me { display: flex; align-items: center; gap: 12px; }
.me-text { text-align: right; line-height: 1.3; }
.me-name { font-size: 14px; font-weight: 600; }
.me-mail { font-size: 12px; color: var(--muted); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--navy-text);
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.content { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 18px; }

/* Page headings and toolbars */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.page-head h1 { margin: 0 8px 0 0; font-size: 28px; font-weight: 700; letter-spacing: -.3px; }
.page-head .sub { flex-basis: 100%; margin: -6px 0 0; color: var(--muted); }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb a { text-decoration: none; }

.select-pill {
  display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; background: var(--card);
  border: 1px solid var(--field); border-radius: 10px; font-size: 13px; color: var(--muted);
}
.select-pill select { border: 0; background: transparent; font-weight: 600; color: var(--ink); max-width: 160px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--field); background: var(--card); color: var(--ink);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #E6ECF1; color: var(--ink); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { height: 34px; padding: 0 14px; border-radius: 9px; }
.btn-xs { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12px; }
.btn-caps { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; display: inline-flex;
  align-items: center; gap: 8px; border: 1px solid var(--field); background: var(--card); color: var(--ink); text-decoration: none;
}
.tab:hover { color: var(--ink); background: #F6F9FB; }
.tab .count { font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--line-soft); color: var(--ink-2); }
.tab.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.tab.is-active .count { background: rgba(255,255,255,.18); color: #fff; }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: 10px; font-size: 14px; border: 1px solid; }
.flash-ok { background: #DDF3EF; border-color: #A9DDD3; color: var(--teal-dark); }
.flash-error { background: #FFF4F4; border-color: #F0C4C4; color: var(--danger); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 18px; }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }

/* Inventory layout */
.inv { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.inv-table { flex: 999 1 620px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.inv-side { flex: 1 1 280px; max-width: 360px; min-width: 260px; display: flex; flex-direction: column; gap: 16px; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--teal); }

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.grid-table { min-width: 860px; }
.grid-row {
  display: grid; grid-template-columns: 44px 124px minmax(0, 1fr) 108px 112px 150px 52px;
  align-items: center; padding: 10px 8px; font-size: 14px;
}
.grid-head { padding: 12px 8px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.asset { border-bottom: 1px solid var(--line-soft); }
.asset:last-child { border-bottom: 0; }
.asset .grid-row:hover { background: #F6F9FB; }
.asset.is-open { background: #FBFDFE; box-shadow: inset 3px 0 0 var(--teal); border-bottom-color: var(--line); }
.cell-check { display: flex; justify-content: center; }
.cell-check input, .check { width: 18px; height: 18px; accent-color: var(--teal); }
.cell-tag { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell-name {
  text-align: left; background: transparent; border: 0; padding: 6px 8px 6px 0; font-size: 14px; font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cell-small { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }
.chev {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--field); background: var(--card);
  display: flex; align-items: center; justify-content: center; color: var(--ink-2);
}
.chev:hover { background: #E6ECF1; }
.chev svg { transition: transform .15s; }
.asset.is-open .chev svg { transform: rotate(180deg); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

.detail { padding: 8px 28px 22px 52px; display: flex; flex-wrap: wrap; gap: 28px; border-top: 1px dashed var(--line); }
.detail[hidden] { display: none; }
.detail-icon {
  width: 132px; height: 132px; border-radius: 14px; background: var(--teal-soft); color: var(--teal);
  display: flex; align-items: center; justify-content: center; flex: none; margin-top: 16px;
}
.fields { flex: 1 1 480px; min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin-top: 16px; }
.field-wide { grid-column: span 2; }
.field-label { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.field-value { font-size: 14px; font-weight: 500; margin-top: 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-foot {
  flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  border-top: 1px solid var(--line-soft); padding-top: 12px; font-size: 12px; color: var(--muted);
}
.detail-foot .note { font-weight: 600; letter-spacing: .4px; text-transform: uppercase; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip-in-stock { background: #DDF3EF; color: var(--teal-dark); }
.chip-assigned { background: var(--blue-soft); color: var(--blue); }
.chip-in-repair { background: var(--warn-soft); color: var(--warn); }
.chip-expiring, .chip-overdue { background: var(--danger-soft); color: var(--danger); }
.chip-retired, .chip-returned { background: var(--line-soft); color: var(--ink-2); }
.chip-role-admin { background: var(--navy); color: #fff; }
.chip-role-editor { background: var(--teal-soft); color: var(--teal-dark); }
.chip-role-viewer { background: var(--line-soft); color: var(--ink-2); }
.role-picker { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.role-picker[disabled] { opacity: .6; }
.role-option { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--field); border-radius: 12px; cursor: pointer; background: #fff; }
.role-option:has(input:checked) { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: #FBFDFE; }
.role-option input { margin-top: 3px; accent-color: var(--teal); }
.role-option strong { display: block; font-size: 14px; }
.role-option .muted { display: block; font-size: 12px; margin-top: 2px; line-height: 1.4; }
code { font: 12px ui-monospace, Consolas, monospace; background: var(--line-soft); padding: 1px 5px; border-radius: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag-pill { padding: 3px 10px; border-radius: 999px; background: var(--line-soft); font-size: 12px; color: var(--ink-2); }

.bulk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pager { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pager .links { display: flex; gap: 8px; }

/* Overview panel */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: block; }
.stat:hover { color: inherit; border-color: var(--field); }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-alert { background: #FFF4F4; border-color: #F0C4C4; }
.stat-alert .stat-label, .stat-alert .stat-value { color: var(--danger); }
.alert-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.badge-action { padding: 3px 9px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 700; letter-spacing: .6px; }
.alert-list { display: flex; flex-direction: column; gap: 12px; font-size: 13px; margin-bottom: 14px; }
.alert-item { display: flex; justify-content: space-between; gap: 10px; }
.alert-item a { font-weight: 600; color: var(--ink); text-decoration: none; }
.alert-item a:hover { color: var(--teal); }
.due-red { color: var(--danger); font-weight: 600; white-space: nowrap; }
.due-amber { color: var(--warn); font-weight: 600; white-space: nowrap; }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-top { display: flex; justify-content: space-between; font-size: 13px; }
.bar-track { height: 8px; border-radius: 99px; background: #E6ECF1; margin-top: 4px; }
.bar-fill { height: 8px; border-radius: 99px; background: var(--teal); }
.bar-fill.is-full { background: var(--danger); }

/* Plain tables (assignments, licenses, history) */
.list { width: 100%; border-collapse: collapse; min-width: 760px; }
.list th {
  text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase; color: var(--muted); white-space: nowrap;
}
.list td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; font-size: 14px; }
.list tr:last-child td { border-bottom: 0; }
.list .strong { font-weight: 600; color: var(--ink); text-decoration: none; }
.list .strong:hover { color: var(--teal); }
.list .sub { font-size: 12px; color: var(--muted); }
.seat-meter { min-width: 140px; }

/* Forms */
.form-card { max-width: 980px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-4 { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--teal); margin-top: 6px; }
.ctrl { display: flex; flex-direction: column; gap: 6px; }
.ctrl label { font-size: 13px; font-weight: 600; }
.ctrl .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, .ctrl input:not([type=checkbox]), .ctrl select, .ctrl textarea {
  height: 42px; border-radius: 10px; border: 1px solid var(--field); background: #fff; padding: 0 12px; font-size: 14px; width: 100%;
}
.ctrl textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.ctrl .is-invalid { border-color: #D97777; background: #FFFBFB; }
.error { font-size: 12px; color: var(--danger); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
[data-when-license][hidden], [data-when-equipment][hidden] { display: none; }

/* Asset page */
.asset-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.asset-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.asset-side { flex: 1 1 300px; max-width: 380px; min-width: 280px; display: flex; flex-direction: column; gap: 16px; }
.asset-hero { display: flex; flex-wrap: wrap; gap: 24px; }
.asset-hero .detail-icon { margin-top: 0; width: 112px; height: 112px; }
.holders { display: flex; flex-direction: column; gap: 10px; }
.holder { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; }
.holder details.return-box[open] { grid-column: 1 / -1; }
.holders-scroll { max-height: 420px; overflow-y: auto; }
.holder-name { font-weight: 600; }
details.return-box > summary { list-style: none; }
details.return-box > summary::-webkit-details-marker { display: none; }
.return-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; width: 100%; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.or { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.log time { display: block; font-size: 12px; color: var(--muted); }

/* Sign-in */
.auth { min-height: 100vh; display: flex; background: var(--page); }
.auth-aside {
  flex: 0 0 400px; background: var(--navy); color: var(--navy-text); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; }
.auth-aside p { margin: 0; font-size: 15px; line-height: 1.6; color: #C5D3DF; }
.auth-aside .foot { font-size: 12px; color: var(--navy-muted); }
.auth-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 18px; }
.auth-form h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.auth-form .lead { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.auth-form .input { height: 44px; padding: 0 14px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.auth-submit { height: 46px; border-radius: 10px; border: 0; background: var(--teal); color: #fff; font-size: 15px; font-weight: 600; }
.auth-submit:hover { background: var(--teal-dark); }
.auth-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { position: static; height: auto; flex-basis: auto; padding: 16px; gap: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav span.is-soon { display: none; }
  .sidebar-foot { margin-top: 0; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .inv-side, .asset-side { max-width: none; }
  .fields, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .role-picker { grid-template-columns: minmax(0, 1fr); }
  .detail { padding-left: 16px; padding-right: 16px; }
  .auth { flex-direction: column; }
  .auth-aside { flex-basis: auto; padding: 28px; gap: 24px; }
  .auth-main { padding: 28px 16px; }
}
@media (max-width: 520px) {
  .fields, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .field-wide, .form-grid .span-2 { grid-column: auto; }
  .me-text { display: none; }
}
