:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #fff;
  --ink: #18243c;
  --muted: #56637a;
  --border: #e0e6f0;
  --brand: #284bcc;
  --brand-dark: #1b3cac;
  --navy: #17284e;
  --green: #17664f;
  --rose: #96333d;
  --amber: #87510d;
  --sidebar: 212px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; background: var(--bg); }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #516fdf; outline-offset: 3px;
}
svg { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
[hidden] { display: none !important; }
.sr-only, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 5; background: white; padding: 12px 18px; border-radius: 7px; }
.loading { color: var(--muted); }
.signed-out .sidebar, .signed-out .workspace-label { display: none; }
.signed-out .shell { margin-left: 0; }
.signed-out .mobile-brand { display: inline-flex; }
.sign-in-panel { max-width: 34rem; margin: clamp(2rem, 10vh, 7rem) auto; padding: clamp(1.4rem, 5vw, 2.4rem); }
.sign-in-panel h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
.sign-in-panel p { margin: .65rem 0 1.25rem; }
.quick-add-fields { grid-template-columns: minmax(0, 3fr) minmax(5rem, 1fr); }
.form-details > .form-grid > div[hidden] { display: none; }
.sync-warning { margin-top: 0; }
.admin-sections section + section { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.admin-sections h3 { margin: 0 0 .65rem; font-size: 1rem; }
.admin-list { list-style: none; padding: 0; margin: .6rem 0; }
.admin-list li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .48rem 0; }
.admin-list li + li { border-top: 1px solid var(--border); }
.admin-list .page-actions { flex-wrap: wrap; justify-content: flex-end; }
.sidebar { display: contents; }
.brand, .sidebar-footer, .workspace-label { display: none; }
.topbar {
  min-height: 65px; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.mobile-brand, .brand {
  display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 760;
  white-space: nowrap; letter-spacing: -.035em;
}
.mobile-brand { font-size: 1.06rem; }
.brand { display: none; }
.mobile-brand:hover, .brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; background: var(--brand); color: #fff; border-radius: 9px;
  width: 34px; height: 34px; font: 26px/1 "Segoe UI Symbol", serif; letter-spacing: 0; padding-bottom: 2px;
}
.demo-button {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid #dce4f2; border-radius: 8px;
  min-height: 44px; padding: 0 10px; background: #f8faff; color: #405070; font-size: .8125rem; font-weight: 650; white-space: nowrap;
}
.demo-button span, .demo-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #478065; flex-shrink: 0; }
.navigation {
  position: fixed; z-index: 3; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 5px 7px calc(5px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
}
.navigation a {
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  min-height: 52px; color: var(--muted); font-size: .8125rem; font-weight: 650; border-radius: 7px;
}
.navigation a:hover { background: #f1f4fa; text-decoration: none; }
.navigation a[aria-current="page"] { color: var(--brand-dark); background: #edf2ff; }
.navigation svg { width: 21px; height: 21px; }
#view { width: min(100%, 1390px); margin-inline: auto; padding: 18px 16px calc(95px + env(safe-area-inset-bottom)); }
#view:focus { outline: none; }
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 225px; border-radius: 14px;
  color: #fff; background: var(--navy); display: flex; align-items: center;
}
.hero-content { position: relative; z-index: 1; padding: 23px 19px; width: 100%; }
.hero-date { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: #d5dff8; font-size: .8125rem; font-weight: 550; }
.hero-date svg { width: 16px; height: 16px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.9rem, 5vw, 3rem); font-weight: 740; line-height: 1.12; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 1.12rem; letter-spacing: -.018em; font-weight: 720; line-height: 1.3; }
.hero-description { max-width: 32ch; margin-bottom: 17px; color: #e0e7fa; font-size: .9375rem; }
.hero-actions, .page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: .33; }
.hero-board {
  position: absolute; width: 275px; height: 275px; right: -165px; top: -80px; transform: rotate(-25deg);
  background: conic-gradient(#3f5c99 25%, #273e73 0 50%, #3f5c99 0 75%, #273e73 0) 0 0 / 60px 60px;
  border: 1px solid #6c83b8;
}
.hero-knight { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  border: 1px solid transparent; border-radius: 8px; padding: 9px 14px;
  font-size: .9375rem; font-weight: 680; line-height: 1.25; text-align: center;
}
.btn svg { width: 18px; height: 18px; }
.btn.primary { color: white; background: var(--brand); border-color: var(--brand); }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.secondary { color: #26364f; background: #fff; border-color: #d8e1ee; }
.btn.secondary:hover, .btn.compact:hover { background: #f3f6ff; border-color: #bfcdf1; }
.btn.hero-primary { color: #173075; background: #fff; border-color: #fff; }
.btn.hero-primary:hover { background: #edf2ff; }
.btn.hero-secondary { color: #fff; background: #263b67; border-color: #59709e; }
.btn.hero-secondary:hover { background: #304978; }
.btn.hero-primary:focus-visible, .btn.hero-secondary:focus-visible { outline-color: #dce6ff; }
.btn.compact { color: var(--brand-dark); background: #fff; border-color: #dbe4f4; padding-inline: 10px; font-size: .875rem; }
.btn.danger { color: #fff; background: #952f39; }
.btn.danger:hover { background: #7a222c; }
.btn.text-danger { color: #922c36; padding-inline: 4px; margin-right: auto; background: transparent; }
.btn.text-danger:hover { text-decoration: underline; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 13px 19px; }
.metric {
  min-width: 0; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: start;
  gap: 5px 5px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
}
.metric:last-child { grid-column: 1 / -1; }
.metric p { margin: 3px 0 0; color: #4c5972; font-size: .875rem; font-weight: 650; line-height: 1.25; }
.metric strong { grid-column: 1; font-size: 1.66rem; line-height: 1.13; font-weight: 740; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-icon, .activity-icon, .category-icon { display: inline-grid; place-items: center; width: 33px; height: 33px; border-radius: 8px; }
.metric-icon { grid-area: 1 / 2 / 3 / 3; }
.metric-icon svg, .activity-icon svg { width: 17px; height: 17px; }
.green { color: var(--green); background: #e9f6ef; }
.blue { color: #2146b3; background: #edf2ff; }
.amber { color: var(--amber); background: #fff2dd; }
.rose { color: var(--rose); background: #fcecef; }
.slate { color: #485a78; background: #edf1f8; }
.dashboard-work { display: grid; gap: 14px; }
.panel { background: white; border: 1px solid var(--border); border-radius: 13px; min-width: 0; }
.panel-head { min-height: 63px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.panel-head a { min-height: 44px; display: inline-flex; align-items: center; font-size: .875rem; font-weight: 650; flex-shrink: 0; }
.activity, .loan-preview { margin: 0; padding: 0; list-style: none; }
.activity li, .loan-preview li { padding: 11px 15px; display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid #edf0f5; }
.activity li:last-child, .loan-preview li:last-child { border-bottom: 0; }
.activity-text, .preview-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.activity-icon { flex-shrink: 0; }
.activity strong, .preview-text strong { display: block; font-size: .9375rem; color: var(--ink); }
.activity-text span, .preview-text span, .activity time { display: block; font-size: .875rem; color: var(--muted); }
.activity time { white-space: nowrap; }
.preview-text .late-text, .issue-text { color: var(--rose); }
.empty { padding: 33px 18px; text-align: center; }
.empty p { margin: 3px 0 0; color: var(--muted); }
.empty .btn { margin-top: 13px; }
.page-intro { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; margin: 4px 0 17px; }
.page-intro h1 { font-size: clamp(2rem, 4.5vw, 2.65rem); }
.page-intro p { color: var(--muted); margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.filters > label { max-width: 100%; min-width: 0; }
.search { position: relative; flex: 1 1 100%; min-width: 0; }
.search svg { position: absolute; left: .75rem; top: .76rem; color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.45rem; width: 100%; }
input, select, textarea {
  min-width: 0; max-width: 100%; border: 1px solid #cdd7e7; border-radius: 8px; min-height: 44px;
  padding: 8px 10px; background: #fff; color: var(--ink); font-size: 1rem;
}
input::placeholder, textarea::placeholder { color: #67778f; opacity: 1; }
select {
  padding-right: 29px; appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%234c5d77' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center;
}
textarea { resize: vertical; }
.filter-date { display: grid; grid-template-columns: 1fr; gap: 2px; color: var(--muted); font-size: .875rem; }
.filter-date input { width: 100%; }
.records { display: block; width: 100%; }
.records thead { position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px; }
.records tbody { display: block; }
.records tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 11px; border-bottom: 1px solid var(--border); padding: 13px; align-items: start; }
.records tr:last-child { border-bottom: 0; }
.records td { display: block; min-width: 0; font-size: .9375rem; overflow-wrap: anywhere; }
.equipment-table td:first-child, .loan-table td:first-child, .loan-table td:nth-child(2), .history-table td:nth-child(3), .records .row-actions { grid-column: 1 / -1; }
.records .row-actions { display: flex; justify-content: flex-start; gap: 7px; flex-wrap: wrap; }
.records .row-actions:empty { display: none; }
.mobile-label { display: block; margin-bottom: 3px; font-size: .8125rem; color: var(--muted); }
.item-cell { display: flex; align-items: center; gap: 8px; }
.category-icon { color: #304c93; background: #eef2fa; flex-shrink: 0; font-family: "Segoe UI Symbol", sans-serif; font-size: 1.22rem; }
.subline { display: block; margin-top: 2px; color: var(--muted); font-size: .875rem; }
.subline.issue-text { color: var(--rose); }
.muted { color: var(--muted); }
.stock-number { font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 8px; font-weight: 650; font-size: .875rem; border-radius: 6px; }
dialog {
  border: 1px solid #dbe2ed; border-radius: 14px; padding: 0; width: min(535px, calc(100% - 20px));
  max-height: calc(100dvh - 20px); color: var(--ink); background: white; box-shadow: 0 22px 70px #0d1a4839; overflow: auto;
}
dialog::backdrop { background: #1525419c; }
.dialog-head { position: sticky; z-index: 1; top: 0; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--border); gap: 10px; padding: 8px 15px; }
.dialog-head h2 { font-size: 1.23rem; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; border: none; border-radius: 8px; background: #f1f4fa; color: var(--ink); }
.icon-button:hover { background: #e6edf9; }
.dialog-body { padding: 13px 15px; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-body > p { margin-bottom: 12px; }
.dialog-footer {
  position: sticky; bottom: 0; z-index: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
  padding: 10px 15px; border-top: 1px solid var(--border); background: white;
}
.field { display: grid; align-content: start; gap: 3px; min-width: 0; color: #344359; font-size: .9375rem; font-weight: 630; }
.field input, .field textarea, .field select { width: 100%; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; margin-bottom: 9px; }
.contact-fields { grid-template-columns: minmax(0, 1fr); }
.movement-type { margin-bottom: 10px; }
.movement-lines { display: grid; gap: 8px; margin-block: 9px; }
.movement-line { min-inline-size: 0; margin: 0; padding: 8px; border: 1px solid var(--border); border-radius: 8px; }
.movement-line-grid { display: grid; gap: 6px; align-items: start; grid-template-columns: minmax(0, 1fr) 83px; }
.movement-line-end { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 5px; }
.movement-line-end .availability { flex: 1 1 auto; margin: 0; }
.movement-line-end .btn { flex: 0 0 auto; }
.availability:empty, .return-preview:empty { display: none; }
.add-line { margin-bottom: 9px; }
.new-equipment { grid-template-columns: minmax(0, 1fr); margin-block: 8px 0; }
.new-equipment details { margin-top: 0; grid-column: 1 / -1; }
.new-equipment details > label + label { margin-top: 7px; }
.return-item { padding-top: 4px; overflow-wrap: anywhere; }
.return-preview { margin: 6px 0 0; }
.detail-lines { margin: 12px 0 0; list-style: none; padding: 0; border-top: 1px solid var(--border); }
.detail-lines li { display: grid; gap: 2px; padding-block: 8px; border-bottom: 1px solid var(--border); }
.detail-lines li span { font-size: .875rem; color: var(--muted); }
.form-details { border-top: 1px solid var(--border); margin-top: 9px; }
.form-details summary, .picker-search summary { cursor: pointer; color: var(--brand-dark); font-weight: 650; font-size: .875rem; }
.form-details summary { min-height: 43px; padding-block: 10px; }
.form-details[open] { padding-bottom: 3px; }
.field-help, .optional { color: var(--muted); font-size: .875rem; font-weight: 400; }
.field-help { margin: 6px 0 9px; }
.picker { position: relative; }
.picker-search { margin-top: 2px; }
.picker-search summary { display: inline-flex; align-items: center; gap: 4px; min-height: 38px; padding: 3px 0; }
.picker-search summary svg { width: 15px; height: 15px; }
.picker-search[open] { margin-bottom: 10px; }
.availability {
  margin: 5px 0 9px; padding: 7px 10px; border-radius: 7px; background: #edf3ff;
  color: #294487; font-size: .875rem; font-weight: 620;
}
.return-preview:not(:empty) { background: #ebf7f0; color: var(--green); border-radius: 7px; padding: 7px 10px; font-size: .875rem; font-weight: 620; }
.form-error { padding: 8px 10px; border: 1px solid #f0cbd0; border-radius: 7px; background: #fff1f3; color: #842831; font-size: .9375rem; }
.record-details { display: grid; grid-template-columns: minmax(95px, .55fr) minmax(0, 1fr); gap: 7px 12px; margin: 0; }
.record-details dt { color: var(--muted); }
.record-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 620; }
.reset-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.confirm-box { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.confirm-box input { width: 20px; min-height: 20px; flex-shrink: 0; accent-color: var(--brand); }
.toast {
  position: fixed; z-index: 4; right: 10px; bottom: calc(75px + env(safe-area-inset-bottom)); left: 10px;
  display: flex; gap: 10px; align-items: center; padding: 10px 13px; border-radius: 9px;
  color: #fff; background: #174a3a; box-shadow: 0 5px 16px #18323f27; font-weight: 620;
}
@media (min-width: 390px) {
  .topbar { padding-inline: 20px; }
  #view { padding-inline: 20px; }
  .hero-content { padding-inline: 23px; }
}
@media (min-width: 540px) {
  .hero-board { right: -65px; }
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric:last-child { grid-column: auto; }
  .contact-fields, .new-equipment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .movement-line-grid { grid-template-columns: minmax(0, 1fr) 98px; }
  .return-line .movement-line-grid { grid-template-columns: minmax(0, 1fr) 122px; }
  .search { flex-basis: 15rem; }
  .filter-date { grid-template-columns: auto 1fr; align-items: center; gap: 5px; }
  .toast { left: auto; right: 20px; max-width: min(520px, calc(100% - 40px)); }
}
@media (min-width: 780px) {
  .sidebar {
    position: fixed; display: flex; flex-direction: column; inset: 0 auto 0 0; z-index: 2;
    width: var(--sidebar); background: #fff; border-right: 1px solid var(--border); padding: 20px 12px 14px;
  }
  .brand { display: inline-flex; margin: 3px 3px 27px; font-size: 1.16rem; }
  .brand-mark { width: 37px; height: 37px; font-size: 29px; }
  .sidebar-footer { display: block; margin-top: auto; padding: 12px 9px 3px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8125rem; }
  .sidebar-footer p { margin: 6px 0 0; }
  .demo-indicator { display: flex; align-items: center; gap: 6px; color: #425470; font-weight: 650; }
  .text-button { display: inline-block; background: none; border: 0; padding: 0; min-height: 44px; color: var(--brand-dark); font-weight: 650; }
  .text-button:hover { text-decoration: underline; }
  .navigation { position: static; display: grid; grid-template-columns: 1fr; gap: 5px; border: 0; padding: 0; }
  .navigation a { flex-direction: row; justify-content: flex-start; min-height: 45px; gap: 11px; padding: 0 10px; font-size: .9375rem; }
  .shell { margin-left: var(--sidebar); }
  .topbar { padding-inline: clamp(20px, 2.6vw, 42px); min-height: 69px; }
  .mobile-brand { display: none; }
  .workspace-label { display: block; font-size: .9375rem; font-weight: 660; color: #4d5b74; }
  #view { padding: 24px clamp(20px, 2.6vw, 42px) 38px; }
  .hero-content { padding: 27px 30px 29px; }
  .hero-description { max-width: 55ch; font-size: 1rem; }
  .hero-board { width: 350px; height: 350px; right: -35px; top: -83px; }
  .hero-art { opacity: .72; }
  .page-intro { flex-direction: row; align-items: flex-end; justify-content: space-between; margin: 4px 0 19px; }
  .toast { bottom: 20px; }
}
@media (min-width: 1060px) {
  .metric-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-block: 17px 22px; }
  .metric { padding: 13px; grid-template-columns: 1fr; gap: 7px; }
  .metric-icon { grid-area: auto; }
  .metric strong { font-size: 1.9rem; }
  .dashboard-work { grid-template-columns: 1fr 1.15fr; gap: 16px; }
  .panel-head, .activity li, .loan-preview li { padding-inline: 17px; }
  .hero-knight {
    display: block; position: absolute; right: 75px; top: 13px; color: #e4bd7b;
    transform: rotate(-10deg); font: 182px/.95 "Segoe UI Symbol", serif;
    text-shadow: 2px 7px #111e42;
  }
  .hero-board { right: -12px; }
  .filters { padding: 14px; }
  .records { display: table; border-collapse: collapse; }
  .records thead { position: static; clip-path: none; width: auto; height: auto; }
  .records tbody { display: table-row-group; }
  .records tr { display: table-row; border-bottom: 1px solid #e9eef5; }
  .records th, .records td { padding: 11px 13px; text-align: left; vertical-align: middle; }
  .records th { color: #4c5972; background: #f8faff; font-size: .875rem; font-weight: 650; }
  .records td, .records .row-actions, .records .row-actions:empty { display: table-cell; }
  .records .row-actions .btn { margin: 2px 4px 2px 0; }
  .mobile-label { display: none; }
}
@media (min-width: 1270px) {
  :root { --sidebar: 226px; }
  .sidebar { padding-inline: 17px; }
  .metric { grid-template-columns: 1fr auto; gap: 5px; padding: 16px; }
  .metric-icon { grid-area: 1 / 2 / 3 / 3; }
  .hero { min-height: 235px; }
  .hero-knight { right: 117px; }
}
@media (forced-colors: active) {
  .badge, .metric-icon, .activity-icon, .category-icon { border: 1px solid currentColor; }
  .hero, .navigation a[aria-current="page"] { border: 1px solid currentColor; }
}
