:root {
  --bg: #f4f6fa; --card: #fff; --text: #1d2433; --muted: #6b7489; --line: #e3e7ef;
  --primary: #2f5bea; --primary-soft: #e8eeff; --green: #1f9d55; --green-soft: #e3f6ea;
  --amber: #b7791f; --amber-soft: #fdf3dc; --red: #d64545; --red-soft: #fde8e8; --gray-soft: #eef0f4;
  --side: #151b2c;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; cursor: pointer; }
.side { width: 220px; background: var(--side); color: #cfd5e4; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.brand { font-weight: 700; font-size: 16px; color: #fff; padding: 20px 18px; border-bottom: 1px solid #262e45; }
.side nav a { display: block; padding: 11px 18px; color: #cfd5e4; border-left: 3px solid transparent; }
.side nav a:hover { background: #1d2540; }
.side nav a.active { background: #1d2540; color: #fff; border-left-color: var(--primary); }
main { flex: 1; padding: 24px 28px; min-width: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; cursor: pointer; }
.stat .n { font-size: 28px; font-weight: 700; }
.stat .l { color: var(--muted); }
.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #f8f9fc; }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-in_stock, .b-active, .b-completed { background: var(--green-soft); color: var(--green); }
.b-assigned { background: var(--primary-soft); color: var(--primary); }
.b-in_repair, .b-open { background: var(--amber-soft); color: var(--amber); }
.b-retired, .b-left { background: var(--gray-soft); color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 7px 14px; border-radius: 7px; cursor: pointer; font: inherit; }
.btn:hover { border-color: #c5ccdb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
input, select, textarea { font: inherit; padding: 7px 10px; border: 1px solid #cfd5e1; border-radius: 7px; background: #fff; width: 100%; color: var(--text); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input { max-width: 320px; }
.filters select { width: auto; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.form .check { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--text); font-weight: 400; }
.form .check input { width: auto; }
.section-title { grid-column: 1 / -1; font-weight: 700; margin-top: 6px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.modal { position: fixed; inset: 0; background: rgba(15, 20, 35, .45); display: flex; align-items: flex-start; justify-content: center; padding: 50px 16px; overflow-y: auto; z-index: 10; }
.modal-box { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-box h2 { font-size: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 22px; right: 22px; background: #1d2433; color: #fff; padding: 11px 18px; border-radius: 8px; z-index: 20; max-width: 420px; }
.toast.err { background: var(--red); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 18px; }
.kv div span { display: block; font-size: 12px; color: var(--muted); }
.kv div b { font-weight: 600; }
.holder { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 10px; background: var(--primary-soft); margin-bottom: 16px; }
.holder.none { background: var(--gray-soft); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 16px 26px; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline li:last-child { border-left-color: transparent; }
.timeline li::before { content: ''; position: absolute; left: -7px; top: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--dot, #aab2c5); border: 2px solid #fff; }
.timeline .d { font-size: 12px; color: var(--muted); }
.t-purchase { --dot: var(--green); } .t-assign { --dot: var(--primary); } .t-return { --dot: #7a5af8; }
.t-repair { --dot: var(--amber); } .t-repair_done { --dot: var(--green); } .t-retire { --dot: var(--red); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.warn { background: var(--amber-soft); color: #7a5213; padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; }
.err-list { max-height: 220px; overflow: auto; font-size: 13px; background: var(--red-soft); padding: 10px; border-radius: 8px; margin-top: 10px; }
.who { position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 18px; border-top: 1px solid #262e45; font-size: 13px; }
.who a { color: #9fb3ff; }
.login { position: fixed; inset: 0; background: var(--bg); display: grid; place-items: center; z-index: 30; padding: 16px; }
.login .card { width: 100%; max-width: 380px; }
.login .form { grid-template-columns: 1fr; }
.secret { font-family: Consolas, monospace; }
.secret button { margin-left: 6px; }
@media (max-width: 760px) {
  .who { position: static; }
  body { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; }
  .side nav { display: flex; overflow-x: auto; }
  .side nav a { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  main { padding: 16px; }
  .form { grid-template-columns: 1fr; }
}

/* ---------- dashboard ---------- */
:root { --s-assigned: #2a78d6; --s-stock: #1baf7a; --s-repair: #eda100; --s-retired: #b7bcc8; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.kpi:hover { box-shadow: 0 6px 20px rgba(20, 30, 60, .08); transform: translateY(-1px); }
.kpi-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--gray-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.kpi-n { font-size: 30px; font-weight: 700; line-height: 1.1; }
.kpi-l { font-weight: 600; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; flex: 1; }
h3.sub { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 6px; }
.dash { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.dash-col { display: grid; gap: 18px; min-width: 0; }
.dash .card { margin-bottom: 0; }
@media (max-width: 1100px) { .dash { grid-template-columns: 1fr; } }
.fleet-bar { display: flex; gap: 2px; height: 18px; border-radius: 4px; overflow: hidden; background: var(--card); }
.fleet-bar span { min-width: 4px; cursor: pointer; }
.fleet-bar span:hover { filter: brightness(1.08); }
.fleet-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; }
.fleet-legend a { color: var(--text); display: inline-flex; align-items: center; gap: 7px; }
.fleet-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
table.compact td { padding: 7px 6px; }
.alist, .feed { list-style: none; margin: 0; padding: 0; }
.alist li, .feed li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.alist li:last-child, .feed li:last-child { border-bottom: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.dot.bad { background: var(--red); } .dot.warn { background: var(--amber); } .dot.info { background: var(--primary); }
.feed-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--gray-soft); display: grid; place-items: center; flex-shrink: 0; font-size: 14px; }
.ybars { display: flex; gap: 14px; align-items: flex-end; height: 190px; padding-top: 6px; }
.ybar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.ybar-val { font-size: 12px; font-weight: 600; margin-bottom: 4px; white-space: nowrap; }
.ybar-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.ybar-fill { width: 100%; background: var(--s-assigned); border-radius: 4px 4px 0 0; }
.ybar:hover .ybar-fill { background: #256abf; }
.ybar-lbl { font-size: 12px; font-weight: 600; margin-top: 6px; text-align: center; }
.ybar-lbl span { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.meters { display: grid; gap: 12px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.meter-track { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.meter-track div { height: 100%; border-radius: 4px; }
@media (max-width: 760px) { .dash { grid-template-columns: 1fr; } }
.status-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.status-tabs .count { background: var(--gray-soft); color: var(--muted); border-radius: 10px; padding: 0 8px; font-size: 12px; font-weight: 600; }
.status-tabs a.active .count { background: var(--primary-soft); color: var(--primary); }

/* employee left without returning the laptop */
.holder.left { background: var(--red-soft); }
.holder.left .avatar { background: var(--red); }
.left-warn { margin-top: 6px; color: #9b2c2c; font-size: 13px; }
.b-lost { background: var(--red-soft); color: var(--red); }
.t-pending { --dot: var(--red); }

/* laptop issue: in stock but broken */
:root { --s-issue: #e34948; }
.b-issue { background: var(--red-soft); color: var(--red); }
.issue-note { color: var(--red); margin-top: 2px; }
.t-issue { --dot: var(--red); } .t-issue_fixed { --dot: var(--green); }

/* prev / next on the laptop page */
.pager { display: flex; align-items: center; gap: 10px; }
.btn.disabled { opacity: .4; pointer-events: none; }
