:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #dbe4ef;
  --line-strong: #c9d5e4;
  --text: #172033;
  --muted: #65748b;
  --muted-2: #8b98aa;
  --blue: #0f5bd7;
  --blue-2: #164ab4;
  --blue-soft: #eaf2ff;
  --teal: #0f9f8f;
  --teal-soft: #e5f8f5;
  --amber: #e58a00;
  --amber-soft: #fff4db;
  --red: #d43b50;
  --red-soft: #ffecef;
  --purple: #7759d5;
  --purple-soft: #f0edff;
  --green: #16875c;
  --green-soft: #e6f7ef;
  --shadow-sm: 0 2px 7px rgba(28, 53, 84, 0.06);
  --shadow-md: 0 12px 36px rgba(27, 47, 74, 0.12);
  --radius: 14px;
  --page-gutter: clamp(14px, 1.6vw, 28px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }
.no-scroll { overflow: hidden; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { position: sticky; top: 0; z-index: 70; background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.header-inner { width: 100%; max-width: none; margin: 0; padding: 10px var(--page-gutter); display: grid; grid-template-columns: minmax(280px,1fr) auto minmax(280px,1fr); align-items: center; gap: clamp(12px, 1.2vw, 18px); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-button { border: 0; background: transparent; padding: 4px 6px; margin: -4px -6px; border-radius: 14px; text-align: left; }
.brand-button:hover .brand-title { color: var(--blue); }
.brand-button:hover .brand-icon { transform: translateY(-1px); box-shadow: 0 10px 20px rgba(15,91,215,.24); }
.brand-button:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(15,91,215,.16); }
.brand-icon { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--blue), var(--teal)); box-shadow: 0 7px 18px rgba(15,91,215,.24); flex: 0 0 auto; transition: transform .16s ease, box-shadow .16s ease; }
.brand-icon svg { width: 22px; height: 22px; }
.brand-kicker { color: var(--blue); font-size: 10px; letter-spacing: .12em; font-weight:700; text-transform: uppercase; }
.brand-title { font-size: 17px; font-weight:700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desktop-nav { background: #edf2f8; border-radius: 13px; padding: 4px; display: flex; gap: 3px; }
.nav-button { border: 0; background: transparent; color: #526077; border-radius: 9px; padding: 8px 12px; font-size: 12px; font-weight:700; display: flex; align-items: center; gap: 7px; transition: .16s ease; }
.nav-button:hover { background: rgba(255,255,255,.65); color: var(--text); }
.nav-button.active { background: white; color: var(--blue); box-shadow: var(--shadow-sm); }
.nav-icon { width: 16px; height: 16px; display: inline-grid; place-items: center; }
.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.user-picker { min-height: 38px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.user-picker span { font-size: 11px; color: var(--muted); }
.user-picker select { border: 0; background: transparent; outline: none; font-size: 12px; font-weight:700; color: var(--text); max-width: 140px; }
.icon-button, .secondary-button, .primary-button, .danger-button, .ghost-button { border-radius: 10px; font-weight:700; border: 1px solid transparent; transition: .16s ease; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; background: #f1f5f9; color: #536174; border-color: #e2e8f0; }
.icon-button:hover { background: #e8eef5; }
.primary-button { background: var(--blue); color: white; border-color: var(--blue); padding: 9px 14px; box-shadow: 0 6px 14px rgba(15,91,215,.16); }
.primary-button:hover { background: var(--blue-2); }
.secondary-button { background: white; color: #445269; border-color: var(--line); padding: 9px 13px; }
.secondary-button:hover { background: #f7f9fc; border-color: var(--line-strong); }
.danger-button { background: white; color: var(--red); border-color: #f3c4cc; padding: 9px 13px; }
.danger-button:hover { background: var(--red-soft); }
.ghost-button { background: transparent; color: #57657a; padding: 8px 10px; }
.ghost-button:hover { background: #eef2f7; }
.small-button { padding: 6px 9px; border-radius: 8px; font-size: 11px; }

.app-main { width: 100%; max-width: none; margin: 0; flex: 1; padding: 18px var(--page-gutter) 22px; }
.workspace { display: grid; grid-template-columns: clamp(280px, 18vw, 340px) minmax(0,1fr); gap: clamp(16px, 1.4vw, 24px); align-items: start; }
.workspace.full-width { grid-template-columns: minmax(0,1fr); }
.sidebar { position: sticky; top: 80px; max-height: calc(100vh - 98px); overflow: auto; padding: 13px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow-sm); scrollbar-width: thin; width: 100%; }
.sidebar-search { position: relative; margin-bottom: 9px; }
.sidebar-search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 34px 10px 11px; background: #f8fafc; color: var(--text); outline: none; font-size: 12px; }
.sidebar-search input:focus { border-color: #9bbcf0; box-shadow: 0 0 0 3px rgba(15,91,215,.08); }
.sidebar-search .search-symbol { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 13px; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 14px; }
.sidebar-actions button { padding: 8px 7px; font-size: 11px; }
.section-label { margin: 2px 4px 8px; color: #718199; font-size: 9px; font-weight:700; letter-spacing: .11em; text-transform: uppercase; }
.analyzer-group { border: 1px solid var(--line); background: white; border-radius: 11px; overflow: hidden; margin-bottom: 7px; }
.analyzer-head { width: 100%; border: 0; background: #f8fafc; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; text-align: left; color: #29374c; }
.analyzer-head:hover { background: #f1f5f9; }
.analyzer-head.active { background: #edf4ff; color: #174db9; }
.analyzer-title { min-width: 0; display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight:700; line-height: 1.25; }
.chevron { color: #8795a9; display: inline-block; transform: rotate(0); transition: .15s ease; }
.chevron.open { transform: rotate(90deg); }
.count-badge { flex: 0 0 auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: #e8eef6; color: #5b6a80; font-size: 9px; font-weight:700; }
.analyzer-head.active .count-badge { background: white; color: var(--blue); }
.analyzer-body { padding: 4px 5px 7px; display: none; }
.analyzer-body.open { display: block; }
.category-button { width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; color: #59677a; font-size: 10px; font-weight:700; }
.category-button:hover { background: #f5f7fa; }
.category-button.active { color: var(--blue); background: #eef4ff; }
.category-name { display: flex; align-items: center; gap: 7px; }
.category-dot { width: 6px; height: 6px; border-radius: 50%; background: #9aa8ba; }
.category-button.active .category-dot { background: var(--blue); }
.category-count { color: #8190a4; font-size: 9px; }
.reagent-list { padding-left: 10px; }
.reagent-button { width: 100%; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; color: #344258; }
.reagent-button:hover { background: #f3f6fa; }
.reagent-button.active { background: var(--blue-soft); color: #174db9; }
.reagent-title { font-size: 10px; font-weight:700; line-height: 1.2; }
.reagent-code { display: block; margin-top: 2px; font-size: 8px; color: #8a98aa; }
.stock-pill { font-size: 8px; min-width: 20px; padding: 3px 5px; text-align: center; border-radius: 999px; background: #edf1f6; color: #65748a; font-weight:700; }
.reagent-button.active .stock-pill { background: white; color: var(--blue); }
.empty-tree { color: var(--muted-2); font-size: 10px; padding: 7px 9px; }
.sidebar-footer { margin-top: 9px; display: flex; justify-content: flex-end; }

.content-area { min-width: 0; }
.page-heading { margin-bottom: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.page-heading h1 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
.page-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.mobile-reagent-trigger { display: none; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 10px; margin-bottom: 12px; }
.status-card { min-height: 100px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.status-card::after { content: ""; position: absolute; right: -20px; bottom: -25px; width: 85px; height: 85px; border-radius: 50%; opacity: .35; background: currentColor; filter: blur(1px); }
.status-card.blue { color: #2966c7; }
.status-card.teal { color: #188b80; }
.status-card.amber { color: #c27a09; }
.status-card.red { color: #c74458; }
.status-label { color: #6b7990; font-size: 10px; }
.status-value { margin-top: 9px; color: var(--text); font-size: 24px; font-weight:700; line-height: 1; }
.status-note { margin-top: 6px; color: #748198; font-size: 9px; }
.status-icon { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: currentColor; color: white; opacity: .82; z-index: 1; }

.reagent-hero { border: 1px solid #cfe0fb; background: linear-gradient(135deg,#f7fbff,#eef5ff); border-radius: 14px; padding: 15px 17px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.reagent-path { color: var(--blue); font-size: 9px; font-weight:700; letter-spacing: .04em; text-transform: uppercase; }
.reagent-hero h2 { margin: 5px 0 3px; font-size: 20px; }
.reagent-meta { color: var(--muted); font-size: 10px; }
.toolbar { border: 1px solid var(--line); background: white; border-radius: 12px; padding: 9px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.toolbar input, .toolbar select { min-height: 36px; border: 1px solid var(--line); border-radius: 9px; padding: 0 10px; background: #fbfcfe; outline: none; font-size: 11px; color: var(--text); }
.toolbar input:focus, .toolbar select:focus { border-color: #9bbcf0; box-shadow: 0 0 0 3px rgba(15,91,215,.07); }
.toolbar input { min-width: 200px; }
.toolbar-spacer { flex: 1; }
.lot-list { display: grid; gap: 10px; }
.lot-card { background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow-sm); }
.lot-card.expired { border-color: #f3b6c0; }
.lot-card.consumed { background: #fafbfd; }
.lot-header { padding: 11px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; border-bottom: 1px solid #e7edf4; }
.lot-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.lot-number { font-size: 13px; font-weight:700; }
.lot-subtitle { color: #76849a; font-size: 9px; margin-top: 4px; line-height: 1.5; }
.status-badge { border-radius: 999px; padding: 3px 7px; font-size: 8px; font-weight:700; }
.status-badge.active { background: var(--green-soft); color: var(--green); }
.status-badge.consumed { background: var(--red-soft); color: var(--red); }
.status-badge.expiring { background: var(--amber-soft); color: #b87200; }
.status-badge.expired { background: var(--red-soft); color: var(--red); }
.status-badge.package { background: var(--blue-soft); color: var(--blue); }
.lot-stock { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--muted); }
.lot-stock strong { color: var(--text); font-size: 12px; }
.more-button { width: 29px; height: 29px; border: 0; border-radius: 8px; background: transparent; color: #77859a; }
.more-button:hover { background: #eef2f7; }
.vials-grid { padding: 10px; display: grid; grid-template-columns: repeat(auto-fit,minmax(138px,1fr)); gap: 7px; }
.vial-card { min-height: 78px; border: 1px solid #dce5ef; background: #f8fafc; border-radius: 9px; padding: 9px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.vial-card.next { border-color: #7ea8ee; background: #f1f6ff; box-shadow: inset 0 0 0 1px #bfd4f8; }
.vial-index { font-size: 9px; color: #5b6880; font-weight:700; }
.vial-state { margin-top: 4px; color: #6f7d91; font-size: 9px; line-height: 1.35; }
.vial-user { color: #27364c; font-weight:700; }
.open-vial-button { width: 100%; border: 0; color: white; background: var(--blue); border-radius: 7px; padding: 5px 7px; font-size: 9px; font-weight:700; margin-top: 6px; }
.vial-edit { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border: 0; border-radius: 7px; background: rgba(255,255,255,.8); color: #7b899d; display: none; }
.vial-card:hover .vial-edit { display: block; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 14px; background: rgba(255,255,255,.7); padding: 40px 18px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--text); margin-bottom: 5px; }

.panel { border: 1px solid var(--line); background: white; border-radius: 14px; box-shadow: var(--shadow-sm); }
.panel-header { padding: 14px 16px; border-bottom: 1px solid #e8edf4; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 14px; }
.panel-body { padding: 15px; }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.analytics-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.metric-list { display: grid; gap: 7px; }
.metric-row { display: grid; grid-template-columns: minmax(110px,1fr) 2fr auto; align-items: center; gap: 9px; font-size: 10px; }
.metric-name { color: #435168; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-bar { height: 8px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.metric-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg,var(--blue),var(--teal)); }
.metric-value { color: #5f6e83; font-weight:700; }
.monthly-chart { height: 230px; display: grid; grid-template-columns: repeat(12,1fr); gap: 7px; align-items: end; padding-top: 20px; }
.month-column { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.month-bar-wrap { height: 180px; width: 100%; display: flex; align-items: end; justify-content: center; }
.month-bar { width: min(24px,75%); min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg,var(--blue),#67a4f5); }
.month-label { font-size: 8px; color: #7c899d; }
.month-value { font-size: 8px; color: #526078; font-weight:700; }

.report-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(160px,1fr)); gap: 8px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: white; margin-bottom: 10px; }
.field label { display: block; margin-bottom: 5px; color: #66758a; font-size: 9px; font-weight:700; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; padding: 9px 10px; color: var(--text); outline: none; font-size: 11px; }
.field textarea { resize: vertical; min-height: 86px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #94b7ee; box-shadow: 0 0 0 3px rgba(15,91,215,.07); }
.report-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px; padding-top: 4px; }
.table-wrap { overflow: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.data-table th { background: #edf2f8; color: #38465b; text-align: left; padding: 9px; font-size: 9px; letter-spacing: .02em; white-space: nowrap; }
.data-table td { border-top: 1px solid #e7edf4; padding: 9px; color: #506078; vertical-align: top; }
.data-table td strong { color: #26354a; }
.data-table tr:hover td { background: #fbfcfe; }
.table-actions { display: flex; gap: 5px; justify-content: flex-end; }

.note-layout { display: grid; grid-template-columns: 330px minmax(0,1fr); gap: 12px; }
.note-form { padding: 15px; }
.note-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; color: #66748a; background: white; font-size: 10px; font-weight:700; }
.filter-chip.active { color: var(--blue); background: var(--blue-soft); border-color: #c4d8f7; }
.note-list { display: grid; gap: 9px; }
.note-card { border: 1px solid var(--line); border-left: 4px solid var(--blue); background: white; border-radius: 11px; padding: 12px 13px; box-shadow: var(--shadow-sm); }
.note-card.priority-high { border-left-color: var(--red); }
.note-card.priority-medium { border-left-color: var(--amber); }
.note-card.priority-low { border-left-color: var(--teal); }
.note-card.done { opacity: .68; background: #f8fafc; }
.note-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.note-title { font-size: 12px; font-weight:700; }
.note-body { margin-top: 6px; color: #58667b; font-size: 10px; white-space: pre-wrap; line-height: 1.55; }
.note-meta { margin-top: 8px; color: #8794a6; font-size: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.note-actions { display: flex; gap: 5px; }

.register-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; padding: 4px; width: max-content; max-width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #edf2f8; }
.register-tab { border: 1px solid var(--line); background: white; color: #5b697e; border-radius: 9px; padding: 7px 11px; font-size: 10px; font-weight:700; }
.register-tab.active { color: var(--blue); background: var(--blue-soft); border-color: #c5d8f7; }
.inline-form { display: flex; gap: 7px; flex-wrap: wrap; align-items: end; }
.inline-form .field { min-width: 180px; flex: 1; }
.analyzer-register { display: grid; gap: 8px; }
.analyzer-register-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.category-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.category-tag { border-radius: 999px; background: #edf3fb; color: #496078; padding: 4px 8px; font-size: 9px; display: flex; align-items: center; gap: 5px; }
.category-tag button { border: 0; background: transparent; color: var(--red); padding: 0; line-height: 1; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(15,27,45,.58); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-card { width: min(760px,100%); max-height: calc(100vh - 36px); overflow: auto; background: white; border-radius: 17px; box-shadow: 0 24px 70px rgba(8,20,38,.26); }
.modal-card.small { width: min(460px,100%); }
.modal-header { position: sticky; top: 0; z-index: 2; background: white; border-bottom: 1px solid var(--line); padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-header h2 { margin: 0; font-size: 15px; }
.modal-close { border: 0; width: 31px; height: 31px; border-radius: 8px; background: #f0f3f7; color: #66748a; }
.modal-body { padding: 15px 16px; }
.modal-footer { position: sticky; bottom: 0; background: white; border-top: 1px solid var(--line); padding: 11px 16px; display: flex; justify-content: flex-end; gap: 7px; }
.form-section { margin: 2px 0 10px; padding-top: 12px; border-top: 1px solid #e8edf4; grid-column: 1 / -1; }
.form-section:first-child { border-top: 0; padding-top: 0; }
.form-section-title { color: #527092; font-size: 9px; font-weight: 950; letter-spacing: .09em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.field.full { grid-column: 1 / -1; }
.form-help { margin-top: 4px; color: #8895a7; font-size: 8px; line-height: 1.4; }
.form-summary { padding: 10px 11px; border: 1px solid #cbdcf7; background: #eff5ff; color: #2755ad; border-radius: 9px; font-size: 10px; font-weight:700; }
.confirm-box { background: #fff5f6; border: 1px solid #f1c5cd; color: #8e2d3d; border-radius: 10px; padding: 11px; font-size: 10px; line-height: 1.5; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 18% 15%,#d9eaff,transparent 36%),radial-gradient(circle at 82% 80%,#daf5ef,transparent 35%),#f4f7fb; }
.login-card { width: min(420px,100%); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-md); padding: 25px; }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; }
.login-title { font-size: 20px; font-weight:700; }
.login-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }
.login-card .field { margin-bottom: 11px; }
.login-error { color: var(--red); background: var(--red-soft); border-radius: 9px; padding: 8px 10px; font-size: 10px; margin-bottom: 10px; }

.toast-stack { position: fixed; right: 16px; bottom: 16px; z-index: 160; display: grid; gap: 8px; }
.toast { min-width: 250px; max-width: 360px; color: white; background: #25344a; border-radius: 11px; padding: 10px 12px; box-shadow: var(--shadow-md); font-size: 10px; animation: toast-in .2s ease; }
.toast.success { background: #146c4c; }
.toast.error { background: #a82d42; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.sync-indicator { display: inline-flex; align-items: center; gap: 5px; color: #76859a; font-size: 9px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #9aa8b8; }
.sync-indicator.connected .sync-dot { background: var(--green); box-shadow: 0 0 0 3px rgba(22,135,92,.12); }
.sync-indicator.syncing .sync-dot { background: var(--amber); animation: pulse 1s infinite; }
.sync-indicator.error .sync-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

.bottom-nav { display: none; }
.fab { display: none; }
.mobile-sheet-backdrop { display: none; }

@media (min-width: 821px) {
  .content-area > .panel, .content-area .panel, .content-area .report-controls { width: 100%; }
  .page-heading { margin-bottom: 16px; }
  .desktop-nav { justify-self: center; }
}
@media (min-width: 1440px) {
  .page-heading h1 { font-size: 24px; }
  .panel-body { padding: 16px; }
  .report-controls { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .header-inner { grid-template-columns: minmax(230px,1fr) auto; }
  .desktop-nav { order: 3; grid-column: 1 / -1; justify-self: center; }
  .workspace { grid-template-columns: 270px minmax(0,1fr); }
  .status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-controls { grid-template-columns: repeat(3,minmax(130px,1fr)); }
}
@media (max-width: 820px) {
  body { padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
  .header-inner { grid-template-columns: 1fr auto; padding: 8px 11px; }
  .brand-icon { width: 36px; height: 36px; border-radius: 11px; }
  .brand-kicker { font-size: 8px; }
  .brand-title { font-size: 13px; }
  .desktop-nav { display: none; }
  .user-picker span { display: none; }
  .user-picker { min-height: 34px; padding: 0 7px; }
  .user-picker select { max-width: 105px; font-size: 10px; }
  .header-actions .icon-button { width: 34px; height: 34px; }
  .app-main { padding: 11px; }
  .workspace { display: block; }
  .sidebar { display: none; }
  .page-heading { align-items: center; }
  .page-heading h1 { font-size: 18px; }
  .mobile-reagent-trigger { display: inline-flex; }
  .status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .status-card { min-height: 88px; padding: 11px; }
  .status-value { font-size: 20px; }
  .reagent-hero { padding: 12px; align-items: flex-start; }
  .reagent-hero .primary-button { display: none; }
  .toolbar { padding: 7px; }
  .toolbar input { min-width: 0; width: 100%; }
  .toolbar select { flex: 1; min-width: 120px; }
  .toolbar-spacer { display: none; }
  .lot-header { padding: 10px; }
  .vials-grid { grid-template-columns: repeat(2,minmax(0,1fr)); padding: 8px; }
  .vial-card { min-height: 75px; }
  .grid-2, .grid-3, .analytics-grid, .note-layout { grid-template-columns: 1fr; }
  .report-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
  .field.full, .form-section { grid-column: auto; }
  .bottom-nav { position: fixed; z-index: 80; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); height: 60px; display: grid; grid-template-columns: repeat(6,1fr); gap: 2px; padding: 5px; border: 1px solid rgba(204,217,234,.9); border-radius: 17px; background: rgba(255,255,255,.94); backdrop-filter: blur(16px); box-shadow: 0 13px 40px rgba(24,43,68,.22); }
  .bottom-nav button { border: 0; border-radius: 11px; background: transparent; color: #6d7a8f; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 8px; font-weight:700; }
  .bottom-nav button.active { background: var(--blue-soft); color: var(--blue); }
  .bottom-nav .bottom-icon { font-size: 15px; line-height: 1; }
  .fab { position: fixed; right: 15px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 79; width: 50px; height: 50px; border: 0; border-radius: 16px; background: var(--blue); color: white; box-shadow: 0 12px 30px rgba(15,91,215,.35); display: grid; place-items: center; font-size: 24px; }
  .mobile-sheet-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(15,27,45,.5); display: block; }
  .mobile-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow: auto; background: white; border-radius: 20px 20px 0 0; padding: 12px 12px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(12,29,51,.2); }
  .sheet-handle { width: 42px; height: 4px; border-radius: 999px; background: #d5dde7; margin: 0 auto 10px; }
  .sheet-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
  .sheet-title h2 { margin: 0; font-size: 14px; }
  .mobile-sheet .sidebar { display: block; position: static; max-height: none; overflow: visible; border: 0; box-shadow: none; padding: 0; }
  .toast-stack { left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); bottom: auto; }
  .toast { min-width: 0; max-width: none; }
}
@media print {
  .app-header, .sidebar, .bottom-nav, .fab, .no-print, .toast-stack { display: none !important; }
  body { background: white; padding: 0; }
  .app-main { max-width: none; padding: 0; }
  .workspace { display: block; }
  .panel, .lot-card, .status-card { box-shadow: none; break-inside: avoid; }
}


/* Uvoz stare papirne evidence */
.historical-import-info { margin: 0 0 12px; padding: 10px 12px; border: 1px solid #c9daf6; border-radius: 10px; background: #f1f6ff; color: #315681; font-size: 9px; line-height: 1.5; }
.import-source-box { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 13px; padding: 10px 12px; border-radius: 10px; background: #eef5ff; color: #315b91; font-size: 9px; }
.import-packages { display: grid; gap: 11px; margin-top: 14px; }
.import-package-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.import-package-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #f7f9fc; border-bottom: 1px solid var(--line); font-size: 10px; }
.import-package-fields { padding: 11px 12px; }
.import-warning { margin: 8px 12px 0; padding: 7px 9px; border: 1px solid #f2d59d; border-radius: 8px; background: #fff8e8; color: #7b5717; font-size: 8px; }
.import-vials-wrap { border-top: 1px solid var(--line); }
.import-vials-table { min-width: 720px; }
.import-vials-table input { width: 100%; min-height: 30px; border: 1px solid #d8e0ea; border-radius: 7px; padding: 5px 7px; font-size: 9px; }
.import-warning-cell { color: #9a6715; font-size: 8px; min-width: 150px; }
.soft-badge { border-radius: 999px; padding: 3px 7px; background: #e8eef7; color: #53647a; font-size: 8px; font-weight:700; }
@media (max-width:820px) {
  .import-source-box { display: block; }
  .import-source-box > div + div { margin-top: 4px; }
}


/* Arhiv in avtonomno urejanje */
.hero-actions { display:flex; gap:7px; align-items:center; flex-wrap:wrap; }
.archive-list { display:grid; gap:10px; }
.archive-card { border:1px solid var(--line); border-radius:13px; background:white; box-shadow:var(--shadow-sm); overflow:hidden; }
.archive-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:12px 14px; }
.archive-year { display:inline-grid; place-items:center; min-width:42px; padding:3px 7px; border-radius:999px; background:var(--purple-soft); color:var(--purple); font-size:9px; font-weight:600; }
.archive-details { border-top:1px solid #e8edf4; }
.archive-details summary { cursor:pointer; padding:9px 14px; color:#59677b; font-size:10px; font-weight:600; background:#fafbfd; }
.archive-details .table-wrap { padding:0 12px 12px; }

/* RC13 · Arhiviranje LOT-ov in analizatorjev */
.archive-action-button {
  border-color: #c7d5e7;
  background: #f8fafc;
  color: #52647a;
}
.archive-action-button:hover:not(:disabled) {
  border-color: #9eb5d3;
  background: #eef4fb;
  color: #315d98;
}
.status-badge.archived {
  background: #f1edff;
  color: #6846b8;
  border: 1px solid #ddd2fb;
}
.archived-analyzers-panel { margin: 12px 0; }
.archive-count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 10px;
  font-weight: 700;
}
.archived-analyzer-list {
  display: grid;
  gap: 8px;
}
.archived-analyzer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid #dfe6ef;
  border-radius: 11px;
  background: #fbfcfe;
}
.archived-analyzer-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 3px;
}
.archive-symbol {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--purple-soft);
  color: var(--purple);
  font-size: 11px;
}
.archive-toolbar { margin-top: 12px; }
@media (max-width: 700px) {
  .archived-analyzer-card { align-items: flex-start; flex-direction: column; }
  .archived-analyzer-card > button { width: 100%; }
}
.analyzer-settings-head { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.check-row { display:flex; align-items:center; gap:7px; color:#526178; font-size:10px; font-weight:600; }
.check-row input { width:auto; }
.category-tag { display:inline-flex; align-items:center; gap:3px; }
.category-tag button { border:0; background:transparent; color:#718096; padding:0 2px; font-weight:600; }
.category-tag .category-edit { color:var(--blue); }
@media (max-width:820px){
  .archive-card-head { display:block; }
  .archive-card-head .table-actions { justify-content:flex-start; margin-top:9px; flex-wrap:wrap; }
  .hero-actions .secondary-button { display:none; }
  .bottom-nav button { font-size:7px; }
  .bottom-nav .bottom-icon { font-size:13px; }
}


/* PDF / JPG / PNG archive importer */
.modal-card:has(.media-import-layout), .modal-card:has(.import-packages) { width: min(1180px, 100%); }
.media-import-layout { display: grid; grid-template-columns: minmax(300px, .95fr) minmax(360px, 1.05fr); gap: 16px; align-items: start; }
.media-document-panel, .media-settings-panel { min-width: 0; }
.media-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; color: #2b3b51; font-size: 10px; }
.media-panel-title span { color: var(--muted); font-size: 9px; }
.media-preview-grid { display: grid; gap: 10px; max-height: 68vh; overflow: auto; padding-right: 3px; }
.media-preview-grid.compact { grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); max-height: 360px; margin: 0 0 14px; }
.media-preview-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f3f6fa; }
.media-preview-title { padding: 7px 9px; border-bottom: 1px solid var(--line); background: #fff; color: #54647a; font-size: 9px; font-weight:700; word-break: break-word; }
.media-preview-card img { display: block; width: 100%; height: auto; max-height: 65vh; object-fit: contain; background: #dfe5ec; }
.media-preview-card object { display: block; width: 100%; height: 62vh; min-height: 420px; background: #fff; }
.media-preview-grid.compact .media-preview-card img { max-height: 320px; }
.media-preview-grid.compact .media-preview-card object { height: 320px; min-height: 280px; }
.ocr-status { margin-top: 13px; padding: 10px 11px; border: 1px solid #d7e1ef; border-radius: 10px; background: #f7f9fc; color: #4f6075; }
.ocr-status.working { border-color: #bdd4fb; background: #eef5ff; color: #2457a7; }
.ocr-status.done { border-color: #b8e5d6; background: #edfbf6; color: #167253; }
.ocr-status.error { border-color: #f2c3c9; background: #fff1f3; color: #a92337; }
.ocr-status-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; font-size: 9px; }
.ocr-progress-track { height: 6px; margin-top: 8px; border-radius: 999px; overflow: hidden; background: #dce4ef; }
.ocr-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#0f5bd7,#16a085); transition: width .2s ease; }
.raw-ocr-field { margin-top: 12px; }
.raw-ocr-field textarea { min-height: 120px; font-family: ui-monospace,SFMono-Regular,Menlo,monospace; font-size: 8px; }
.manual-import-note { margin-top: 12px; padding: 10px 11px; border-radius: 10px; border: 1px solid #efdcae; background: #fff9e8; color: #735820; font-size: 9px; line-height: 1.5; }
.raw-ocr-details { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; }
.raw-ocr-details summary { cursor: pointer; padding: 9px 11px; color: #485a71; font-size: 9px; font-weight:700; }
.raw-ocr-details pre { max-height: 260px; overflow: auto; margin: 0; padding: 10px 11px; border-top: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; color: #55657a; font-size: 8px; }
@media (max-width: 880px) {
  .media-import-layout { grid-template-columns: 1fr; }
  .media-preview-grid { max-height: 42vh; }
  .media-preview-card img { max-height: 40vh; }
  .media-preview-card object { height: 38vh; min-height: 280px; }
}


/* RC3: polnoširinski šifranti, lokalni dokumentni AI in varnejši touch UX */
.system-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.system-grid .danger-panel { grid-column: 1 / -1; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.ai-status { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 9px; font-weight:700; white-space: nowrap; }
.ai-status.connected { color: #126648; background: var(--green-soft); }
.ai-status.checking { color: #9a6500; background: var(--amber-soft); }
.ai-status.offline { color: #8c4050; background: var(--red-soft); }
.local-ai-box { margin-top: 12px; padding: 11px 12px; border: 1px solid #c9dafa; border-radius: 11px; background: linear-gradient(135deg,#f1f6ff,#eefbf8); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.content-area > .page-heading:first-child { margin-top: 2px; }
.workspace.full-width .content-area { width: 100%; }
.workspace.full-width .panel { width: 100%; }
.register-tab { min-height: 36px; }
.table-actions button, .note-actions button, .hero-actions button { min-height: 34px; }

@media (max-width: 820px) {
  .header-inner { min-width: 0; gap: 7px; }
  .brand { min-width: 0; gap: 8px; }
  .brand > div:last-child { min-width: 0; }
  .brand-kicker { display: none; }
  .brand-title { max-width: min(48vw,190px); }
  .header-actions { min-width: 0; gap: 5px; }
  .sync-indicator span:last-child { display: none; }
  .sync-indicator { width: 14px; justify-content: center; }
  .user-picker select { max-width: 82px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-heading .mobile-reagent-trigger { width: 100%; justify-content: center; }
  .register-tabs { width: 100%; max-width: 100%; flex-wrap: wrap; overflow: visible; position: sticky; top: 60px; z-index: 20; }
  .register-tabs::-webkit-scrollbar { display: none; }
  .register-tab { flex: 1 1 calc(33.333% - 6px); min-height: 40px; padding: 8px 9px; text-align: center; }
  .system-grid { grid-template-columns: 1fr; }
  .system-grid .danger-panel { grid-column: auto; }
  .panel-header { align-items: flex-start; flex-wrap: wrap; }
  .panel-body { padding: 12px; }
  .inline-form { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .inline-form .field { min-width: 0; width: 100%; }
  .inline-form button { width: 100%; min-height: 44px; }
  .table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 680px; }
  .table-actions { min-width: 115px; }
  .table-actions button { min-height: 38px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card, .modal-card.small, .modal-card:has(.media-import-layout), .modal-card:has(.import-packages) { width: 100%; max-height: calc(100dvh - 8px); border-radius: 20px 20px 0 0; }
  .modal-header { padding: 12px 13px; }
  .modal-body { padding: 12px 13px; }
  .modal-footer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .modal-footer button { min-height: 44px; flex: 1 1 135px; }
  .field input, .field select, .field textarea { font-size: 16px; min-height: 44px; }
  .media-import-layout { display: block; }
  .media-document-panel { margin-bottom: 13px; }
  .media-preview-grid { max-height: 31vh; }
  .media-preview-card img { max-height: 29vh; }
  .media-preview-card object { height: 29vh; min-height: 220px; }
  .local-ai-box { align-items: flex-start; }
  .bottom-nav { overflow: hidden; }
  .bottom-nav button { min-width: 0; overflow: hidden; padding: 2px 1px; }
  .bottom-nav button span:last-child { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fab { z-index: 85; }
  .note-top { display: block; }
  .note-actions { margin-top: 10px; flex-wrap: wrap; }
  .note-actions button { flex: 1 1 90px; }
}
@media (max-width: 380px) {
  .brand-title { max-width: 135px; font-size: 12px; }
  .user-picker { max-width: 90px; }
  .user-picker select { max-width: 66px; }
  .status-grid { grid-template-columns: 1fr; }
  .report-controls { grid-template-columns: 1fr; }
  .vials-grid { grid-template-columns: 1fr; }
  .bottom-nav { left: 4px; right: 4px; padding: 4px 2px; }
  .bottom-nav button { font-size: 6.5px; }
}


/* Typography hierarchy tuned for calmer, more readable UI */
body, input, select, textarea, button {
  font-weight: 400;
}
h1, h2, h3, .page-title, .modal-card > h3, .brand-title {
  font-weight: 700;
}
.section-title, .card-title, .panel-title, .tree-head-name,
.tab.active, .nav-item.active, .dock-item.active {
  font-weight: 600;
}
label, th, .section-label, .form-section-title, .badge, .status,
.btn, button, .tree-head, .category-row, .reagent-name {
  font-weight: 600;
}
td, .muted, .meta, .subtitle, .form-help, .reagent-code,
.tree-empty, .note-body, .lot-meta, .vial-meta {
  font-weight: 400;
}
strong, b {
  font-weight: 600;
}

/* RC4 template-aware historical import */
.import-advanced { border: 1px dashed #c9d5e4; border-radius: 10px; padding: 9px 11px; background: #f8fbff; }
.import-advanced summary { cursor: pointer; color: #34506f; font-weight: 600; }
.compact-grid { margin-top: 9px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.import-package-preview-wrap { padding: 10px 12px 0; background: #fff; }
.import-package-preview { display: block; width: 100%; max-height: 260px; object-fit: contain; border: 1px solid #d7e0eb; border-radius: 9px; background: #edf2f7; }
.cell-preview-thumb { display: block; width: 190px; max-width: 26vw; height: 52px; object-fit: contain; border: 1px solid #d7e0eb; border-radius: 7px; background: #f1f5f9; }
.import-vials-table th:nth-child(2), .import-vials-table td:nth-child(2) { min-width: 210px; }
@media (max-width: 640px) {
  .compact-grid { grid-template-columns: 1fr 1fr; }
  .import-package-preview { max-height: 190px; }
  .cell-preview-thumb { width: 150px; max-width: none; height: 46px; }
}

/* RC5: interaktivna opozorila zaloge in rokov + sortiranje poročil */
.dashboard-status-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
.status-card { width: 100%; text-align: left; font-family: inherit; color: inherit; }
.status-card.clickable { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.status-card.clickable:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(25,48,78,.10); border-color: #b8c9df; }
.status-card.selected { box-shadow: 0 0 0 2px currentColor inset, var(--shadow-sm); }
.dashboard-alert-panel { margin-bottom: 12px; border-color: #cad8ea; }
.alert-panel-actions { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.alert-panel-actions select { min-height:34px; border:1px solid var(--line); border-radius:9px; background:white; padding:6px 9px; color:#425169; font-size:10px; }
.alert-table tbody tr[data-alert-reagent] { cursor:pointer; }
.alert-table tbody tr[data-alert-reagent]:hover td { background:#eef5ff !important; }
.table-subtext { margin-top:2px; color:#8491a3; font-size:8px; line-height:1.3; }
.alert-row.warning td, .report-warning td { background:#fff9e9; }
.alert-row.danger-soft td, .report-danger td { background:#fff0f2; }
.alert-row.danger td { background:#ffe5e9; }
.report-warning:hover td { background:#fff4d6 !important; }
.report-danger:hover td { background:#ffe4e8 !important; }
.alert-pill { display:inline-flex; align-items:center; max-width:100%; border-radius:999px; padding:4px 7px; font-size:8px; font-weight:600; white-space:nowrap; }
.alert-pill.warning { background:#fff0c7; color:#8d5b00; }
.alert-pill.danger { background:#ffdce2; color:#a1283b; }
.stock-number { font-size:12px; font-weight:600; }
.stock-number.low { color:var(--red); }
.stock-meter { width:90px; max-width:100%; height:7px; border-radius:999px; background:#edf1f6; overflow:hidden; }
.stock-meter span { display:block; height:100%; min-width:3px; border-radius:inherit; }
.stock-meter.low span { background:var(--red); }
.stock-meter.ok span { background:var(--green); }

.report-table thead { position:sticky; top:0; z-index:3; }
.report-sort-button { width:100%; display:flex; align-items:center; justify-content:space-between; gap:5px; border:0; padding:0; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; white-space:nowrap; }
.report-sort-button:hover { color:var(--blue); }
.report-sort-button span { color:#8190a3; font-size:8px; }
.report-filter-row th { background:#f8fafc; padding:5px 6px; }
.report-filter-row input { width:100%; min-width:74px; height:28px; border:1px solid #d9e2ed; border-radius:7px; background:white; padding:4px 6px; color:#4e5d72; font-size:8px; font-weight:400; outline:none; }
.report-filter-row input:focus { border-color:#9bbcf0; box-shadow:0 0 0 2px rgba(15,91,215,.08); }
.inline-alert-filter { display:inline-flex; align-items:center; gap:5px; margin-left:10px; color:#7a5413; font-weight:600; white-space:nowrap; }
.inline-alert-filter input { accent-color:var(--red); }
.report-table td:nth-last-child(-n+3) { white-space:nowrap; }

.reagent-button.low-stock .stock-pill { background:var(--red-soft); color:var(--red); }
.reagent-button.low-stock:not(.active) .reagent-title { color:#a93245; }

@media (max-width: 1320px) {
  .dashboard-status-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 821px) {
  .content-area > .panel, .content-area .panel, .content-area .report-controls { width: 100%; }
  .page-heading { margin-bottom: 16px; }
  .desktop-nav { justify-self: center; }
}
@media (min-width: 1440px) {
  .page-heading h1 { font-size: 24px; }
  .panel-body { padding: 16px; }
  .report-controls { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1120px) {
  .dashboard-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .dashboard-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-alert-panel .panel-header { align-items:stretch; }
  .alert-panel-actions { width:100%; }
  .alert-panel-actions select { flex:1; min-height:40px; font-size:11px; }
  .alert-panel-actions button { min-height:40px; }
  .alert-table { min-width:720px !important; }
  .report-table { min-width:980px !important; }
  .report-filter-row input { height:34px; font-size:10px; }
  .inline-alert-filter { display:flex; margin:7px 0 0; }
}
@media (max-width: 380px) {
  .dashboard-status-grid { grid-template-columns:1fr; }
}

/* RC6 notification center, connection safety, FEFO */
.notification-center { position: relative; }
.notification-button { position: relative; }
.notification-badge { position:absolute; right:-5px; top:-5px; min-width:17px; height:17px; padding:0 4px; border-radius:999px; background:#c9344b; color:#fff; border:2px solid #fff; display:flex; align-items:center; justify-content:center; font-size:8px; font-weight:600; line-height:1; }
.notification-panel { position:absolute; right:0; top:calc(100% + 9px); width:310px; z-index:90; background:#fff; border:1px solid var(--line); border-radius:13px; box-shadow:0 16px 42px rgba(15,31,52,.18); padding:8px; }
.notification-panel-head { padding:7px 9px 9px; border-bottom:1px solid var(--line); margin-bottom:5px; }
.notification-panel-head strong { display:block; font-size:12px; color:#1c2a3c; }
.notification-panel-head div div { font-size:9px; color:#7a8798; margin-top:2px; }
.notification-row { width:100%; border:0; background:transparent; display:flex; align-items:center; justify-content:space-between; padding:9px 10px; border-radius:9px; color:#425169; font-family:inherit; font-size:10px; cursor:pointer; }
.notification-row:hover { background:#f4f7fb; }
.notification-row strong { min-width:26px; text-align:center; padding:3px 6px; border-radius:999px; background:#edf2f7; }
.notification-row.danger strong { color:#a92d43; background:#ffe5e9; }
.notification-row.warning strong { color:#8b5a00; background:#fff0c7; }
.connection-banner { max-width:none; width:auto; margin:8px var(--page-gutter) 0; border-radius:11px; padding:9px 12px; border:1px solid; display:flex; align-items:center; justify-content:space-between; gap:10px; font-size:10px; line-height:1.4; }
.connection-banner.warning { background:#fff8e5; color:#775000; border-color:#efd28e; }
.connection-banner.danger { background:#fff0f2; color:#8d2436; border-color:#edb5bf; }
.connection-actions { display:flex; gap:7px; flex-wrap:wrap; flex-shrink:0; }
.alert-summary-intro { color:#5c697a; font-size:10px; line-height:1.5; margin-bottom:12px; }
.alert-summary-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.alert-summary-card { border:1px solid var(--line); border-radius:11px; background:#fff; padding:12px; text-align:left; cursor:pointer; font-family:inherit; }
.alert-summary-card span { display:block; color:#68778b; font-size:9px; margin-bottom:5px; }
.alert-summary-card strong { display:block; font-size:22px; font-weight:700; color:#203047; }
.alert-summary-card.danger { background:#fff3f5; border-color:#f0c4cb; }
.alert-summary-card.danger strong { color:#b52f45; }
.alert-summary-card.warning { background:#fff9ea; border-color:#f0daa8; }
.alert-summary-card.warning strong { color:#9b6708; }
.lot-card.recommended { border-color:#91b5ef; box-shadow:0 0 0 1px #d2e1f8 inset,var(--shadow-sm); }
.status-badge.fefo { background:#e8f1ff; color:#1d5cc4; }
.open-vial-button.secondary-open { background:#eef3f8; color:#425169; border:1px solid #d2dde9; }
.open-vial-button.blocked { background:#f3f4f6; color:#9a6a72; border:1px solid #e8c5cb; cursor:not-allowed; }
.vial-card.expired-vial { background:#fff7f8; border-color:#edc6cd; }
.sync-indicator.conflict { color:#a82d42; }
.sync-indicator.conflict .sync-dot { background:#c9344b; }

@media (max-width: 720px) {
  .notification-panel { position:fixed; left:10px; right:10px; top:62px; width:auto; max-height:calc(100dvh - 150px); overflow:auto; }
  .connection-banner { width:calc(100% - 20px); margin-top:7px; display:block; font-size:10px; }
  .connection-actions { margin-top:8px; }
  .connection-actions button { min-height:38px; }
  .alert-summary-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width: 380px) {
  .alert-summary-grid { grid-template-columns:1fr; }
}

.notification-scrim { position:fixed; inset:0; z-index:65; border:0; padding:0; margin:0; background:transparent; cursor:default; }

/* RC7 – interaction polish + power-user reports */
:where(button, input, select, textarea, [tabindex]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15,91,215,.16), 0 0 0 1px rgba(15,91,215,.28) inset;
}
:where(button, .reagent-button, .category-button, .analyzer-head, .filter-chip, .register-tab, .nav-button) {
  -webkit-tap-highlight-color: transparent;
}
.primary-button, .secondary-button, .danger-button, .ghost-button, .icon-button,
.nav-button, .register-tab, .filter-chip, .reagent-button, .category-button, .analyzer-head {
  transition: background-color .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.primary-button:hover:not(:disabled), .secondary-button:hover:not(:disabled), .danger-button:hover:not(:disabled),
.icon-button:hover:not(:disabled), .filter-chip:hover:not(:disabled), .register-tab:hover:not(:disabled) {
  transform: translateY(-1px);
}
button:active:not(:disabled) { transform: translateY(0); }
button:disabled, input:disabled, select:disabled, textarea:disabled {
  opacity: .48;
  cursor: not-allowed;
  filter: grayscale(.18);
}
.reagent-button:hover:not(.active) { background:#eef4fb; color:#213c67; }
.reagent-button:hover .stock-pill { box-shadow:0 0 0 2px rgba(15,91,215,.08); }
.reagent-button.active { box-shadow: inset 3px 0 0 var(--blue); background:#e8f1ff; }
.category-button:hover:not(.active), .analyzer-head:hover:not(.active) { background:#eef3f9; }
.lot-card { transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.lot-card:hover { border-color:#bdcde1; box-shadow:0 7px 20px rgba(27,47,74,.09); }
.lot-card.recommended:hover { border-color:#6e9fe9; }
.vial-card { transition:border-color .14s ease, background-color .14s ease, box-shadow .14s ease; }
.vial-card:hover { border-color:#b9cbe0; box-shadow:0 4px 12px rgba(28,53,84,.07); }
.toolbar input:hover, .toolbar select:hover, .field input:hover, .field select:hover, .field textarea:hover,
.report-filter-row input:hover { border-color:#b8c8db; }
.data-table tbody tr { transition:background-color .12s ease, box-shadow .12s ease; }
.data-table tbody tr:hover td { background:#f3f7fc; }
.data-table tbody tr:hover { box-shadow:inset 3px 0 0 #9bbcf0; }

.saved-views { display:flex; align-items:center; gap:10px; margin:0 0 10px; padding:9px 11px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.saved-views-label { flex:0 0 auto; color:#5d6b80; font-size:10px; font-weight:600; }
.saved-view-list { display:flex; flex-wrap:wrap; gap:6px; min-width:0; }
.saved-view-chip, .saved-view-custom { border:1px solid #d8e2ee; border-radius:999px; background:#f8fafc; color:#526178; min-height:30px; }
.saved-view-chip { padding:5px 10px; font-size:9px; font-weight:600; }
.saved-view-chip:hover { background:#eef4fb; border-color:#bfd2ea; color:#315d98; }
.saved-view-chip.active { background:var(--blue-soft); border-color:#9fbfee; color:var(--blue); box-shadow:inset 0 0 0 1px rgba(15,91,215,.06); }
.saved-view-chip.add { border-style:dashed; background:#fff; }
.saved-view-custom { display:inline-flex; align-items:center; overflow:hidden; }
.saved-view-custom > button:first-child { border:0; background:transparent; padding:5px 8px 5px 10px; color:inherit; font-size:9px; font-weight:600; }
.saved-view-custom.active { background:var(--blue-soft); border-color:#9fbfee; color:var(--blue); }
.saved-view-delete { width:25px; align-self:stretch; border:0; border-left:1px solid #d8e2ee; background:transparent; color:#8794a6; }
.saved-view-delete:hover { background:#ffecef; color:var(--red); }

.report-panel-header { align-items:center; }
.report-table-tools { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.density-toggle { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:9px; background:#f2f5f9; }
.density-toggle button { border:0; border-radius:6px; padding:5px 8px; background:transparent; color:#68768a; font-size:9px; font-weight:600; }
.density-toggle button:hover { color:#294f82; }
.density-toggle button.active { background:#fff; color:var(--blue); box-shadow:0 1px 4px rgba(25,44,70,.1); }
.report-table-wrap { padding:0 !important; max-height:calc(100vh - 330px); min-height:260px; border-radius:0 0 14px 14px; }
.report-table { border-collapse:separate !important; border-spacing:0; min-width:1080px; }
.report-table thead { position:static; }
.report-table thead th { position:sticky; z-index:8; border-bottom:1px solid #d6e0eb; background:#edf2f8; }
.report-table thead tr:first-child th { top:0; }
.report-table thead tr.report-filter-row th { top:35px; z-index:9; background:#f8fafc; }
.report-table th, .report-table td { border-right:1px solid #eef2f6; }
.report-table th:last-child, .report-table td:last-child { border-right:0; }
.report-table tbody tr:nth-child(even):not(.report-danger):not(.report-warning) td { background:#fbfcfe; }
.report-table tbody tr:hover td { background:#edf5ff !important; }
.report-table .report-sort-button.active { color:var(--blue); }
.report-table .report-sort-button.active span { color:var(--blue); }
.report-table.density-compact th { padding:6px 7px; }
.report-table.density-compact td { padding:5px 7px; font-size:9px; line-height:1.3; }
.report-table.density-compact thead tr.report-filter-row th { top:29px; padding:4px 5px; }
.report-table.density-compact .report-filter-row input { height:25px; }
.report-table.density-comfortable th { padding:10px 9px; }
.report-table.density-comfortable td { padding:10px 9px; font-size:10px; line-height:1.45; }
.report-table.density-comfortable thead tr.report-filter-row th { top:39px; }

/* Freeze the two left columns on desktop power tables. */
@media (min-width: 821px) {
  .report-table th:nth-child(1), .report-table td:nth-child(1) { position:sticky; left:0; min-width:180px; max-width:220px; z-index:5; }
  .report-table th:nth-child(2), .report-table td:nth-child(2) { position:sticky; left:180px; min-width:130px; max-width:170px; z-index:5; box-shadow:1px 0 0 #dfe7f0; }
  .report-table thead th:nth-child(1), .report-table thead th:nth-child(2) { z-index:13; background:#edf2f8; }
  .report-table thead tr.report-filter-row th:nth-child(1), .report-table thead tr.report-filter-row th:nth-child(2) { z-index:14; background:#f8fafc; }
  .report-table tbody td:nth-child(1), .report-table tbody td:nth-child(2) { background:#fff; }
  .report-table tbody tr:nth-child(even):not(.report-danger):not(.report-warning) td:nth-child(1),
  .report-table tbody tr:nth-child(even):not(.report-danger):not(.report-warning) td:nth-child(2) { background:#fbfcfe; }
  .report-table tbody tr:hover td:nth-child(1), .report-table tbody tr:hover td:nth-child(2) { background:#edf5ff !important; }
  .report-table tbody tr.report-danger td:nth-child(1), .report-table tbody tr.report-danger td:nth-child(2) { background:#fff1f3 !important; }
  .report-table tbody tr.report-warning td:nth-child(1), .report-table tbody tr.report-warning td:nth-child(2) { background:#fff9e9 !important; }
}
.report-danger td { background:#fff1f3 !important; color:#7f2837; }
.report-warning td { background:#fff9e9 !important; color:#6e531d; }
.expiry-cell { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.expiry-cell .status-dot { width:7px; height:7px; border-radius:50%; flex:0 0 auto; }
.expiry-cell.ok .status-dot { background:var(--green); box-shadow:0 0 0 3px rgba(22,135,92,.1); }
.expiry-cell.warning .status-dot { background:var(--amber); box-shadow:0 0 0 3px rgba(229,138,0,.11); }
.expiry-cell.danger .status-dot { background:var(--red); box-shadow:0 0 0 3px rgba(212,59,80,.1); }
.days-pill { display:inline-flex; align-items:center; border-radius:999px; padding:3px 7px; font-size:8px; font-weight:600; white-space:nowrap; }
.days-pill.ok { color:#18724f; background:#e9f7f0; }
.days-pill.warning { color:#8b5a00; background:#fff1c9; }
.days-pill.danger { color:#a72f43; background:#ffe7eb; }
.report-stock-cell { min-width:105px; }
.report-stock-cell > div:first-child { display:flex; align-items:baseline; gap:2px; white-space:nowrap; }
.report-stock-cell strong { font-size:11px; color:#26354a; }
.report-stock-cell strong.stock-low { color:var(--red); }
.report-stock-cell span { color:#7b899c; font-size:8px; }
.report-stock-cell .stock-meter { margin-top:4px; width:100%; }

@media (max-width: 820px) {
  .saved-views { display:block; overflow:hidden; }
  .saved-views-label { display:block; margin-bottom:7px; }
  .saved-view-list { flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; scrollbar-width:none; }
  .saved-view-list::-webkit-scrollbar { display:none; }
  .saved-view-chip, .saved-view-custom { flex:0 0 auto; }
  .report-panel-header { align-items:stretch; }
  .report-table-tools { width:100%; justify-content:space-between; }
  .report-table-wrap { max-height:none; }
  .report-table th:nth-child(1), .report-table th:nth-child(2), .report-table td:nth-child(1), .report-table td:nth-child(2) { position:static !important; left:auto !important; }
}

/* Header brand CTA: visually clean, still clickable and keyboard accessible */
.brand-button,
.brand-button:hover,
.brand-button:active,
.brand-button:focus,
.brand-button:focus-visible {
  -webkit-appearance: none !important;
  appearance: none !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.brand-button:focus-visible .brand-icon {
  box-shadow: 0 0 0 3px rgba(15,91,215,.16), 0 7px 18px rgba(15,91,215,.24);
}

/* RC10: compact, collapsible consumed LOT history */
.consumed-lots-section {
  margin-top: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 13px;
  background: #f8fafc;
  overflow: hidden;
}
.consumed-section-toggle {
  width: 100%;
  min-height: 58px;
  padding: 10px 13px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: background .15s ease;
}
.consumed-section-toggle:hover { background: #f1f5f9; }
.consumed-section-toggle:focus-visible { outline: 3px solid rgba(27,99,218,.22); outline-offset: -3px; }
.consumed-section-toggle strong { display: block; font-size: 12px; }
.consumed-section-toggle small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 500; }
.consumed-section-chevron,
.consumed-lot-chevron {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #667b91;
  font-size: 22px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .15s ease;
}
.consumed-lots-section.open > .consumed-section-toggle .consumed-section-chevron { transform: rotate(90deg); }
.consumed-section-count {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7edf5;
  color: #52677f;
  font-size: 10px;
  font-weight: 800;
}
.consumed-lots-list {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
  border-top: 1px solid #e6ecf3;
}
.consumed-lot-card {
  margin-top: 7px;
  border: 1px solid #e0e7ef;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.consumed-lot-card:hover { border-color: #c8d5e4; }
.consumed-lot-row {
  display: flex;
  align-items: stretch;
  min-height: 52px;
}
.consumed-lot-summary {
  min-width: 0;
  flex: 1 1 auto;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 7px;
  align-items: center;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: background .15s ease;
}
.consumed-lot-summary:hover { background: #f8fafc; }
.consumed-lot-summary:focus-visible { outline: 3px solid rgba(27,99,218,.2); outline-offset: -3px; }
.consumed-lot-card.expanded .consumed-lot-chevron { transform: rotate(90deg); }
.consumed-lot-main { min-width: 0; }
.consumed-lot-main .lot-title-row { margin-bottom: 2px; }
.consumed-lot-main .lot-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.consumed-lot-stock {
  min-width: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  color: var(--muted);
}
.consumed-lot-stock strong { color: var(--text); font-size: 11px; }
.consumed-lot-stock small { margin-top: 1px; font-size: 8px; }
.consumed-lot-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px 7px 4px;
}
.consumed-vials-wrap { border-top: 1px solid #e7edf4; background: #fbfcfe; }
.consumed-vials-grid { padding: 8px; }

@media (max-width: 820px) {
  .consumed-lot-row { display: block; }
  .consumed-lot-actions { padding: 0 9px 8px 38px; }
  .consumed-lot-stock { min-width: 50px; }
  .consumed-lot-main .lot-subtitle { white-space: normal; }
}

/* RC11 · Opomniki odprtih vial */
.vial-reminder-box {
  margin-top: 4px;
  padding: 13px 14px;
  border: 1px solid #d7e3f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
}
.vial-reminder-head { display: grid; gap: 3px; }
.vial-reminder-toggle {
  min-height: 24px;
  color: #22364f;
  cursor: pointer;
  font-weight: 600;
}
.vial-reminder-toggle strong { font-size: 10px; }
.vial-reminder-sub { color: #718198; font-size: 8px; line-height: 1.45; padding-left: 24px; }
.vial-reminder-options {
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid #e4edf7;
}
.vial-reminder-row { display: grid; gap: 8px; }
.vial-reminder-label {
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
}
.vial-reminder-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.reminder-preset {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cad7e6;
  border-radius: 999px;
  background: #fff;
  color: #405570;
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.reminder-preset:hover { border-color: #8fb2e9; background: #f2f7ff; color: #1557b0; transform: translateY(-1px); }
.reminder-preset.active { border-color: #80a9ea; background: #eaf2ff; color: #0d5ccc; box-shadow: inset 0 0 0 1px rgba(13,92,204,.05); }
.reminder-preset:focus-visible { outline: 3px solid rgba(27,99,218,.2); outline-offset: 2px; }
.vial-reminder-days-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}
.reminder-days-input {
  display: grid;
  gap: 5px;
  color: #64748b;
  font-size: 9px;
  font-weight: 700;
}
.reminder-days-label { color: #64748b; font-size: 9px; font-weight: 700; }
.reminder-days-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 3px 10px;
  border: 1px solid #d6e0ec;
  border-radius: 10px;
  background: #fff;
}
.reminder-days-input input {
  width: 92px;
  min-height: 30px;
  padding: 4px 0;
  border: 0;
  box-shadow: none;
  text-align: left;
  background: transparent;
}
.reminder-days-input input:focus { outline: none; box-shadow: none; }
.reminder-days-field span { color: #64748b; font-size: 9px; font-weight: 700; }
.vial-reminder-preview {
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  background: #eaf3ff;
  border: 1px solid #cfe0fb;
  color: #1e5fae;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}
.form-help + .vial-reminder-preview { margin-top: 8px; }
.vial-reminder-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  padding: 2px 5px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2c64aa;
  font-size: 8px;
  font-weight: 700;
}
.vial-reminder-meta.due { background: #fff1cf; color: #8d5d00; }
.vial-card.reminder-focus {
  box-shadow: 0 0 0 3px rgba(27,99,218,.22), 0 8px 24px rgba(30,72,120,.12);
  border-color: #74a6eb;
}
.notification-reminder-list {
  margin: 2px 0 5px;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line);
}
.notification-reminder-item {
  width: 100%;
  border: 0;
  border-radius: 9px;
  background: #fff9ea;
  padding: 8px 9px;
  margin-top: 4px;
  display: grid;
  gap: 3px;
  text-align: left;
  color: #5e4a1d;
  font: inherit;
  font-size: 9px;
  line-height: 1.35;
  cursor: pointer;
}
.notification-reminder-item:hover { background: #fff3d1; }
.notification-reminder-item:focus-visible { outline: 3px solid rgba(27,99,218,.2); outline-offset: 1px; }
.notification-reminder-label {
  color: #9a6700;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .06em;
}
.notification-reminder-more { padding: 7px 9px 2px; color: #7a8798; font-size: 8px; }
.alert-vial-reminders {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.alert-vial-reminders button {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #f0daa8;
  border-radius: 9px;
  background: #fff9ea;
  display: grid;
  gap: 3px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.alert-vial-reminders button:hover { background: #fff4d6; }
.alert-vial-reminders strong { color: #956100; font-size: 8px; letter-spacing: .06em; }
.alert-vial-reminders span { color: #5d4a21; font-size: 9px; line-height: 1.4; }

@media (max-width: 520px) {
  .vial-reminder-presets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .reminder-preset { width: 100%; justify-content: center; }
  .vial-reminder-days-row { grid-template-columns: 1fr; }
  .vial-reminder-preview { width: 100%; min-height: 34px; justify-content: center; white-space: normal; }
  .reminder-days-field { width: 100%; }
  .reminder-days-input input { flex: 1 1 auto; width: auto; }
}

/* RC12 · Namerno odprtje viale po preteku roka */
.open-vial-button.expired-open {
  background: #fff1f2;
  color: #b4233c;
  border: 1px solid #efb8c2;
}
.open-vial-button.expired-open:hover {
  background: #ffe4e8;
  border-color: #df8797;
  color: #9f1730;
}
.expired-vial-warning {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid #efb8c2;
  border-radius: 11px;
  background: #fff5f6;
  color: #7f1d2d;
}
.expired-vial-warning-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #ffe1e6;
  color: #b4233c;
  font-size: 15px;
  font-weight: 800;
}
.expired-vial-warning strong { display: block; font-size: 10px; margin: 1px 0 4px; }
.expired-vial-warning p { margin: 0; font-size: 9px; line-height: 1.55; color: #8d3444; }
.expired-confirm-button { min-width: 124px; }
.toast.warning { background: #9a6500; }

/* RC14 · HITRI TESTI zaporedne številke + QC */
.quick-test-sequence-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  padding: 5px 8px;
  border: 1px solid #d8e6f8;
  border-radius: 8px;
  background: #f6f9fe;
  color: #68788e;
  font-size: 8px;
}
.quick-test-sequence-meta strong { color: #245da9; font-size: 8px; }
.lot-sequence-inline { color: #2a62ad; font-weight: 600; white-space: nowrap; }
.lot-sequence-inline strong { color: #124f9e; font-weight: 800; }
.status-badge.quality-check {
  border: 1px solid #b8d8cc;
  background: #edf8f4;
  color: #167356;
  letter-spacing: .03em;
}
.vial-index:has(.vial-sequence-number) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 24px;
}
.vial-sequence-number {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1758ae;
  font-weight: 800;
}
.vial-position { color: #8995a6; font-weight: 600; }
.readonly-sequence-field {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid #d5e3f5;
  border-radius: 9px;
  background: #f5f9ff;
  color: #1458b0;
  font-size: 12px;
  font-weight: 800;
}
.readonly-sequence-field small {
  color: #74859b;
  font-size: 8px;
  font-weight: 600;
}
.lot-flags-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .55fr);
  gap: 8px;
}
.qc-check-row,
.archive-check-row {
  min-height: 48px;
  padding: 9px 11px;
  border: 1px solid #dce5ee;
  border-radius: 10px;
  background: #fafcfe;
}
.qc-check-row:has(input:checked) {
  border-color: #a9d6c5;
  background: #f0faf6;
}
.qc-check-row span { display: grid; gap: 2px; }
.qc-check-row small { color: #76879a; font-size: 8px; font-weight: 500; line-height: 1.4; }

@media (max-width: 820px) {
  .lot-flags-row { grid-template-columns: 1fr; }
  .quick-test-sequence-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
  .lot-sequence-inline { white-space: normal; }
}

/* RC15.6: vedno vidna kontrola za združevanje LOT-ov v poročilih */
.report-merge-control {
  grid-column: span 2;
  min-height: 58px;
  border: 1px solid #b7cdf2;
  border-radius: 11px;
  background: #f3f7ff;
  padding: 9px 12px;
  display: flex;
  align-items: center;
}
.report-merge-control > label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #253a57;
}
.report-merge-control strong {
  display: block;
  color: #0f5bd7;
  font-size: 11px;
  line-height: 1.25;
}
.report-merge-control small {
  display: block;
  margin-top: 2px;
  color: #63748d;
  font-size: 8px;
  line-height: 1.3;
}
.report-merge-check {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 20px;
}
.report-merge-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.report-merge-check span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd6e5;
  transition: .18s ease;
}
.report-merge-check span::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
  transition: .18s ease;
}
.report-merge-check input:checked + span { background: #0f5bd7; }
.report-merge-check input:checked + span::after { transform: translateX(14px); }
.report-merge-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(15,91,215,.16); }
@media (max-width: 900px) { .report-merge-control { grid-column: 1 / -1; } }


/* RC15.7: enoten toggle za združevanje LOT-ov tudi v Arhivu */
.archive-toolbar .archive-merge-control {
  grid-column: auto;
  flex: 0 1 430px;
  min-width: 330px;
  max-width: 430px;
  margin: 0;
}
@media (max-width: 900px) {
  .archive-toolbar .archive-merge-control {
    flex: 1 1 100%;
    min-width: 100%;
    max-width: none;
    order: 10;
  }
}

/* RC15.8: pravi načini agregacije poročil/izvozov */
.report-group-control {
  grid-column: span 2;
  min-height: 62px;
  border: 1px solid #b7cdf2;
  border-radius: 11px;
  background: #f3f7ff;
  padding: 9px 11px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(150px,190px);
  align-items: center;
  gap: 10px;
  color: #253a57;
}
.report-group-control strong {
  display: block;
  color: #0f5bd7;
  font-size: 11px;
  line-height: 1.25;
}
.report-group-control small {
  display: block;
  margin-top: 3px;
  color: #63748d;
  font-size: 8px;
  line-height: 1.35;
}
.report-group-control select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #a9c1e8;
  border-radius: 9px;
  padding: 0 9px;
  background: #fff;
  color: #173a70;
  font-size: 10px;
  font-weight: 600;
  outline: none;
}
.report-group-control select:focus { border-color:#0f5bd7; box-shadow:0 0 0 3px rgba(15,91,215,.10); }
.report-group-control select:disabled { opacity:.55; cursor:not-allowed; }
.archive-toolbar .archive-group-control {
  flex: 0 1 500px;
  min-width: 390px;
  max-width: 500px;
  margin: 0;
  grid-column: auto;
}
@media (max-width: 900px) {
  .report-group-control { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .archive-toolbar .archive-group-control { flex:1 1 100%; min-width:100%; max-width:none; order:10; }
}


/* RC15.9: fiksna prijavljena seja + revizijska sled posamezne viale */
.session-user { min-height:38px; display:flex; align-items:center; gap:7px; padding:0 11px; border:1px solid var(--line); border-radius:11px; background:#fff; white-space:nowrap; }
.session-user span { font-size:10px; color:var(--muted); }
.session-user strong { font-size:12px; color:var(--text); }
.login-notice { margin:0 0 12px; padding:10px 11px; border:1px solid #cbdcf7; border-radius:9px; background:#eff5ff; color:#2755ad; font-size:11px; line-height:1.4; }
.session-help { margin-top:-3px; margin-bottom:4px; }
.vial-audit-box { margin-top:2px; padding:11px; border:1px solid #d7e2f1; border-radius:11px; background:#f8fbff; }
.vial-audit-title { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:8px; }
.vial-audit-title strong { font-size:11px; color:#1d3f73; }
.vial-audit-title small { max-width:260px; text-align:right; font-size:9px; line-height:1.35; color:var(--muted); }
.vial-audit-list { display:grid; gap:6px; max-height:180px; overflow:auto; }
.vial-audit-entry { padding:8px 9px; border:1px solid #e1e8f2; border-radius:8px; background:#fff; font-size:9px; line-height:1.45; color:#4c5a6c; }
.vial-audit-entry-head { display:flex; justify-content:space-between; gap:8px; margin-bottom:3px; }
.vial-audit-entry-head strong { color:#173b70; }
.vial-audit-entry-head span { color:#758399; font-size:8.5px; text-align:right; }
.vial-audit-empty { padding:9px; color:var(--muted); font-size:9px; text-align:center; }
@media (max-width: 760px) {
  .session-user { min-height:34px; padding:0 8px; max-width:130px; }
  .session-user span { display:none; }
  .session-user strong { overflow:hidden; text-overflow:ellipsis; }
  .vial-audit-title { display:block; }
  .vial-audit-title small { display:block; max-width:none; text-align:left; margin-top:3px; }
  .vial-audit-entry-head { display:block; }
  .vial-audit-entry-head span { display:block; text-align:left; margin-top:2px; }
}


/* RC15.10: JSON orodja pod dodatnim geslom */
.json-tools-lock{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:10px;align-items:end;max-width:520px;margin-top:12px}
.json-tools-lock .primary-button{min-height:42px}
.json-tools-badge{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid #d7deea;border-radius:999px;background:#f6f8fb;color:#64748b;font-size:12px;font-weight:700;white-space:nowrap}
.json-tools-badge.unlocked{background:#ecfdf5;border-color:#a7f3d0;color:#047857}
.json-tools-secondary{margin-top:14px;padding-top:14px;border-top:1px solid #e4eaf2}
.json-tools-error{color:#c62828!important;font-weight:700;margin-top:7px}
@media(max-width:640px){.json-tools-lock{grid-template-columns:1fr}.json-tools-lock .primary-button{width:100%}}
