:root {
  /* JaRco Brand Book 2026 */
  --brand: #136051;        /* Dark Green — primary, headers, strong text */
  --brand-deep: #0e4a3e;
  --forest: #51773f;       /* Forest Green */
  --leaf: #c2d4bb;         /* Light Green — panels, charts */
  --leaf-soft: #e6eee2;
  --cream: #fcf0e6;        /* page background */
  --cream-deep: #f6e6d6;
  --lime: #c0e000;         /* accent — sparingly */
  --sky: #5dc6c9;          /* accent */
  --amber: #ffbf00;        /* accent */
  --ink: #000000;
  --paper: var(--cream);
  --card: #ffffff;
  --line: #e9dccd;
  --muted: #5a5a50;
  --green: var(--brand);
  --red: #b3432b;
  --radius: 12px;
  /* legacy names kept so nothing else breaks */
  --gold: var(--brand);
  --gold-deep: var(--brand-deep);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Tahoma, Verdana, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 12px 28px;
  background: var(--brand);
  color: #fff;
  border-bottom: 4px solid var(--forest);
}
.brand { text-decoration: none; display: flex; align-items: center; gap: 12px; }
.brand-mark { font-weight: 700; letter-spacing: 0.3px; color: #fff; font-size: 18px; }
.brand-logo { height: 40px; display: block; }
.brand-logo-lg { height: 64px; }
.brand-sub { color: #fff; font-size: 14px; font-weight: 700; padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.35); line-height: 1.2; }
.topnav { display: flex; gap: 4px; flex: 1; }
.topnav a {
  color: #dfeae4;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
}
.topnav a:hover { color: #fff; background: rgba(255,255,255,0.10); }
.topnav a.active { color: #fff; background: rgba(255,255,255,0.14); font-weight: 700; box-shadow: inset 0 -3px 0 var(--lime); }
.topbar-user { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #dfeae4; }
.logout { color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,0.4); padding: 5px 12px; border-radius: 6px; }
.logout:hover { background: rgba(255,255,255,0.12); }

/* ---- layout ---- */
.page { max-width: 1080px; margin: 0 auto; padding: 28px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } .topnav { display: none; } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: var(--brand); }
.card > h2:first-child::after { content: ""; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--lime); margin-top: 8px; }

/* ---- balance card ---- */
.balance-number { font-size: 40px; font-weight: 700; color: var(--brand); }
.balance-number span { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.balance-sub { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }

.stat-list { margin: 0 0 16px; }
.stat-list div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.stat-list dt { color: var(--muted); }
.stat-list dd { margin: 0; font-weight: 600; }

/* ---- buttons ---- */
.btn {
  display: inline-block;
  border: none;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-primary:disabled { background: var(--leaf); color: #6f7f69; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn-secondary:hover { background: var(--leaf-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-approve { background: var(--forest); color: #fff; }
.btn-reject { background: var(--red); color: #fff; }

/* ---- forms ---- */
.form-card { max-width: 560px; }
.form-intro { color: var(--muted); margin-top: -6px; }
.field-row { display: flex; gap: 16px; }
.field { flex: 1; margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--brand); }
input[type=date], input[type=text], input[type=number], textarea, select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(81,119,63,0.18); }
textarea { resize: vertical; }
.input-narrow { width: 72px; }

.days-preview {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px 14px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--ink);
}
.days-preview strong { color: var(--gold-deep); }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--brand); background: var(--leaf-soft); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table td { font-size: 13px; }

.decision-form { display: flex; gap: 6px; align-items: center; }
.decision-form input[type=text] { width: 140px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending_manager { background: #fff2cc; color: #7a5a00; }
.badge-pending_hr { background: #dcf3f3; color: #1d6466; }
.badge-approved { background: var(--leaf); color: var(--brand); }
.badge-rejected { background: #fbe6e1; color: var(--red); }
.badge-open { background: #fff2cc; color: #7a5a00; }
.badge-in_progress { background: #dcf3f3; color: #1d6466; }
.badge-resolved { background: var(--leaf); color: var(--brand); }
.badge-closed { background: #eeeae4; color: var(--muted); }

.empty { color: var(--muted); font-size: 14px; }
.link-more { display: inline-block; margin-top: 10px; color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 600; }

/* ---- flash ---- */
.flash-stack { margin-bottom: 18px; }
.flash { padding: 10px 14px; border-radius: 7px; font-size: 14px; margin-bottom: 8px; }
.flash-success { background: var(--leaf); color: var(--brand); }
.flash-error { background: #fbe6e1; color: var(--red); }

/* ---- login ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; background: var(--brand) radial-gradient(circle at 85% 15%, rgba(192,224,0,0.16), transparent 45%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px 36px 32px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,0.25); }
.login-brand { flex-direction: column; justify-content: center; margin-bottom: 14px; gap: 10px; }
.login-brand .brand-sub { color: var(--brand); border-left: 0; padding-left: 0; font-size: 15px; }
.login-brand .brand-sub::after { content: ""; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--lime); margin: 8px auto 0; }
.login-brand .brand-mark { color: var(--ink); }
.login-copy { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

/* ---- IT Assets ---- */
.page.wide { max-width: 1320px; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-light:hover { background: var(--leaf-soft); }
.btn-danger { background: var(--red); color: #fff; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--ink); display: block; }
.tile:hover { border-color: var(--forest); }
.tile b { display: block; font-size: 26px; line-height: 1.1; color: var(--brand); }
.tile span { color: var(--muted); font-size: 13px; }
.tile.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }

.filters { display: grid; grid-template-columns: 2fr repeat(5, minmax(0, 1fr)) auto; gap: 8px; align-items: end; }
.filters label { margin-bottom: 4px; }
.filters .btn { height: 38px; }
@media (max-width: 1000px) { .filters { grid-template-columns: 1fr 1fr; } }

.table-scroll { overflow-x: auto; }
.table td.mono, .mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; }
.table tr.row-link:hover td { background: var(--leaf-soft); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.badge-in_use { background: var(--leaf); color: var(--brand); }
.badge-in_store { background: #dcf3f3; color: #1d6466; }
.badge-repair { background: #fff2cc; color: #7a5a00; }
.badge-retired { background: #eeeae4; color: var(--muted); }
.badge-lost { background: #fbe6e1; color: var(--red); }
.badge-warn { background: #fff2cc; color: #7a5a00; }
.badge-bad { background: #fbe6e1; color: var(--red); }

.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 14px; }
.pager a, .pager span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; color: var(--ink); background: #fff; }
.pager span.current { background: var(--brand); color: #fff; border-color: var(--brand); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 0; margin: 0; }
.kv dt, .kv dd { padding: 7px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; word-break: break-word; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 18px 0 6px; }
.holder-box { background: var(--cream); border-radius: 8px; padding: 14px 16px; margin-bottom: 14px; }
.holder-box b { font-size: 18px; display: block; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line); position: relative; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.timeline .when { color: var(--muted); font-size: 12px; }

.tabs-inline { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs-inline button { padding: 8px 14px; border: 1px solid var(--line); background: #fff; border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer; }
.tabs-inline button[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }

.sig-wrap { border: 1px dashed #bdb5a2; border-radius: 8px; background: #fff; position: relative; }
.sig-wrap canvas { width: 100%; height: 150px; display: block; touch-action: none; cursor: crosshair; }
.sig-hint { position: absolute; left: 12px; bottom: 8px; color: #b3ab98; font-size: 12px; pointer-events: none; }
.sig-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; }

.import-table td { font-size: 13px; vertical-align: top; }
.import-table tr.bad td { background: #fdf3f0; }
.err { color: var(--red); font-size: 12px; }
.warn { color: #7a5a00; font-size: 12px; }
.callout { background: #fff2cc; border-radius: 8px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; }
.callout-red { background: #fbe6e1; color: #7c2a19; }

.device-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.device-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.device-card h3 { margin: 0; font-size: 16px; }

/* printable handover form */
.print-sheet { background: #fff; max-width: 800px; margin: 0 auto; padding: 36px 44px; border: 1px solid var(--line); border-radius: var(--radius); }
.print-sheet h1 { font-size: 20px; margin: 0; color: var(--brand); }
.print-sheet .sheet-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--brand); padding-bottom: 14px; margin-bottom: 18px; }
.print-sheet .sheet-head img { height: 48px; }
.print-sheet table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.print-sheet th, .print-sheet td { border: 1px solid #cfc8b6; padding: 7px 10px; text-align: left; vertical-align: top; }
.print-sheet th { background: var(--cream); width: 34%; font-weight: 600; }
.print-sheet .terms { font-size: 13px; line-height: 1.55; }
.print-sheet .sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 26px; }
.print-sheet .sign-box { border-top: 1px solid var(--ink); padding-top: 6px; font-size: 13px; min-height: 120px; }
.print-sheet .sign-box img { max-width: 100%; height: 90px; object-fit: contain; display: block; }
@media print {
  .topbar, .no-print, .flash-stack { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .print-sheet { border: none; padding: 0; }
}

/* ---- JaRco brand extras ---- */
a { color: var(--brand); }
a:hover { color: var(--forest); }
.page-head h1 { color: var(--brand); }
.site-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 8px 16px 28px; }
.site-foot strong { color: var(--brand); }
@media (max-width: 760px) { .topbar { padding: 10px 16px; gap: 12px; flex-wrap: wrap; } .page { padding: 18px 16px; } .brand-logo { height: 32px; } }
@media print { .site-foot { display: none; } .print-sheet .sheet-head img { height: 52px; } }
