.subnav { display: flex; gap: 4px; overflow-x: auto; margin: -8px 0 20px; padding: 5px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.subnav { scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a { display: flex; gap: 8px; align-items: center; padding: 9px 14px; border-radius: 8px; color: var(--muted); white-space: nowrap; font-weight: 500; }
.subnav a:hover { background: #f3f4f6; text-decoration: none; color: var(--text); }
.subnav a.active { background: #0d9488; color: #fff; }
.stat .value.ok { color: var(--ok); }
.stat .value.warn { color: var(--warn); }
.stat .value.bad { color: var(--danger); }
.badge.out { background: #dbeafe; color: #1e40af; }
.badge.returned { background: #dcfce7; color: #166534; }
.badge.overdue { background: #fee2e2; color: #991b1b; }
.badge.retired { background: #e5e7eb; color: #4b5563; }
.sub { color: var(--muted); font-size: 12px; }
.late { color: var(--danger); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* typeahead */
.ta { position: relative; }
.ta-box { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.14); max-height: 320px; overflow-y: auto; margin-top: 4px; }
.ta-item { padding: 9px 12px; cursor: pointer; border-bottom: 1px solid #f3f4f6; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.ta-item:last-child { border-bottom: 0; }
.ta-item:hover { background: #f0fdfa; }
.ta-item.disabled { opacity: .5; cursor: not-allowed; background: #fafafa; }
.ta-empty { padding: 12px; color: var(--muted); text-align: center; }

/* lend / return */
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.step-title { display: flex; gap: 10px; align-items: center; margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.step-title b { width: 26px; height: 26px; border-radius: 50%; background: #0d9488; color: #fff; display: grid; place-items: center; font-size: 13px; }
.picked { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #f0fdfa; border: 1px solid #99f6e4; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.picked.warn { background: #fef2f2; border-color: #fecaca; }
.picked .name { font-weight: 600; }
.picked ul { margin: 6px 0 0; padding-left: 18px; color: var(--danger); font-size: 13px; }
.cart { list-style: none; margin: 12px 0 0; padding: 0; }
.cart li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.cart .empty-cart { border-style: dashed; color: var(--muted); justify-content: center; }
.lend-opts { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 16px; align-items: end; }
.lend-opts > div { flex: 1; min-width: 130px; }
.receipt { border-left: 4px solid var(--ok); }
.receipt h2 { color: var(--ok); }
.receipt ul { margin: 0; padding-left: 18px; }
.confirm-bar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.confirm-bar .sum { color: var(--muted); }
.confirm-bar .sum b { color: var(--text); }
table.data input[type=checkbox] { width: 18px; height: 18px; accent-color: #0d9488; }

/* dialogs */
.dlg { border: 0; border-radius: 12px; padding: 22px; width: min(520px, 94vw); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(15,23,42,.45); }
.dlg h2 { margin: 0 0 4px; font-size: 18px; }
.dlg .hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* tabs + charts */
.tabs { display: inline-flex; gap: 4px; background: #f3f4f6; padding: 4px; border-radius: 9px; }
.tab { font: inherit; border: 0; background: transparent; padding: 6px 16px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.chart-wrap { overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.chart text { font-family: "Segoe UI", system-ui, sans-serif; font-size: 11px; fill: #6b7280; }
.chart .grid { stroke: #e5e7eb; stroke-width: 1; }
.chart .bar-a { fill: #0d9488; }
.chart .bar-b { fill: #2563eb; }
.chart rect:hover { opacity: .75; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rank { display: flex; flex-direction: column; gap: 10px; }
.rank .r { display: flex; align-items: center; gap: 10px; }
.rank .r .n { width: 24px; height: 24px; border-radius: 50%; background: #ccfbf1; color: #0f766e; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.rank .r .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .r .c { font-weight: 600; }
.month-pick { width: auto; }

@media (max-width: 800px) { .steps, .two-col { grid-template-columns: 1fr; } }
