/* ═══════════════════════════════════════════════════════════════════════
   PrefCard v1.0 — Surgical Steel Design System
   Phone-first design for OR staff with gloves.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    --bg: #080c14;
    --surface: #0f1520;
    --surface-2: #161e2e;
    --surface-3: #1c2640;
    --border: #243049;
    --border-light: #2d3d5c;
    --text: #e8ecf4;
    --text-dim: #94a3b8;
    --text-muted: #64748b;
    --accent: #14b8a6;
    --accent-dim: #0d4f47;
    --accent-glow: rgba(20, 184, 166, 0.15);
    --green: #22c55e;
    --green-dim: #14532d;
    --yellow: #f59e0b;
    --yellow-dim: #78350f;
    --red: #ef4444;
    --red-dim: #7f1d1d;
    --orange: #f97316;
    --purple: #a78bfa;
    --cyan: #22d3ee;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'JetBrains Mono', 'Fira Code', monospace;
    --tap-min: 48px;
    --nav-height: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --top-bar-height: 56px;
    --card-bg: var(--surface);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

/* ── Layout ──────────────────────────────────────────────────────────── */

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.hidden { display: none !important; }

.app-container.no-chrome .main-content {
    padding-top: 0;
    padding-bottom: 0;
    margin: 0;
    max-width: 100%;
}

/* Top Bar */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--top-bar-height);
    padding: 0 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-title {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    cursor: pointer;
    color: var(--accent);
    text-shadow: 0 0 24px var(--accent-glow);
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: capitalize;
}

.hamburger-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    display: none;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-badge-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.15s;
}

.user-badge-info:hover { background: var(--surface-2); }

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar (desktop only) */
.sidebar {
    display: none;
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
}

/* Bottom Nav (mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    transition: color 0.15s;
}

.bottom-nav-btn.active { color: var(--accent); }
.bottom-nav-btn:hover { color: var(--text); }

.bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
}

.bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Camera FAB */
.camera-fab {
    position: relative;
}

.camera-fab-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    color: #fff;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4), 0 0 40px rgba(20, 184, 166, 0.1);
    margin-top: -20px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.camera-fab:hover .camera-fab-inner {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(20, 184, 166, 0.5), 0 0 60px rgba(20, 184, 166, 0.15);
}

.camera-fab .bottom-nav-label { display: none; }

/* ── Stats Bar ───────────────────────────────────────────────────────── */

.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.stat-card .label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.stat-card .value {
    font-size: 24px;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: -1px;
}

.stat-card .value.blue { color: var(--accent); }
.stat-card .value.green { color: var(--green); }
.stat-card .value.purple { color: var(--purple); }
.stat-card .value.cyan { color: var(--cyan); }

.stat-addon {
    display: block;
    font-size: 10px;
    color: var(--red);
    font-weight: 600;
    margin-top: 2px;
}

/* ── Section Header ──────────────────────────────────────────────────── */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.section-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 10px;
}

.search-wrap svg { color: var(--text-muted); flex-shrink: 0; }

.search-input {
    padding: 8px 0;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font);
    width: 120px;
    outline: none;
}

.filter-select {
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 12px;
    font-family: var(--font);
    cursor: pointer;
}

/* ── Card Grid & Tiles ───────────────────────────────────────────────── */

.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.pref-card-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    position: relative;
    overflow: hidden;
}

.pref-card-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.pref-card-tile:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(20, 184, 166, 0.08); }
.pref-card-tile:hover::before { opacity: 1; }
.pref-card-tile:active { transform: scale(0.98); }

.tile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tile-uses {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--mono);
}

.procedure-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 2px;
    line-height: 1.3;
}

.surgeon-name {
    font-size: 13px;
    color: var(--text-dim);
}

.card-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.dept-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dept-badge.ortho { background: var(--accent-dim); color: var(--accent); }
.dept-badge.ent { background: var(--green-dim); color: var(--green); }
.dept-badge.general { background: var(--yellow-dim); color: var(--yellow); }
.dept-badge.plastics { background: #2e1065; color: var(--purple); }
.dept-badge.spine { background: #083344; color: var(--cyan); }
.dept-badge.cardio { background: var(--red-dim); color: #fca5a5; }
.dept-badge.vascular { background: #451a03; color: #fdba74; }
.dept-badge.urology { background: #1e1b4b; color: #818cf8; }
.dept-badge.obgyn { background: #831843; color: #f9a8d4; }
.dept-badge.ophtho { background: #064e3b; color: #6ee7b7; }

/* ═══════════════════════════════════════════════════════════════════════
   BINDER CARD VIEW
   ═══════════════════════════════════════════════════════════════════════ */

.card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.binder-card {
    background: #fefefe;
    color: #1a1a1a;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    font-family: Arial, 'Helvetica Neue', sans-serif;
    font-size: 12.5px;
    line-height: 1.4;
}

.binder-card .card-title {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.binder-card .card-subtitle {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 4px;
}

.team-gloves { font-size: 11px; font-weight: 700; }
.team-gloves .member { margin-bottom: 2px; }
.update-info { text-align: right; font-size: 10px; color: #666; }
.cerner-ref { font-size: 9px; color: #999; font-style: italic; }

/* Desktop binder columns */
.binder-columns {
    display: none;
}

/* Mobile section swiper */
.section-swiper {
    margin-bottom: 12px;
}

.swiper-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    scrollbar-width: none;
}

.swiper-track::-webkit-scrollbar { display: none; }

.swiper-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    padding: 0 4px;
}

.swiper-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.dot.active { background: var(--accent); }

/* Binder sections */
.binder-section { margin-bottom: 10px; }

.binder-section .section-title {
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    border-bottom: 1px solid #ccc;
    padding-bottom: 3px;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.binder-section .section-title.red { color: #c00; }

.item-list { list-style: none; }

.item-list li {
    padding: 3px 0;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
}

.item-list li .catalog { color: #888; font-size: 10px; }
.ref-num { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: #0369a1; background: #e0f2fe; padding: 1px 5px; border-radius: 3px; margin-left: 4px; white-space: nowrap; }
.item-link { color: var(--accent); text-decoration: none; border-bottom: 1px dotted var(--accent); }
.item-link:hover, .item-link:active { color: var(--green); border-color: var(--green); }
.item-aka { font-size: 0.75rem; color: #8b5cf6; font-style: italic; margin-left: 4px; }
.nick-add-btn { background: none; border: none; color: #64748b; cursor: pointer; padding: 0 2px; vertical-align: middle; opacity: 0.4; transition: opacity 0.2s; }
.nick-add-btn:hover { opacity: 1; color: #8b5cf6; }
.item-list li.hold-item { color: #b45309; font-weight: 600; }
.item-thumb { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; margin-right: 6px; vertical-align: middle; border: 1px solid #e2e8f0; flex-shrink: 0; }
.item-list li { display: flex; align-items: center; }

/* Item card layout — two-line for mobile, inline for desktop */
.item-card {
    flex-wrap: wrap;
    cursor: pointer;
    padding: 8px 4px;
    border-radius: 6px;
    transition: background 0.15s;
    gap: 4px;
}
.item-card:active { background: var(--surface-2, #f1f5f9); }
.item-card-top {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.item-card-top .item-name-clickable {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.item-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Edit mode */
.binder-card.edit-mode { border: 2px dashed #3b82f6; }

.item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
    border-radius: 3px;
    transition: background 0.1s;
    min-height: var(--tap-min);
}

.item-row:hover { background: #f0f0f0; }
.item-text { flex: 1; font-size: 12px; }

.item-actions {
    display: flex;
    gap: 4px;
}

.item-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.item-btn.edit { background: #e0e7ff; color: #3b82f6; }
.item-btn.edit:hover { background: #3b82f6; color: #fff; }
.item-btn.delete { background: #fee2e2; color: #ef4444; }
.item-btn.delete:hover { background: #ef4444; color: #fff; }

.section-add-btn {
    width: 24px;
    height: 24px;
    border: 1px dashed #999;
    border-radius: 4px;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.section-add-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #e0e7ff; }

/* Hold tag */
.hold-tag { color: #b45309 !important; font-weight: 600; font-size: 10px; }
.hold-tag-sm { color: var(--orange); font-size: 10px; font-weight: 600; }

/* Bin location */
.bin-loc {
    display: inline-block;
    background: #e8f4ff;
    color: #1e40af;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--mono);
    margin-left: 4px;
    vertical-align: middle;
}

/* ── Notes Panel ─────────────────────────────────────────────────────── */

.binder-notes {
    background: #f8f8f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px 12px;
    margin-top: 10px;
}

.binder-notes .notes-title {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.note-item {
    padding: 4px 0;
    font-size: 12px;
    position: relative;
}

.note-item.warning {
    color: #c00;
    font-weight: 700;
    border-left: 3px solid #c00;
    padding-left: 8px;
}

.note-author, .note-meta {
    font-size: 10px;
    color: #999;
    margin-left: 8px;
}

.note-delete {
    position: absolute;
    right: 0;
    top: 2px;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

/* Note tabs */
.note-tabs-panel {
    margin-top: 10px;
    background: #f8f8f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.note-tabs-bar {
    display: flex;
    border-bottom: 1px solid #ddd;
    overflow-x: auto;
    scrollbar-width: none;
}

.note-tabs-bar::-webkit-scrollbar { display: none; }

.note-tab {
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.note-tab.active { color: #000; border-bottom-color: var(--accent); }
.note-tab:hover { color: #333; }

.note-count {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    padding: 0 5px;
    border-radius: 8px;
    margin-left: 4px;
}

.note-tab-content { padding: 10px 12px; }
.note-tab-desc { font-size: 10px; color: #999; margin-bottom: 6px; font-style: italic; }
.note-empty { font-size: 12px; color: #999; padding: 8px 0; }

.note-add-form { margin-top: 8px; border-top: 1px solid #ddd; padding-top: 8px; }

.note-add-form textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--font);
    resize: vertical;
    color: #333;
    background: #fff;
}

.note-add-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.note-warning-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #666;
    cursor: pointer;
}

/* ── Suggestions Panel ───────────────────────────────────────────────── */

.suggestions-panel {
    background: var(--surface);
    border: 1px solid var(--yellow-dim);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.suggestions-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--yellow);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.suggestion-item {
    padding: 8px;
    background: var(--surface-2);
    border-radius: 6px;
    margin-bottom: 6px;
}

.suggestion-type {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.suggestion-text { font-size: 13px; display: block; margin: 4px 0; }

.suggestion-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

/* ── Pull Board ──────────────────────────────────────────────────────── */

.pull-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.pull-board-header h2 { font-size: 18px; }

.pull-date-label { font-size: 13px; color: var(--text-dim); }
.pull-stat { font-size: 12px; color: var(--green); font-weight: 600; }

.date-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.case-list { display: flex; flex-direction: column; gap: 6px; }

.case-block { margin-bottom: 4px; }

.case-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.15s;
    min-height: var(--tap-min);
}

.case-row:hover { border-color: var(--accent); }

.case-block .case-row:has(+ .pull-detail[style*="block"]) {
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.case-time {
    font-size: 14px;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent);
    min-width: 50px;
}

.case-info { flex: 1; min-width: 0; }
.case-procedure { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-surgeon { font-size: 11px; color: var(--text-dim); }

.case-room {
    background: var(--surface-3);
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.addon-block .case-row { border-left: 3px solid var(--red); }

.expand-arrow {
    color: var(--text-muted);
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Status badges */
.status-badge {
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.pending { background: var(--surface-3); color: var(--text-muted); }
.status-badge.in_progress { background: var(--yellow-dim); color: var(--yellow); }
.status-badge.pulled { background: var(--green-dim); color: var(--green); }
.status-badge.partial { background: var(--yellow-dim); color: var(--orange); }
.status-badge.addon { background: var(--red-dim); color: var(--red); }

/* Pull detail */
.pull-detail {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 10px 10px;
    padding: 12px;
    animation: slideDown 0.2s ease-out;
}

.pull-loading { color: var(--text-muted); font-size: 13px; }

.pull-progress-bar-wrap {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.pull-progress-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.pull-progress-info strong { color: var(--green); }
.pull-progress-info a { color: var(--accent); text-decoration: none; margin-left: auto; font-size: 11px; }
.unavail-count { color: var(--yellow); font-weight: 600; }

.pull-progress-track { width: 100%; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.pull-progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }

.pull-checklist { columns: 1; }

.pull-section { break-inside: avoid; margin-bottom: 8px; }

.pull-section-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    margin-bottom: 3px;
}

.pull-section-title.red { color: var(--red); }

.pull-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 6px;
    border-radius: 4px;
    min-height: var(--tap-min);
}

.pull-item:hover { background: var(--surface-2); }
.pull-item.pulled .pull-item-name { color: var(--text-muted); text-decoration: line-through; }
.pull-item.unavailable { background: rgba(234, 179, 8, 0.08); }
.pull-item.unavailable .pull-item-name { color: var(--yellow); }

.pull-item-name { font-size: 12px; }

/* Pull checkboxes — glove-friendly 48px */
.pull-check {
    width: var(--tap-min);
    height: var(--tap-min);
    border: 2px solid var(--border-light);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    font-size: 18px;
    font-weight: 700;
}

.pull-check:hover { border-color: var(--accent); background: rgba(59, 130, 246, 0.1); }

.pull-check.pulled {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.pull-check.pulled::after { content: '✓'; }

.pull-check.unavailable {
    background: var(--yellow);
    border-color: var(--yellow);
    color: #000;
}

.pull-check.unavailable::after { content: '!'; }

.pull-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pull-item-subtitle {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.pull-info-hint {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    opacity: 0.5;
}

.pull-item { position: relative; }

.pull-product-profile {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
}

.pull-product-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    flex-shrink: 0;
}

.pull-product-details {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pull-product-details .ppf-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-right: 6px;
    display: inline-block;
    min-width: 40px;
}

.pull-product-details code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: var(--surface);
    padding: 1px 4px;
    border-radius: 3px;
}

.pull-product-link {
    font-size: 11px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.pull-item.pulled .pull-item-subtitle { color: var(--text-muted); opacity: 0.6; }
.pull-item.pulled .pull-info-hint { opacity: 0.3; }

.debrief-btn { margin-top: 12px; width: 100%; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: var(--tap-min);
}

.btn-sm { padding: 6px 12px; font-size: 12px; min-height: 36px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0d9488; }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-back {
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.btn-back:hover { color: var(--text); }

/* ── Modal ───────────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    padding: 20px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    animation: slideUp 0.25s ease-out;
}

.modal h3 { font-size: 16px; margin-bottom: 12px; }
.modal-hint { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }

.modal label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
    margin-top: 10px;
}

.modal input, .modal select, .modal textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    min-height: 42px;
}

.modal textarea { min-height: 60px; resize: vertical; }

.modal .modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.form-row { display: flex; gap: 10px; }
.form-col { flex: 1; }

/* ── Auth Screens ────────────────────────────────────────────────────── */

.auth-container {
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.auth-container h2 { font-size: 22px; margin-bottom: 8px; }
.auth-subtitle { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.auth-switch { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; }
.auth-switch a { color: var(--accent); text-decoration: none; }

.auth-container label {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
    margin-top: 12px;
}

.auth-container input, .auth-container select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    min-height: 44px;
}

.auth-buttons { display: flex; gap: 10px; margin-top: 16px; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 12px;
    color: var(--text-muted);
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Facility Search */
.facility-search-wrap { position: relative; }
.facility-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface-2);
    border: 1px solid var(--border-light);
    border-radius: 0 0 8px 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.facility-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}
.facility-result-item:hover { background: var(--surface-3); }
.facility-result-item:last-child { border-bottom: none; }
.facility-result-name { font-size: 13px; font-weight: 600; color: var(--text); }
.facility-result-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.facility-picker-row {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    border-radius: 6px;
    transition: background 0.1s;
}
.facility-picker-row:hover { background: var(--surface-2); }
.facility-picker-name { font-size: 13px; font-weight: 600; }
.facility-picker-loc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.facility-selected {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 8px;
    margin-top: 6px;
}
.facility-selected-name { font-size: 13px; font-weight: 600; color: var(--accent); }
.facility-selected-loc { font-size: 11px; color: var(--text-dim); }
.btn-link { background: none; border: none; cursor: pointer; font-family: var(--font); text-decoration: underline; }

/* PIN pad */
.pin-pad-container { margin-top: 8px; }

.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-light);
    transition: all 0.15s;
}

.pin-dot.filled { background: var(--accent); border-color: var(--accent); }

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 260px;
    margin: 0 auto;
}

.pin-key {
    height: 56px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    font-size: 22px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-key:hover { background: var(--surface-3); }
.pin-key:active { transform: scale(0.95); background: var(--accent-dim); }
.pin-key.empty { border: none; background: transparent; cursor: default; }

/* ── Profile ─────────────────────────────────────────────────────────── */

.profile-card {
    max-width: 400px;
    margin: 20px auto;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: center;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.profile-role {
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 4px 0;
}

.profile-facility {
    font-size: 13px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

/* ── Multi-Hospital Management ───────────────────────────────────── */
.profile-facilities { margin-top: 16px; text-align: left; }
.profile-facilities h4 { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.facility-list { display: flex; flex-direction: column; gap: 4px; }
.facility-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 8px;
    background: var(--surface-1); border: 1px solid var(--border);
    transition: background .15s;
}
.facility-row.primary { border-color: var(--accent); background: rgba(99,102,241,.06); }
.facility-row.inactive { opacity: .5; }
.facility-star { background: none; border: none; cursor: pointer; font-size: 16px; color: var(--text-muted); padding: 0; line-height: 1; }
.facility-star.active { color: var(--accent); }
.facility-info { flex: 1; min-width: 0; }
.facility-name { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.facility-loc { font-size: 11px; color: var(--text-muted); }
.facility-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 0 4px; opacity: .5; }
.facility-remove:hover { opacity: 1; color: var(--error); }
.empty-hint { font-size: 12px; color: var(--text-muted); padding: 8px 0; }

/* Toggle switch */
.toggle-switch { position: relative; width: 36px; height: 20px; display: inline-block; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--surface-2); border-radius: 10px;
    cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px;
    background: white; border-radius: 50%; transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ── Enhanced Edit Modal ─────────────────────────────────────────── */
.edit-item-enhanced { display: flex; flex-direction: column; gap: 8px; }
.edit-name-row { display: flex; gap: 8px; }
.edit-name-field { flex: 1; }
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }
.slang-suggestion {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: rgba(99,102,241,.08); border: 1px solid var(--accent);
    border-radius: 8px; font-size: 12px; flex-wrap: wrap;
}
.slang-fuzzy-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; width: 100%; }
.slang-fuzzy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; font-size: 12px; width: 100%; }
.edit-product-search { margin: 4px 0; }
.edit-product-results { max-height: 200px; overflow-y: auto; margin-top: 6px; }
.edit-product-card {
    display: flex; align-items: center; gap: 10px; padding: 8px;
    border: 1px solid var(--border); border-radius: 8px; margin-bottom: 4px;
    cursor: pointer; transition: background .15s;
}
.edit-product-card:hover { background: var(--surface-1); }
.edit-product-thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; flex-shrink: 0; }
.edit-product-info { flex: 1; min-width: 0; }
.edit-product-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-product-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-product-linked {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.3);
    border-radius: 8px; font-size: 12px;
}
.linked-badge { flex: 1; color: var(--success, #22c55e); font-weight: 500; }

.profile-stats { display: flex; justify-content: center; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-stat { text-align: center; }
.profile-stat .stat-value { display: block; font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.profile-stat .stat-label { font-size: 0.7rem; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-no-stats { color: #64748b; font-size: 0.85rem; margin-top: 16px; font-style: italic; }

/* ── Upload ──────────────────────────────────────────────────────────── */

.upload-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-container h2 { margin-bottom: 12px; }

.upload-preview {
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    max-height: 300px;
}

.upload-preview img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    background: var(--surface-2);
}

/* Multi-image staging area */
.staged-pages {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    min-height: 80px;
}

.staged-page {
    position: relative;
    width: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}
.staged-page.uploaded { border-color: var(--accent); }
.staged-page.upload-error { border-color: var(--danger, #ef4444); }

.staged-page-thumb {
    position: relative;
    width: 100%;
    height: 120px;
    background: var(--surface-2);
}
.staged-page-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staged-page-num {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
}
.staged-page-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 14px;
    color: var(--accent);
}
.staged-page-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 1;
}
.staged-page-remove:hover { background: var(--danger, #ef4444); }

.upload-staging-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}
.upload-staging-actions .btn { flex: 1; }

.upload-source-select {
    margin-bottom: 16px;
}

.upload-source-select select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 13px;
}

.upload-status { text-align: center; padding: 24px 0; }
.upload-status p { margin-top: 12px; color: var(--text-dim); }

.upload-error {
    text-align: center;
    color: var(--red);
}

.upload-error p { margin: 12px 0; }

.phi-warning {
    text-align: center;
    padding: 24px;
    color: var(--red);
}

.phi-warning h3 { margin: 12px 0 8px; }
.phi-warning ul { text-align: left; margin: 12px auto; max-width: 300px; }
.phi-warning li { margin-bottom: 4px; }

.phi-strip-notice {
    background: var(--yellow-dim);
    color: var(--yellow);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extraction-review { margin-top: 16px; }
.extraction-header { margin-bottom: 12px; }
.extraction-header h3 { color: var(--green); display: flex; align-items: center; gap: 8px; }
.ext-meta { margin-top: 8px; font-size: 14px; }
.ext-meta-row { margin-bottom: 4px; color: var(--text-dim); }
.ext-meta-row strong { color: var(--text); }

.ext-target-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}
.ext-target-card label { font-size: 12px; color: var(--text-muted); display: block; margin-bottom: 6px; }
.ext-target-card select {
    width: 100%;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
}

.ext-items-list { margin-bottom: 16px; }

.ext-section-group { margin-bottom: 12px; }
.ext-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    letter-spacing: 0.05em;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}

.ext-item-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 4px;
}

.ext-item-main { display: flex; flex-direction: column; gap: 4px; }

.ext-item-card input {
    padding: 6px 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-size: 14px;
    font-family: var(--font);
    width: 100%;
    box-sizing: border-box;
}

.ext-item-details {
    display: flex;
    gap: 8px;
}
.ext-item-details label {
    flex: 1;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.ext-item-details input { margin-top: 2px; font-size: 13px; }

.extraction-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    padding: 16px 0;
    position: sticky;
    bottom: 0;
    background: var(--bg);
}

/* ── Debrief ─────────────────────────────────────────────────────────── */

.debrief-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.debrief-radio {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: border-color 0.15s;
}

.debrief-radio:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.debrief-radio input { display: none; }

/* ── Landing Page ────────────────────────────────────────────────────── */

.landing-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px 0 40px;
}

.landing-hero {
    text-align: center;
    padding: 48px 16px 40px;
    position: relative;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.landing-hero h1 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 16px;
    line-height: 1.15;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-subtitle {
    font-size: 16px;
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

.landing-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.landing-cta .btn-primary {
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
}

.landing-cta .btn-primary:hover {
    box-shadow: 0 6px 28px rgba(20, 184, 166, 0.4);
    transform: translateY(-1px);
}

/* Pain Points Section */
.landing-pain {
    margin: 40px 0 32px;
    padding: 0 16px;
}

.landing-pain h2 {
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.pain-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.pain-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.pain-icon {
    font-size: 24px;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pain-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.pain-card p {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* How It Works Section */
.landing-how {
    margin: 40px 0;
    padding: 0 16px;
}

.landing-how h2 {
    font-size: 20px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.how-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.how-step {
    display: flex;
    gap: 16px;
    align-items: center;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--accent);
}

.step-text h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.step-text p {
    font-size: 12px;
    color: var(--text-dim);
}

/* Feature Cards */
.landing-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 32px 16px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: border-color 0.2s, transform 0.15s;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.feature-icon {
    color: var(--accent);
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

/* Audience Section */
.landing-audience {
    margin: 40px 16px;
    text-align: center;
}

.landing-audience h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
}

.audience-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.audience-tag {
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.landing-footer {
    text-align: center;
    padding: 32px 16px 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    margin-top: 32px;
}

.landing-footer strong {
    color: var(--accent);
}

/* Leaderboard */
.leaderboard-section {
    margin: 32px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.leaderboard-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-row:last-child { border-bottom: none; }

.leaderboard-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
}

.leaderboard-rank.gold { background: #78350f; color: #fbbf24; }
.leaderboard-rank.silver { background: #1e293b; color: #cbd5e1; }
.leaderboard-rank.bronze { background: #431407; color: #fb923c; }
.leaderboard-rank.other { background: var(--surface-2); color: var(--text-muted); }

.leaderboard-name { flex: 1; font-size: 13px; font-weight: 600; }
.leaderboard-facility { font-size: 10px; color: var(--text-muted); }
.leaderboard-points { font-size: 14px; font-weight: 700; color: var(--accent); font-family: var(--mono); }

/* Merge Modal */
.merge-card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
}

.merge-card-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.merge-card-option:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* PWA Install Banner */
.pwa-install-banner {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99,102,241,0.08) 100%);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.pwa-install-banner .pwa-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.pwa-install-banner .pwa-text h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
}

.pwa-install-banner .pwa-text p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.pwa-install-banner .btn-install {
    margin-left: auto;
    flex-shrink: 0;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.pwa-install-banner .btn-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

/* Activity Feed */
.activity-feed {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.activity-feed h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
}

.activity-item {
    font-size: 12px;
    color: var(--text-dim);
    padding: 4px 0;
    line-height: 1.5;
}

.activity-link {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

.activity-link:hover { text-decoration: underline; }

.activity-time {
    color: var(--text-muted);
    font-size: 11px;
}

/* ── Utilities ───────────────────────────────────────────────────────── */

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--text-muted);
}

.empty-state h3 { font-size: 16px; color: var(--text-dim); margin: 8px 0; }
.icon-large { margin-bottom: 8px; color: var(--text-muted); }
.icon-large svg { width: 48px; height: 48px; }

/* Surgeon list */
.surgeon-list { display: flex; flex-direction: column; gap: 8px; }
.surgeon-tile {
    display: flex; align-items: center; gap: 14px;
    padding: 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    cursor: pointer; transition: all 0.15s ease;
}
.surgeon-tile:hover { border-color: var(--accent); background: var(--surface-3); }
.surgeon-tile:active { transform: scale(0.99); }
.surgeon-tile-avatar { flex-shrink: 0; }
.surgeon-tile-info { flex: 1; min-width: 0; }
.surgeon-tile-name { font-weight: 600; font-size: 15px; }
.surgeon-tile-title { font-weight: 400; color: var(--text-dim); font-size: 13px; margin-left: 4px; }
.surgeon-tile-meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.surgeon-tile-specialty { color: var(--text-dim); font-size: 12px; }
.surgeon-tile-stats { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.surgeon-tile-cards, .surgeon-tile-gloves { font-size: 12px; color: var(--text-muted); }
.dept-badge-sm {
    font-size: 11px; padding: 1px 6px; border-radius: 4px;
    background: var(--surface-3); color: var(--text-dim);
}

/* Surgeon avatar */
.surgeon-avatar {
    border-radius: 50%; object-fit: cover;
    border: 2px solid var(--border);
}
.surgeon-avatar-initials {
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-dim), var(--surface-3));
    color: var(--accent); font-weight: 700; text-transform: uppercase;
    border: 2px solid var(--border);
}

/* Surgeon profile page */
.surgeon-profile { max-width: 600px; }
.surgeon-profile-header {
    display: flex; gap: 20px; align-items: flex-start;
    padding: 20px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.surgeon-profile-photo {
    position: relative; cursor: pointer; flex-shrink: 0;
}
.surgeon-profile-photo .photo-overlay {
    position: absolute; inset: 0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.2s;
    color: white;
}
.surgeon-profile-photo:hover .photo-overlay { opacity: 1; }
.surgeon-profile-info { flex: 1; min-width: 0; }
.surgeon-profile-info h2 { font-size: 20px; margin: 0; }
.surgeon-profile-title { color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.surgeon-profile-dept { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.npi-tag { font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.surgeon-profile-badges { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.verification-stamp {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; padding: 4px 10px; border-radius: 6px; width: fit-content;
}
.verification-stamp.verified {
    background: var(--green-dim); color: var(--green);
    border: 1px solid rgba(34,197,94,0.3);
}
.verification-stamp.pending {
    background: var(--yellow-dim); color: var(--yellow);
    border: 1px solid rgba(245,158,11,0.3);
}
.endorsement-stamp {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--accent); width: fit-content;
}

/* Verification/endorsement badges (inline) */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; padding: 2px 6px; border-radius: 4px; }
.badge-verified { background: var(--green-dim); color: var(--green); }
.badge-endorsed { background: var(--accent-dim); color: var(--accent); }
.badge-va { background: #1a3a5c; color: #7cb4e8; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; letter-spacing: 0.5px; }
.badge-ihs { background: #3a2a1a; color: #d4a76a; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; letter-spacing: 0.5px; }
.badge-dod { background: #1a3a2a; color: #7ec07e; font-size: 10px; padding: 1px 5px; border-radius: 3px; font-weight: 600; letter-spacing: 0.5px; }

/* Facility type filter chips */
.facility-type-chips { display: flex; gap: 4px; margin-bottom: 8px; flex-wrap: wrap; }
.ftype-chip {
    font-size: 11px; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.ftype-chip:hover { border-color: var(--accent); color: var(--text); }
.ftype-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Surgeon bio */
.surgeon-bio {
    margin-top: 12px; padding: 12px 16px; border-radius: 8px;
    background: var(--surface); border-left: 3px solid var(--accent);
    font-size: 14px; color: var(--text-dim); line-height: 1.5;
}

/* Surgeon detail rows */
.surgeon-profile-details {
    margin-top: 12px; padding: 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.detail-row {
    display: flex; justify-content: space-between; padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-size: 13px; }
.detail-value { font-size: 13px; font-weight: 500; }

/* Surgeon profile actions */
.surgeon-profile-actions {
    display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap;
}

/* Endorsement list */
.endorsement-list { display: flex; flex-direction: column; gap: 8px; }
.endorsement-item {
    padding: 10px 14px; border-radius: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.endorsement-role { font-size: 12px; color: var(--text-muted); }
.endorsement-note { font-size: 13px; color: var(--text-dim); margin: 0; width: 100%; }
.endorsement-date { font-size: 11px; color: var(--text-muted); margin-left: auto; }

/* Legacy surgeon detail */
.surgeon-header { margin-bottom: 16px; }
.surgeon-detail { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

@media (max-width: 480px) {
    .surgeon-profile-header { flex-direction: column; align-items: center; text-align: center; }
    .surgeon-profile-dept { justify-content: center; }
    .surgeon-profile-badges { align-items: center; }
    .surgeon-profile-actions { justify-content: center; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
    right: 16px;
    left: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 2000;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.toast-error { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }

/* Mobile visibility */
.desktop-only { display: none !important; }
.mobile-only { display: block; }

/* ── Animations ──────────────────────────────────────────────────────── */

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 2000px; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeIn 0.2s ease-out; }

/* ═══════════════════════════════════════════════════════════════════════
   TABLET (768px+)
   ═══════════════════════════════════════════════════════════════════════ */

@media (min-width: 768px) {
    /* Desktop item hover */
    .item-card:hover { background: var(--surface-2, #f1f5f9); }

    .stats-bar { grid-template-columns: repeat(4, 1fr); gap: 12px; }
    .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .pull-checklist { columns: 2; column-gap: 20px; }
    .landing-features { grid-template-columns: repeat(3, 1fr); }
    .pain-grid { grid-template-columns: repeat(2, 1fr); }
    .how-steps { flex-direction: row; }
    .how-step { flex-direction: column; text-align: center; flex: 1; }

    .landing-hero h1 { font-size: 36px; }
    .landing-hero { padding: 64px 24px 48px; }
    .landing-pain, .landing-how { padding: 0 24px; }

    .modal {
        border-radius: 12px;
        margin: auto;
    }

    .modal-overlay {
        align-items: center;
    }

    .toast {
        left: auto;
        right: 24px;
        max-width: 360px;
        margin: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   DESKTOP (1024px+)
   ═══════════════════════════════════════════════════════════════════════ */

@media (min-width: 1024px) {
    .app-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .top-bar {
        position: sticky;
        top: 0;
        width: 100%;
    }

    .sidebar {
        display: flex;
        flex-direction: column;
        width: 240px;
        position: fixed;
        top: var(--top-bar-height);
        bottom: 0;
        left: 0;
        background: var(--surface);
        border-right: 1px solid var(--border);
        z-index: 50;
        overflow-y: auto;
    }

    .sidebar-nav { padding: 12px; }

    .nav-section { margin-bottom: 16px; }

    .nav-section-title {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        color: var(--text-muted);
        padding: 8px 12px 4px;
        font-weight: 600;
    }

    .nav-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.15s;
        font-size: 13px;
        color: var(--text-dim);
    }

    .nav-item:hover { background: var(--surface-2); color: var(--text); }
    .nav-item.active { background: var(--accent-dim); color: #fff; }

    .nav-icon { display: flex; align-items: center; }

    .nav-info {
        font-size: 11px;
        color: var(--text-muted);
        padding: 8px 12px;
        line-height: 1.4;
    }

    .main-content {
        margin-left: 240px;
        padding: 24px 32px;
        padding-bottom: 24px;
    }

    .bottom-nav { display: none; }

    .app-container.no-chrome .main-content { margin-left: 0; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

    .desktop-only { display: block !important; }
    .mobile-only { display: none !important; }

    /* Desktop binder columns */
    .binder-columns {
        display: grid !important;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 20px;
        margin-bottom: 12px;
    }

    .binder-card {
        padding: 28px 32px;
        max-width: 900px;
    }

    .binder-card .card-title { font-size: 22px; }

    .hamburger-btn { display: block; }

    .toast {
        bottom: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════ */

@media print {
    body { background: #fff; color: #000; }
    .sidebar, .top-bar, .bottom-nav, .stats-bar, .card-toolbar,
    .section-header, .search-wrap, .filter-select, .toast,
    .note-tabs-panel, .suggestions-panel { display: none !important; }
    .app-container { display: block; }
    .main-content { padding: 0; margin: 0; }
    .binder-card {
        box-shadow: none;
        padding: 12px;
        max-width: 100%;
        border: none;
    }
    .binder-card.edit-mode { border: none; }
    .item-actions { display: none !important; }
    .section-add-btn { display: none !important; }
    .section-swiper { display: block; }
    .swiper-track { display: block; overflow: visible; }
    .swiper-slide { flex: none; }
    .swiper-dots { display: none; }
}

/* ── Cross-Reference Builder ────────────────────────────────────────── */

.btn-accent { background: var(--accent); color: #fff; border: none; }
.btn-accent:hover { background: #2563eb; }

/* ── Discover / Sharing Network ─────────────────────────────────────── */
.discover-page { padding: 12px; max-width: 800px; margin: 0 auto; }
.discover-desc { color: #94a3b8; font-size: 0.9rem; margin-bottom: 16px; }
.search-lg { max-width: 100%; }
.search-lg .search-input { font-size: 1rem; padding: 12px 12px 12px 36px; }
.discover-card { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--card-bg); border-radius: 12px; margin-bottom: 8px; gap: 12px; }
.discover-card.own-facility { border-left: 3px solid var(--green); }
.discover-procedure { font-weight: 600; font-size: 0.95rem; }
.discover-surgeon { font-size: 0.85rem; color: #94a3b8; }
.discover-facility { font-size: 0.75rem; color: #64748b; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.discover-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.cross-ref-page { padding: 12px; max-width: 800px; margin: 0 auto; }
.cross-ref-desc { color: #94a3b8; font-size: 0.9rem; margin-bottom: 16px; }

.xref-source-picker { background: var(--card-bg); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.xref-source-picker > label { font-weight: 600; display: block; margin-bottom: 8px; }
.xref-card-checkboxes { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; }
.xref-card-option { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg); border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.xref-card-option:hover { background: #1e293b; }
.xref-card-option input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

.xref-hint { color: #64748b; font-style: italic; text-align: center; padding: 24px; }

.xref-summary { background: var(--card-bg); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.xref-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.xref-source-badge { font-size: 0.75rem; padding: 4px 10px; border-radius: 20px; font-weight: 600; }
.xref-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: #94a3b8; }
.xref-stats .in-all-badge { color: #10b981; }
.xref-stats .conflict-badge { color: #f59e0b; }
.xref-stats .only-one-badge { color: #64748b; }

.xref-actions-top { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.xref-items-list { display: flex; flex-direction: column; gap: 12px; }

.xref-section { background: var(--card-bg); border-radius: 12px; overflow: hidden; }
.xref-section-header { padding: 10px 16px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 0.85rem; }
.xref-select-all { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.xref-select-all input { accent-color: var(--accent); }

.xref-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.xref-item:last-child { border-bottom: none; }
.xref-item:hover { background: #1e293b; }
.xref-item.in-all { }
.xref-item.only-one { opacity: 0.7; }
.xref-item.has-conflict { border-left: 3px solid #f59e0b; }
.xref-item input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex-shrink: 0; }

.xref-item-info { flex: 1; min-width: 0; }
.xref-item-name { font-size: 0.9rem; word-break: break-word; }
.xref-item-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.75rem; color: #64748b; flex-wrap: wrap; }
.xref-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.xref-qty { font-weight: 600; }
.xref-vendor { color: #8b5cf6; }
.xref-conflict { color: #f59e0b; font-weight: 600; cursor: help; }
.xref-alt-names { font-size: 0.75rem; color: #8b5cf6; font-style: italic; margin-top: 2px; }
.xref-match-badge { font-size: 0.65rem; padding: 1px 6px; border-radius: 8px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.xref-match-badge.nickname { background: #8b5cf620; color: #8b5cf6; }
.xref-match-badge.fuzzy { background: #f59e0b20; color: #f59e0b; }
.xref-match-badge.ai { background: #10b98120; color: #10b981; }

.xref-save-panel { position: sticky; bottom: 0; background: var(--card-bg); border-radius: 12px 12px 0 0; padding: 16px; margin-top: 16px; border-top: 2px solid var(--accent); }
.xref-target { margin-bottom: 12px; }
.xref-target label { font-weight: 600; margin-right: 8px; }
.xref-target select { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; width: 100%; font-size: 0.9rem; }
.xref-new-card-fields { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.xref-new-card-fields select, .xref-new-card-fields input { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.9rem; }
.xref-save-panel .btn-primary { width: 100%; }

/* ── My Room ──────────────────────────────────────────────────────────── */

.room-header { padding: 16px; background: var(--card-bg); border-radius: var(--radius); margin-bottom: 16px; }
.room-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.room-title-row h2 { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; margin: 0; }
.room-date-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.room-date-label { font-weight: 600; font-size: 0.95rem; min-width: 100px; text-align: center; }
.room-progress { margin-top: 4px; }
.room-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.room-progress-fill { height: 100%; background: var(--green); border-radius: 3px; transition: width 0.3s; }
.room-progress-text { font-size: 0.8rem; color: #64748b; margin-top: 4px; display: block; text-align: center; }

.room-cases { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.room-case { background: var(--card-bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.room-case.in_progress { border-left: 3px solid #0ea5e9; }
.room-case.completed { border-left: 3px solid var(--green); opacity: 0.7; }

.room-case-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; min-height: var(--tap-min); }
.room-case-header:active { background: rgba(0,0,0,0.03); }
.room-case-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.room-case-time { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.room-case-surgeon { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-case-proc { font-size: 0.8rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-case-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.room-case-progress { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #64748b; }
.room-case-status { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.room-delete { color: #dc2626 !important; opacity: 0.5; }
.room-delete:hover { opacity: 1; }

.room-case-items { padding: 0 12px 12px; border-top: 1px solid var(--border); }
.room-case-actions-bar { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.room-section-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); padding: 8px 0 4px; }

.room-check-item { display: flex; align-items: flex-start; gap: 8px; padding: 6px 4px; border-radius: 4px; min-height: var(--tap-min); transition: background 0.1s; flex-wrap: wrap; position: relative; }
.room-check-item:active { background: rgba(0,0,0,0.03); }
.room-check-item.checked { opacity: 0.5; }
.room-check-item.checked .room-check-name { text-decoration: line-through; }
.room-check-box { color: #64748b; flex-shrink: 0; cursor: pointer; padding: 4px 0; }
.room-check-item.checked .room-check-box { color: var(--green); }
.room-check-content { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; cursor: pointer; flex-wrap: wrap; }
.room-check-info { flex: 1; min-width: 0; }
.room-check-name { font-size: 0.85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-check-item .pull-product-profile { width: 100%; }
.room-check-item .pull-info-hint { position: static; transform: none; opacity: 0.5; flex-shrink: 0; }
.room-check-qty { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: #64748b; }

.room-add-btn { width: 100%; margin-top: 8px; }

.btn-xs { padding: 2px 8px; font-size: 0.7rem; min-height: 28px; }


/* ── Gamification ──────────────────────────────────────────────────────── */

/* Level Card */
.level-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
}
.level-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.level-info { flex: 1; min-width: 0; }
.level-title { font-weight: 700; font-size: 15px; }
.level-xp { font-size: 12px; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; }

.xp-progress-bar {
    height: 6px;
    background: var(--surface-1);
    border-radius: 3px;
    margin-top: 6px;
    overflow: hidden;
}
.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #a855f7);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Badge Showcase */
.badge-showcase {
    margin: 16px 0;
    text-align: left;
}
.badge-showcase h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface-2);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
    cursor: default;
}
.badge-pill:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

/* Leaderboard level tag */
.leaderboard-level {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Bounty Board */
.bounty-board { max-width: 640px; margin: 0 auto; padding: 16px; }
.bounty-board h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.bounty-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

.bounty-list { display: flex; flex-direction: column; gap: 8px; }
.bounty-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    transition: border-color 0.2s;
}
.bounty-card:hover { border-color: var(--accent); }
.bounty-card.claimed { border-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.bounty-type-icon { font-size: 22px; flex-shrink: 0; }
.bounty-details { flex: 1; min-width: 0; }
.bounty-title { font-weight: 600; font-size: 13px; }
.bounty-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bounty-reward { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bounty-xp { font-weight: 800; font-size: 14px; color: var(--accent); font-family: var(--mono); }
.bounty-claimed-label { font-size: 10px; font-weight: 700; color: #f59e0b; text-transform: uppercase; }
.btn-sm { padding: 4px 10px; font-size: 11px; min-height: 28px; }

/* Coverage Card */
.coverage-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.coverage-score-ring { position: relative; flex-shrink: 0; }
.coverage-pct {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 800;
    font-size: 16px;
    font-family: var(--mono);
}
.coverage-info h3 { font-size: 14px; margin-bottom: 4px; }
.coverage-info p { font-size: 12px; color: var(--text-muted); margin: 2px 0; }

/* Profile actions */
.profile-actions { display: flex; flex-direction: column; align-items: center; width: 100%; }

/* ── Facility Profile ──────────────────────────────────────────────── */
.facility-profile { max-width: 640px; margin: 0 auto; padding: 16px; }
.facility-header-card {
    display: flex; gap: 16px; align-items: flex-start;
    background: var(--surface-2); border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.facility-icon-large { color: var(--accent); flex-shrink: 0; }
.facility-header-info h2 { font-size: 18px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facility-address, .facility-location, .facility-phone, .facility-type {
    font-size: 13px; color: var(--text-muted); margin: 2px 0;
}
.system-badge {
    display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px;
    border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.system-badge.system-va { background: #1e3a5f; color: #7cb3e0; }
.system-badge.system-ihs { background: #3b2f1e; color: #d4a06a; }
.system-badge.system-dod { background: #2a3f2a; color: #7ec07e; }

.facility-stats-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
.fstat-card {
    background: var(--surface-2); border-radius: 10px; padding: 14px 8px; text-align: center; cursor: pointer;
}
.fstat-card:hover { background: var(--surface-3); }
.fstat-value { font-size: 22px; font-weight: 800; font-family: var(--mono); color: var(--accent); }
.fstat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

.facility-coverage-detail, .facility-departments, .facility-details, .facility-uncovered, .facility-admin, .facility-vendors-section {
    background: var(--surface-2); border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.facility-coverage-detail h3, .facility-departments h3, .facility-details h3, .facility-uncovered h3, .facility-admin h3, .facility-vendors-section h3 {
    font-size: 14px; margin: 0 0 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.section-header-inline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-header-inline h3 { margin-bottom: 0; }

.vendor-card { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.vendor-card:last-child { border-bottom: none; }
.vendor-card-info { display: flex; flex-direction: column; gap: 2px; }
.vendor-card-info strong { font-size: 13px; }
.vendor-card-type { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.vendor-card-count { font-size: 11px; color: var(--accent); }
.vendor-card-actions { display: flex; gap: 4px; align-items: center; }

.vendor-picker-list { max-height: 400px; overflow-y: auto; }
.vendor-picker-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px; border-bottom: 1px solid var(--border); }
.vendor-picker-row.contracted { opacity: 0.7; }
.vendor-picker-info { display: flex; flex-direction: column; gap: 2px; }
.vendor-contracted-badge { font-size: 11px; color: var(--green); font-weight: 600; }

/* Catalog Browse */
.catalog-browse { max-width: 800px; }
.catalog-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.catalog-header h2 { margin: 0; flex: 1; }
.catalog-count { font-size: 12px; color: var(--text-muted); }

.catalog-grid { display: flex; flex-direction: column; gap: 6px; }
.catalog-product-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.catalog-product-name { font-size: 13px; font-weight: 600; }
.catalog-product-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.catalog-product-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.catalog-tag { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--text-muted); }
.catalog-tag.sterile { background: rgba(16,185,129,0.15); color: var(--green); }
.catalog-tag.kit { background: rgba(139,92,246,0.15); color: var(--purple); }
.catalog-tag.vendor { background: rgba(59,130,246,0.1); color: var(--accent); }

.vendor-browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.vendor-browse-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: border-color 0.15s; }
.vendor-browse-card:hover { border-color: var(--accent); }
.vendor-browse-card strong { font-size: 13px; }
.vendor-browse-count { font-size: 18px; font-weight: 700; color: var(--accent); }
.vendor-browse-type { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.catalog-product-card:hover { border-color: var(--accent); }

/* ── Product Detail ─────────────────────────────────────────────────── */
.product-detail { max-width: 600px; margin: 0 auto; padding: 12px; }
.pd-header { margin-bottom: 12px; }
.pd-hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.pd-avatar { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }
.pd-avatar-letter { width: 64px; height: 64px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; flex-shrink: 0; }
.pd-hero-info { flex: 1; min-width: 0; }
.pd-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; line-height: 1.2; }
.pd-company { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.pd-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.pd-flag { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.pd-flag.sterile { background: var(--green-dim); color: var(--green); }
.pd-flag.single-use { background: rgba(59,130,246,0.15); color: #60a5fa; }
.pd-flag.kit { background: rgba(168,85,247,0.15); color: #a78bfa; }
.pd-flag.rx { background: var(--yellow-dim); color: var(--yellow); }
.pd-flag.otc { background: rgba(34,211,238,0.15); color: var(--cyan); }
.pd-flag.hct { background: var(--red-dim); color: var(--red); }
.pd-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; }
.pd-section h3 { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 10px; }
.pd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .pd-grid { grid-template-columns: 1fr; } }
.pd-field { display: flex; flex-direction: column; gap: 2px; }
.pd-label { font-size: 11px; color: var(--text-muted); }
.pd-value { font-size: 13px; color: var(--text); word-break: break-word; }
.pd-value.mono { font-family: var(--mono); font-size: 12px; }
.pd-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0; }
.pd-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); }
.pd-cards-list { display: flex; flex-direction: column; gap: 6px; }
.pd-card-match { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: border-color 0.15s; }
.pd-card-match:hover { border-color: var(--accent); }
.pd-card-proc { font-size: 13px; font-weight: 600; }
.pd-card-surgeon { font-size: 11px; color: var(--accent); }
.pd-card-item { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Catalog lookup button in product profiles */
.pp-link-catalog { background: var(--accent-dim) !important; color: var(--accent) !important; border: 1px solid var(--accent) !important; }
.pp-link-catalog:hover { background: var(--accent) !important; color: var(--bg) !important; }
.pull-product-links { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pull-product-links .pp-link-btn { font-size: 11px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.pull-product-links .pull-product-link { font-size: 11px; padding: 4px 10px; }

/* ── Contract Intelligence ──────────────────────────────────────────── */
.contract-intel { max-width: 700px; margin: 0 auto; padding: 12px; }
.ci-stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
@media (max-width: 500px) { .ci-stats-row { grid-template-columns: repeat(2, 1fr); } }
.ci-stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.ci-stat-num { font-size: 22px; font-weight: 700; color: var(--accent); }
.ci-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }
.ci-search-section { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ci-search-section h3 { font-size: 13px; margin: 0 0 10px; }
.ci-search-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.ci-filter-chips { display: flex; gap: 4px; }
.ci-results-header { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.ci-results-list { display: flex; flex-direction: column; gap: 4px; }
.ci-result-row { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; transition: border-color 0.15s; }
.ci-result-row:hover { border-color: var(--accent); }
.ci-result-main { min-width: 0; flex: 1; }
.ci-hospital-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-vendor-name { font-size: 11px; color: var(--text-dim); }
.ci-result-meta { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ci-signal { font-size: 10px; padding: 2px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; }
.signal-strong { background: var(--green-dim); color: var(--green); }
.signal-moderate { background: var(--yellow-dim); color: var(--yellow); }
.signal-light { background: var(--surface-3); color: var(--text-muted); }
.ci-payments { font-size: 12px; color: var(--accent); font-weight: 600; font-family: var(--mono); }
.ci-state-badge { font-size: 10px; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; color: var(--text-dim); font-weight: 600; }
.ci-section { margin-top: 16px; }
.ci-section h3 { font-size: 13px; margin: 0 0 10px; }
.ci-state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.ci-state-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; cursor: pointer; text-align: center; transition: border-color 0.15s; }
.ci-state-card:hover { border-color: var(--accent); }
.ci-state-code { font-size: 18px; font-weight: 700; color: var(--accent); }
.ci-state-count { font-size: 11px; color: var(--text-dim); }
.ci-state-contracts { font-size: 10px; color: var(--text-muted); }
.ci-disclaimer { margin-top: 16px; font-size: 11px; color: var(--text-muted); line-height: 1.5; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

/* Hospital profile */
.ci-profile-hero { margin-bottom: 16px; }
.ci-profile-hero h2 { font-size: 18px; margin: 0 0 6px; }
.ci-profile-stats { display: flex; gap: 12px; font-size: 13px; color: var(--text-dim); }
.ci-vendor-list { display: flex; flex-direction: column; gap: 8px; }
.ci-vendor-row { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.ci-vendor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ci-vendor-title { font-size: 14px; font-weight: 600; }
.ci-vendor-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.ci-vendor-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ci-vendor-pct { font-size: 13px; font-weight: 700; color: var(--text-dim); font-family: var(--mono); }
.ci-bar-track { height: 4px; background: var(--surface-3); border-radius: 2px; margin: 8px 0 4px; overflow: hidden; }
.ci-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.ci-bar-fill.signal-strong { background: var(--green); }
.ci-bar-fill.signal-moderate { background: var(--yellow); }
.ci-bar-fill.signal-light { background: var(--surface-3); border: 1px solid var(--border); }
.ci-vendor-amount { font-size: 12px; color: var(--accent); font-family: var(--mono); }
.ci-products { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }

.coverage-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.coverage-bar-label { font-size: 13px; min-width: 120px; }
.coverage-bar { flex: 1; height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.coverage-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.5s ease; }
.coverage-bar-pct { font-size: 13px; font-weight: 700; font-family: var(--mono); min-width: 36px; text-align: right; }

.dept-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dept-chip {
    font-size: 12px; padding: 4px 10px; background: var(--surface-3); border-radius: 16px; color: var(--text);
}
.detail-grid { display: flex; flex-direction: column; gap: 6px; }
.detail-row { display: flex; justify-content: space-between; font-size: 13px; }
.detail-key { color: var(--text-muted); }
.detail-val { font-weight: 600; }

.uncovered-list { display: flex; flex-direction: column; gap: 4px; }
.uncovered-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.uncovered-dept { color: var(--text-muted); font-size: 12px; }

.facility-edit { max-width: 480px; margin: 0 auto; padding: 16px; }
.facility-edit h2 { margin-bottom: 16px; }
.facility-edit label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.facility-edit input, .facility-edit select {
    display: block; width: 100%; margin-top: 4px; padding: 10px; font-size: 14px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.facility-edit .form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

@media (max-width: 480px) {
    .facility-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .coverage-bar-label { min-width: 80px; font-size: 12px; }
}

/* ── Safety Intel / DMEPOS / Chargemaster ─────────────────────────── */

.si-tabs, .dm-tabs, .cm-tabs {
    display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; margin-bottom: 4px;
}
.si-tab {
    font-size: 12px; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.si-tab:hover { border-color: var(--accent); color: var(--text); }
.si-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.si-results-list, .dm-results-list { display: flex; flex-direction: column; gap: 2px; }
.si-result-row, .dm-result-row {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    transition: border-color 0.15s;
}
.si-result-row:hover, .dm-result-row:hover { border-color: var(--accent-dim); }
.si-result-row.compact, .dm-result-row.compact { align-items: center; padding: 8px 12px; gap: 8px; }

.si-result-main, .dm-result-main { flex: 1; min-width: 0; }
.si-device-name, .dm-supplier-name { font-size: 13px; font-weight: 600; color: var(--text); }
.si-applicant, .dm-hcpcs-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.si-reason { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.si-result-meta, .dm-result-pricing { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.si-k-number { font-size: 11px; font-family: var(--mono); color: var(--accent); }
.si-date { font-size: 11px; color: var(--text-muted); }
.si-classification { font-size: 11px; font-weight: 600; }
.si-status { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-muted); }
.si-event-type { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text-muted); }
.si-count { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; padding: 4px 0; }

.si-profile-hero { margin-bottom: 16px; }
.si-risk-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 6px; margin-top: 8px; }
.si-section { margin-top: 16px; }
.si-section h3 { font-size: 14px; margin-bottom: 8px; }

.dm-price-item { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 60px; }
.dm-price-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; }
.dm-price-val { font-size: 13px; font-weight: 600; font-family: var(--mono); }

.dm-markup-bar-wrap { flex: 1; min-width: 150px; }
.dm-markup-pct { font-size: 13px; font-weight: 700; font-family: var(--mono); margin-bottom: 4px; }
.dm-markup-detail { display: flex; gap: 12px; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.cm-spread-row {
    display: flex; align-items: center; gap: 8px; padding: 10px 0; font-size: 13px;
    border-top: 1px solid var(--border); margin-top: 12px;
}

@media (max-width: 480px) {
    .si-result-row, .dm-result-row { flex-direction: column; gap: 6px; }
    .si-result-meta, .dm-result-pricing { justify-content: flex-start; }
    .dm-price-item { flex-direction: row; gap: 6px; }
}

/* ── Facility Map ──────────────────────────────────────────────────── */
.map-page { max-width: 800px; margin: 0 auto; padding: 16px; }
.map-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.map-toolbar h2 { flex: 1; margin: 0; font-size: 18px; }
.map-toolbar-right { display: flex; gap: 8px; }

.map-empty { text-align: center; padding: 60px 20px; }
.map-empty-icon { color: var(--text-muted); margin-bottom: 16px; }
.map-empty h3 { margin-bottom: 8px; }
.map-empty p { color: var(--text-muted); font-size: 13px; max-width: 360px; margin: 0 auto; }

.floor-tabs { display: flex; gap: 4px; margin-bottom: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.floor-tab {
    font-size: 12px; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted); cursor: pointer; white-space: nowrap; transition: all 0.15s;
}
.floor-tab:hover { border-color: var(--accent); color: var(--text); }
.floor-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.map-info-bar {
    display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted);
    margin-bottom: 8px; padding: 6px 0;
}
.map-info-bar .btn { margin-left: auto; }

.map-container {
    position: relative; border-radius: 12px; overflow: hidden;
    background: var(--surface-2); border: 1px solid var(--border);
    touch-action: pan-x pan-y; user-select: none;
}
.map-container.add-mode { cursor: crosshair; }
.map-container.add-mode .map-pin { pointer-events: none; }

.map-canvas-wrap { position: relative; width: 100%; }
.map-floor-img { width: 100%; height: auto; display: block; pointer-events: none; }

.map-pins-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.map-pin {
    position: absolute; transform: translate(-50%, -100%); cursor: grab; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    transition: transform 0.1s ease;
}
.map-pin:hover { z-index: 10; transform: translate(-50%, -100%) scale(1.15); }
.map-pin.dragging { z-index: 20; cursor: grabbing; opacity: 0.8; }
.map-pin.selected { z-index: 15; }
.map-pin.selected .map-pin-dot { box-shadow: 0 0 0 3px rgba(255,255,255,0.5), 0 0 12px var(--pin-color); }

.map-pin-dot {
    width: 14px; height: 14px; border-radius: 50%; background: var(--pin-color);
    border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.map-pin-label {
    font-size: 9px; font-weight: 700; background: rgba(0,0,0,0.75); color: #fff;
    padding: 1px 5px; border-radius: 4px; white-space: nowrap; max-width: 80px;
    overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

.map-add-panel {
    background: var(--surface-2); border-radius: 12px; padding: 16px; margin-top: 8px;
}
.map-add-panel h3 { margin: 0 0 4px; font-size: 14px; }
.map-add-panel label { display: block; margin-top: 8px; font-size: 12px; color: var(--text-muted); }
.map-add-panel select, .map-add-panel input {
    width: 100%; margin-top: 4px; padding: 8px; font-size: 13px;
    background: var(--surface-3); border: 1px solid var(--border); border-radius: 6px; color: var(--text);
}
.map-add-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

.map-pin-detail {
    background: var(--surface-2); border-radius: 12px; padding: 12px; margin-top: 8px;
}
.pin-detail-header { display: flex; align-items: center; gap: 8px; }
.pin-detail-header strong { font-size: 14px; }
.pin-detail-type { font-size: 11px; color: var(--text-muted); display: block; }
.pin-detail-icon { font-size: 20px; }
.pin-detail-header .btn-close {
    margin-left: auto; background: none; border: none; color: var(--text-muted);
    font-size: 20px; cursor: pointer; padding: 0 4px;
}

.map-legend {
    display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; margin-top: 4px;
}
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.facility-map-link {
    display: flex; align-items: center; gap: 12px; background: var(--surface-2);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; cursor: pointer;
    transition: background 0.15s;
}
.facility-map-link:hover { background: var(--surface-3); }
.map-link-icon { color: var(--accent); flex-shrink: 0; }
.map-link-text { flex: 1; }
.map-link-text strong { display: block; font-size: 14px; }
.map-link-text span { font-size: 12px; color: var(--text-muted); }
.map-link-arrow { color: var(--text-muted); font-size: 18px; }

.map-upload { max-width: 480px; margin: 0 auto; padding: 16px; }
.map-upload label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
.map-upload input, .map-upload select {
    display: block; width: 100%; margin-top: 4px; padding: 10px; font-size: 14px;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text);
}
.floor-upload-zone {
    border: 2px dashed var(--border); border-radius: 12px; padding: 24px;
    text-align: center; cursor: pointer; transition: border-color 0.15s;
}
.floor-upload-zone:hover { border-color: var(--accent); }

.map-tag-dot { border-radius: 3px; width: 10px; height: 10px; }
.map-tag-pin .map-pin-label { font-size: 8px; background: rgba(249,115,22,0.85); }
.map-pin.highlighted .map-pin-dot {
    animation: highlight-pulse 1.5s ease-in-out 3;
    box-shadow: 0 0 0 4px rgba(249,115,22,0.4), 0 0 16px rgba(249,115,22,0.6);
}
@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(249,115,22,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(249,115,22,0.2), 0 0 20px rgba(249,115,22,0.5); }
}

.map-pin-tag-banner {
    background: #f97316; color: #fff; padding: 10px 14px; border-radius: 8px;
    margin-bottom: 8px; display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.map-pin-tag-banner .btn { color: #fff; border-color: rgba(255,255,255,0.4); }

@media (max-width: 480px) {
    .map-pin-label { font-size: 8px; max-width: 60px; }
    .map-pin-dot { width: 12px; height: 12px; }
}

/* ── Doctor Verification ─────────────────────────────────────────────── */

/* Verification banner on card detail */
.verify-banner {
    display: flex; align-items: center; gap: 8px; padding: 10px 14px;
    border-radius: 8px; margin-bottom: 12px; font-size: 13px;
}
.verify-banner.verified {
    background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--accent-green, #22c55e);
}
.verify-banner.unverified {
    background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--text-secondary);
}
.verify-banner .verify-date { margin-left: auto; font-size: 11px; opacity: 0.7; }

/* Item verification badges */
.item-verified { color: var(--accent-green, #22c55e); margin-right: 4px; vertical-align: middle; }
.item-needs-change { color: var(--accent-orange, #f59e0b); margin-right: 4px; vertical-align: middle; }

/* Profile verification cards */
.verified-badge-card, .verify-cta-card {
    width: 100%; padding: 16px; border-radius: 12px; margin: 16px 0;
    text-align: center;
}
.verified-badge-card {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.verified-badge-card strong { display: block; font-size: 15px; margin: 6px 0 4px; }
.verified-npi { font-size: 12px; color: var(--text-muted); display: block; }
.verified-specialty { font-size: 12px; color: var(--text-secondary); display: block; margin-top: 2px; }

.verify-cta-card {
    background: var(--surface-2); border: 1px solid var(--border);
}
.verify-cta-card strong { display: block; font-size: 15px; margin: 6px 0 4px; }
.verify-cta-card p { font-size: 12px; color: var(--text-muted); margin: 4px 0; }
.verify-cta-sub { font-size: 11px !important; opacity: 0.6; }

/* NPI lookup result in modal */
.npi-result-card {
    padding: 10px 12px; border-radius: 8px;
    background: rgba(34, 197, 94, 0.08); border: 1px solid rgba(34, 197, 94, 0.2);
    font-size: 13px; line-height: 1.5;
}

/* Verify mode (item-by-item verification) */
.verify-mode { padding: 16px 0; }
.verify-header { margin-bottom: 16px; text-align: center; }
.verify-header h2 { font-size: 18px; margin-bottom: 4px; }
.verify-header p { font-size: 13px; color: var(--text-muted); }
.verify-subtitle { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.verify-items-list { display: flex; flex-direction: column; gap: 4px; }

.verify-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--surface-2); border-radius: 8px; border: 1px solid transparent;
    transition: border-color 0.2s;
}
.verify-item[data-status="verified"] { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.04); }
.verify-item[data-status="needs_change"] { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.04); }

.verify-toggle { background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-muted); min-width: 32px; }
.verify-item[data-status="verified"] .verify-toggle { color: var(--accent-green, #22c55e); }
.verify-item[data-status="needs_change"] .verify-toggle { color: var(--accent-orange, #f59e0b); }

.verify-item-info { flex: 1; min-width: 0; }
.verify-item-name { display: block; font-size: 13px; font-weight: 500; }
.verify-item-section { font-size: 11px; color: var(--text-muted); }
.verify-item-note { display: block; font-size: 11px; color: var(--accent-orange, #f59e0b); margin-top: 2px; font-style: italic; }

/* My verified surgeon records */
.verified-surgeons { max-width: 600px; margin: 0 auto; }
.verified-surgeons h2 { margin-bottom: 8px; }
.surgeon-cards-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.surgeon-verified-card {
    padding: 14px; border-radius: 10px; background: var(--surface-2);
    border: 1px solid var(--border);
}
.svc-header { margin-bottom: 6px; }
.svc-header strong { font-size: 15px; }
.svc-facility { display: block; font-size: 12px; color: var(--text-muted); }
.svc-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; }

.loading-text { color: var(--text-muted); font-size: 12px; }

/* Credential list in profile */
.cred-list { margin-top: 10px; text-align: left; }
.cred-item { display: flex; align-items: center; gap: 6px; padding: 6px 0; font-size: 13px; flex-wrap: wrap; }
.cred-item.verified { color: var(--accent-green, #22c55e); }
.cred-item.pending { color: var(--accent-orange, #f59e0b); }
.cred-detail { font-size: 11px; color: var(--text-muted); margin-left: 4px; }


/* ── Feature 1: Product Info Modal ──────────────────────────────── */
.item-name-clickable { cursor: pointer; border-bottom: 1px dotted var(--text-muted); }
.item-name-clickable:hover { color: var(--accent); }
/* Product Profile — Inline Expansion */
.pp-inline {
    width: 100%; margin-top: 6px; padding: 10px; background: var(--surface-2);
    border-radius: 10px; border: 1px solid var(--border);
    animation: pp-slide-in 0.2s ease forwards;
}
@keyframes pp-slide-in {
    from { opacity: 0; max-height: 0; padding: 0 10px; overflow: hidden; }
    to { opacity: 1; max-height: 600px; overflow: visible; }
}
li.pp-expanded { flex-wrap: wrap; }

/* Mobile product profile bottom sheet */
.pp-sheet-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
}
.pp-sheet {
    background: var(--surface); border-radius: 16px 16px 0 0;
    width: 100%; max-height: 80vh; overflow-y: auto;
    padding: 12px 16px 24px; animation: slideUp 0.25s ease-out;
}
.pp-sheet-handle {
    width: 36px; height: 4px; border-radius: 2px; background: var(--border);
    margin: 0 auto 10px;
}
.pp-sheet-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.pp-sheet-body .pp-row-header { margin-top: 0; }
.pp-sheet-body .pp-links { margin-top: 12px; }

.pp-row-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.pp-avatar {
    width: 48px; height: 48px; border-radius: 10px; background: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    overflow: hidden; border: 1px solid var(--border);
}
.pp-avatar-img { width: 100%; height: 100%; object-fit: contain; }
.pp-avatar-letter {
    font-size: 20px; font-weight: 800; color: var(--accent);
    font-family: var(--mono);
}
.pp-row-info { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pp-row-vendor {
    font-size: 11px; padding: 2px 8px; background: var(--surface-3);
    border-radius: 10px; color: var(--text);
}
.pp-row-brand { font-size: 11px; color: var(--accent); }
.pp-row-cat { font-size: 11px; font-family: var(--mono); color: var(--text-muted); }

.pp-details { border-top: 1px solid var(--border); }
.pp-details:first-of-type { border-top: none; }
.pp-summary {
    font-size: 12px; font-weight: 600; padding: 8px 0; cursor: pointer;
    list-style: none; display: flex; justify-content: space-between; align-items: center;
    color: var(--text); user-select: none;
}
.pp-summary::after { content: '▸'; color: var(--text-muted); transition: transform 0.15s; font-size: 10px; }
.pp-details[open] .pp-summary::after { transform: rotate(90deg); }
.pp-summary::-webkit-details-marker { display: none; }
.pp-section-body { padding: 0 0 6px; }

.pp-field { display: flex; justify-content: space-between; padding: 3px 0; font-size: 12px; gap: 8px; }
.pp-field-label { color: var(--text-muted); min-width: 70px; flex-shrink: 0; }
.pp-field-value { text-align: right; flex: 1; word-break: break-word; }
.pp-critical { color: var(--red); font-weight: 700; }

.pp-nicknames { display: flex; flex-wrap: wrap; gap: 4px; }
.pp-nick {
    font-size: 11px; padding: 2px 7px; background: var(--surface-3);
    border-radius: 10px; color: var(--text);
}

.pp-links { display: flex; gap: 6px; margin-top: 8px; }
.pp-link-btn {
    flex: 1; display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 500;
    text-decoration: none; color: var(--text); transition: background 0.15s;
}
.pp-link-vendor { background: var(--accent); color: #fff; }
.pp-link-vendor:hover { opacity: 0.9; }
.pp-link-google { background: var(--surface-3); }
.pp-link-google:hover { background: var(--border); }
.pp-link-arrow { font-size: 14px; }

.pp-loading { padding: 12px; text-align: center; }
.pp-error { padding: 8px; font-size: 12px; color: var(--red); }

/* Legacy compat */
.product-info-modal { max-width: 420px; }
.product-info-body { text-align: center; }
.product-info-img { max-width: 100%; max-height: 280px; border-radius: 8px; margin-bottom: 16px; object-fit: contain; background: #fff; }
.product-info-no-img { padding: 40px; color: var(--text-muted); font-size: 13px; }
.product-info-fields { text-align: left; }
.pif { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pif-label { color: var(--text-muted); font-weight: 500; min-width: 100px; }
.pif-value { text-align: right; flex: 1; }


/* ── Feature 2: 2-Tap Debrief ──────────────────────────────────── */
.debrief-2tap { max-width: 380px; text-align: center; }
.debrief-prompt { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.debrief-thumbs { display: flex; gap: 16px; justify-content: center; }
.debrief-thumb { display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 24px 32px; border-radius: 16px; border: 2px solid var(--border);
    background: var(--surface-2); cursor: pointer; transition: all 0.2s; font-size: 16px; font-weight: 600; }
.debrief-thumb:hover { transform: scale(1.05); }
.debrief-thumb.up:hover, .debrief-thumb.up:active { border-color: #22c55e; background: rgba(34,197,94,0.1); }
.debrief-thumb.down:hover, .debrief-thumb.down:active { border-color: #ef4444; background: rgba(239,68,68,0.1); }
.debrief-thumb span { font-size: 14px; }
.debrief-issues { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; text-align: left; }
.debrief-issue-check { display: flex; align-items: center; gap: 6px; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.debrief-issue-check:has(input:checked) { border-color: var(--accent); background: rgba(99,102,241,0.08); }
.debrief-step.hidden { display: none; }


/* ── Feature 3: Barcode Scanner ─────────────────────────────────── */
.scanner-container { max-width: 600px; margin: 0 auto; }
.scanner-preview { position: relative; width: 100%; aspect-ratio: 4/3; background: #111; border-radius: 12px; overflow: hidden; }
.scanner-preview video { width: 100%; height: 100%; object-fit: cover; }
.scanner-target { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 70%; height: 40%; border: 2px solid rgba(99,102,241,0.6); border-radius: 8px; pointer-events: none; }
.scanner-controls { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.scanner-manual { margin-top: 16px; text-align: center; }
.scanner-manual p { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.scanner-manual-row { display: flex; gap: 8px; }
.scanner-manual-row .input { flex: 1; }
.scan-result { margin-top: 16px; padding: 16px; background: var(--surface-2); border-radius: 12px; }
.scan-result.hidden { display: none; }
.scan-found h3 { color: #22c55e; margin-bottom: 12px; }
.scan-not-found h3 { color: var(--text-muted); }
.scan-device-info { text-align: left; }
.sdi-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.sdi-label { color: var(--text-muted); font-weight: 500; }
.scan-history-list { display: flex; flex-direction: column; gap: 4px; }
.scan-history-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); }
.scan-type-badge { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; text-transform: uppercase;
    background: var(--surface-2); color: var(--text-muted); }
.scan-type-badge.barcode { background: rgba(99,102,241,0.15); color: var(--accent); }
.scan-type-badge.qr { background: rgba(34,197,94,0.15); color: #22c55e; }
.scan-value { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-action { font-size: 11px; color: var(--text-muted); }


/* ── Feature 4: Case Scheduling (filter tabs + emergent badge) ─── */
.pull-filter-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.filter-tab { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; }
.filter-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.case-block.emergent-block { border-left: 3px solid #ef4444; }
.status-badge.emergent { background: rgba(239,68,68,0.15); color: #ef4444; font-weight: 700; }
#alert-bell { position: relative; display: inline-block; margin-bottom: 8px; }
.alert-bell-icon { cursor: pointer; position: relative; }
.alert-count { position: absolute; top: -6px; right: -8px; background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; }
.alerts-list { max-height: 400px; overflow-y: auto; }
.alert-item { padding: 12px; border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; }
.alert-item.emergent { border-left: 3px solid #ef4444; }
.alert-header { display: flex; gap: 8px; margin-bottom: 4px; }
.alert-type-badge { font-size: 10px; font-weight: 600; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; background: var(--surface-1); }
.alert-case { font-size: 12px; color: var(--text-muted); }
.alert-message { font-size: 13px; margin-bottom: 8px; }


/* ── Feature 5: Surgeon Dashboard (My Cards) ────────────────────── */
.facility-group { margin-bottom: 24px; }
.facility-group-title { font-size: 14px; font-weight: 600; color: var(--text-muted); padding: 0 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.accuracy-badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.accuracy-badge.good { background: rgba(34,197,94,0.15); color: #22c55e; }
.accuracy-badge.ok { background: rgba(245,158,11,0.15); color: #f59e0b; }
.accuracy-badge.low { background: rgba(239,68,68,0.15); color: #ef4444; }
.card-tile-debriefs { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.notif-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600;
    background: rgba(239,68,68,0.15); color: #ef4444; cursor: pointer; margin-left: 8px; }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { padding: 10px; border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; }
.notif-header { margin-bottom: 6px; }
.notif-type { font-size: 12px; font-weight: 600; text-transform: capitalize; }
.notif-card { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.notif-actions { display: flex; gap: 6px; }


/* ── Feature 6: Find It / Wayfinding ─────────────────────────────── */
.find-it-container { max-width: 600px; margin: 0 auto; }
.find-search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.find-input { flex: 1; font-size: 16px; padding: 12px 16px; }
.find-result-card { padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 10px; }
.find-result-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.find-result-location { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.find-result-photo { max-width: 100%; max-height: 150px; border-radius: 8px; margin-bottom: 8px; object-fit: cover; }
.find-result-footer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--text-muted); }
.find-confirmations { font-weight: 600; }
.find-actions { display: flex; gap: 4px; margin-left: auto; }
.find-it-btn { background: none; border: none; cursor: pointer; padding: 2px; opacity: 0.5; font-size: 12px; }
.find-it-btn:hover { opacity: 1; }


/* ── Feature 7: Emergency Carts ──────────────────────────────────── */
.cart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cart-tile { padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s; }
.cart-tile:hover { transform: translateY(-2px); }
.cart-tile.deployed { border-color: #ef4444; }
.cart-tile.expired_items { border-color: #f59e0b; }
.cart-tile-name { font-size: 16px; font-weight: 600; margin: 8px 0; }
.cart-tile-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--text-muted); }
.cart-tile-meta .cart-expiring { color: #f59e0b; font-weight: 600; }
.cart-tile-checked { font-size: 11px; color: var(--text-muted); margin-top: 8px; }
.cart-tile-status { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.cart-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.cart-status-dot.ready { background: #22c55e; }
.cart-status-dot.deployed { background: #ef4444; }
.cart-status-dot.needs_check { background: #f59e0b; }
.cart-status-dot.expired_items { background: #f59e0b; }
.cart-detail-actions { display: flex; gap: 6px; }
.cart-info-bar { display: flex; gap: 12px; align-items: center; padding: 8px 0; margin-bottom: 16px; font-size: 13px; color: var(--text-muted); }
.cart-items-list { display: flex; flex-direction: column; gap: 4px; }
.cart-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.cart-item.expired { border-left: 3px solid #ef4444; }
.cart-item.expiring { border-left: 3px solid #f59e0b; }
.cart-item-name { flex: 1; font-weight: 500; }
.cart-item-qty { font-weight: 600; }
.cart-item-lot { font-size: 11px; color: var(--text-muted); }
.cart-item-exp { font-size: 11px; color: var(--text-muted); }
.cart-item-exp.expired { color: #ef4444; font-weight: 700; }
.cart-check-list { display: flex; flex-direction: column; gap: 6px; }
.cart-check-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.cart-check-name { flex: 1; font-size: 13px; font-weight: 500; }
.cart-check-btns { display: flex; gap: 4px; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-warning { background: #f59e0b; color: #000; }


/* ── Camera FAB Menu ───────────────────────────────────────────── */
.camera-menu { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 1001;
    background: var(--surface-2); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; gap: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4); min-width: 240px; }
.camera-menu-btn { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: none; background: transparent;
    color: var(--text-primary); font-size: 14px; border-radius: 10px; cursor: pointer; width: 100%; }
.camera-menu-btn:hover { background: var(--surface-1); }


/* ═══════════════════════════════════════════════════════════════════════
   DOPAMINE ENGINE — Addictive Gamification Animations
   ═══════════════════════════════════════════════════════════════════════ */

/* ── XP Float Numbers ────────────────────────────────────────────────── */
.xp-float {
    position: fixed;
    z-index: 99998;
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 20px rgba(20, 184, 166, 0.6), 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
    opacity: 0;
    transform: translateY(0) scale(0.5);
    transition: all 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}
.xp-float.float-up {
    opacity: 1;
    transform: translateY(-120px) scale(1.1);
    animation: xpFadeOut 1.2s ease-in forwards;
}
.xp-float-bonus {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #f59e0b;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
    margin-top: 2px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
@keyframes xpFadeOut {
    0% { opacity: 1; }
    60% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-160px) scale(0.8); }
}

/* ── Combo Display ───────────────────────────────────────────────────── */
.combo-display {
    position: fixed;
    top: 50%;
    right: 24px;
    transform: translateY(-50%) scale(0.3);
    z-index: 99997;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.combo-display.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}
.combo-count {
    font-family: var(--mono);
    font-weight: 900;
    color: #f59e0b;
    text-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    line-height: 1;
}
.combo-label {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 4px;
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}
.combo-display.combo-fire .combo-count {
    color: #ef4444;
    text-shadow: 0 0 40px rgba(239, 68, 68, 0.6);
    animation: comboPulse 0.4s ease infinite alternate;
}
.combo-display.combo-ultra .combo-count {
    background: linear-gradient(135deg, #ef4444, #f59e0b, #a855f7, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
    animation: comboRainbow 1s linear infinite, comboPulse 0.3s ease infinite alternate;
}
@keyframes comboPulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}
@keyframes comboRainbow {
    from { filter: hue-rotate(0deg) drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
    to { filter: hue-rotate(360deg) drop-shadow(0 0 20px rgba(168, 85, 247, 0.5)); }
}

/* ── Screen Shake ────────────────────────────────────────────────────── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-3px); }
    30%, 70% { transform: translateX(3px); }
}
body.screen-shake { animation: shake 0.3s ease; }

/* ── Level Up Ceremony ───────────────────────────────────────────────── */
.level-up-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    cursor: pointer;
}
.level-up-overlay.show { opacity: 1; }
.level-up-content {
    text-align: center;
    position: relative;
    transform: scale(0.3);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.level-up-overlay.show .level-up-content { transform: scale(1); }
.level-up-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(20, 184, 166, 0.3) 0%, rgba(168, 85, 247, 0.1) 50%, transparent 70%);
    animation: burstPulse 2s ease infinite;
}
@keyframes burstPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.6; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}
.level-up-badge {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 42px;
    font-weight: 900;
    color: #fff;
    margin: 0 auto 16px;
    box-shadow: 0 0 60px rgba(20, 184, 166, 0.5), 0 0 120px rgba(168, 85, 247, 0.3);
    animation: levelBadgeSpin 3s ease infinite;
}
@keyframes levelBadgeSpin {
    0%, 100% { box-shadow: 0 0 60px rgba(20, 184, 166, 0.5), 0 0 120px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 80px rgba(168, 85, 247, 0.6), 0 0 140px rgba(20, 184, 166, 0.4); }
}
.level-up-text {
    font-family: var(--mono);
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(90deg, var(--accent), #a855f7, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}
.level-up-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.level-up-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Enhanced Achievement Toast ──────────────────────────────────────── */
.achievement-toast {
    position: fixed;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 100001;
    min-width: 280px;
    max-width: 380px;
    overflow: hidden;
    transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.achievement-toast.show { top: 24px; }
.achievement-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.08) 45%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.08) 55%, transparent 60%);
    background-size: 300% 100%;
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.achievement-icon { font-size: 32px; flex-shrink: 0; position: relative; z-index: 1; }
.achievement-info { position: relative; z-index: 1; }
.achievement-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; }
.achievement-name { font-size: 16px; font-weight: 800; color: #fff; }
.achievement-desc { font-size: 11px; margin-top: 2px; }
.achievement-xp { font-size: 11px; font-weight: 700; font-family: var(--mono); margin-top: 3px; }

/* Rarity tiers */
.rarity-common {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    border: 1px solid #6366f1;
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.3);
}
.rarity-common .achievement-title { color: #a5b4fc; }
.rarity-common .achievement-desc { color: #c7d2fe; }
.rarity-common .achievement-xp { color: #a5b4fc; }

.rarity-rare {
    background: linear-gradient(135deg, #0c4a6e, #075985);
    border: 1px solid #0ea5e9;
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.35);
}
.rarity-rare .achievement-title { color: #7dd3fc; }
.rarity-rare .achievement-desc { color: #bae6fd; }
.rarity-rare .achievement-xp { color: #38bdf8; }

.rarity-epic {
    background: linear-gradient(135deg, #3b0764, #581c87);
    border: 1px solid #a855f7;
    box-shadow: 0 12px 40px rgba(168, 85, 247, 0.4), 0 0 60px rgba(168, 85, 247, 0.15);
    animation: epicGlow 2s ease infinite alternate;
}
@keyframes epicGlow {
    from { box-shadow: 0 12px 40px rgba(168, 85, 247, 0.4), 0 0 60px rgba(168, 85, 247, 0.15); }
    to { box-shadow: 0 12px 50px rgba(168, 85, 247, 0.6), 0 0 80px rgba(168, 85, 247, 0.25); }
}
.rarity-epic .achievement-title { color: #d8b4fe; }
.rarity-epic .achievement-desc { color: #e9d5ff; }
.rarity-epic .achievement-xp { color: #c084fc; }

.rarity-legendary {
    background: linear-gradient(135deg, #78350f, #92400e);
    border: 2px solid #f59e0b;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4), 0 0 80px rgba(245, 158, 11, 0.2);
    animation: legendaryGlow 1.5s ease infinite alternate;
}
@keyframes legendaryGlow {
    from { box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4), 0 0 80px rgba(245, 158, 11, 0.2); border-color: #f59e0b; }
    to { box-shadow: 0 16px 60px rgba(245, 158, 11, 0.6), 0 0 100px rgba(245, 158, 11, 0.3); border-color: #fbbf24; }
}
.rarity-legendary .achievement-title { color: #fde68a; letter-spacing: 3px; }
.rarity-legendary .achievement-name { background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.rarity-legendary .achievement-desc { color: #fde68a; }
.rarity-legendary .achievement-xp { color: #f59e0b; }

/* ── Streak Display (Header) ─────────────────────────────────────────── */
.streak-display {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    cursor: default;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
}
.streak-flame { font-size: 14px; }
.streak-num { font-family: var(--mono); color: var(--text); }
.streak-display.streak-fire {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    animation: streakPulse 2s ease infinite;
}
.streak-display.streak-fire .streak-num { color: #f59e0b; }
.streak-display.streak-ultra {
    border-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(245, 158, 11, 0.15));
    animation: streakPulse 1.5s ease infinite;
}
.streak-display.streak-ultra .streak-num { color: #ef4444; }
@keyframes streakPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ── Profile Gamification Stats Grid ─────────────────────────────────── */
.gamification-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 16px 0;
}
.gstat-card {
    text-align: center;
    padding: 12px 8px;
    background: var(--surface-2);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.gstat-icon { font-size: 20px; margin-bottom: 4px; }
.gstat-value { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--text); }
.gstat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.gstat-card.gstat-fire {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.08);
}
.gstat-card.gstat-fire .gstat-value { color: #f59e0b; }
.gstat-card.gstat-maxed {
    border-color: var(--accent);
    background: rgba(20, 184, 166, 0.08);
}
.gstat-card.gstat-maxed .gstat-value { color: var(--accent); }
.gstat-card.gstat-soft-cap {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.06);
}
.gstat-card.gstat-soft-cap .gstat-value { color: #f59e0b; }

/* ── Next Ahead Hint ─────────────────────────────────────────────────── */
.next-ahead-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 16px;
    background: var(--surface-2);
    border-radius: 8px;
    margin: -8px 0 12px;
    border: 1px dashed var(--border);
}
.next-ahead-arrow { color: var(--accent); font-weight: 700; }
.next-ahead-hint strong { color: var(--text); }

/* ── Daily Activity Chart ────────────────────────────────────────────── */
.daily-activity-chart { margin: 12px 0 16px; }
.activity-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
.activity-bars { display: flex; gap: 6px; align-items: flex-end; height: 80px; }
.activity-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.activity-bar-value { font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--text-muted); }
.activity-bar-track { width: 100%; height: 50px; background: var(--surface-2); border-radius: 4px; position: relative; overflow: hidden; display: flex; align-items: flex-end; }
.activity-bar-fill { width: 100%; background: linear-gradient(180deg, var(--accent), rgba(20, 184, 166, 0.4)); border-radius: 4px; transition: height 0.8s cubic-bezier(0.34, 1.56, 0.64, 1); min-height: 2px; }
.activity-bar-fill.bar-maxed { background: linear-gradient(180deg, #f59e0b, rgba(245, 158, 11, 0.4)); }
.activity-bar-day { font-size: 10px; color: var(--text-muted); font-weight: 600; }

/* ── Enhanced Profile Avatar Ring ────────────────────────────────────── */
.profile-avatar-ring {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 0 auto 12px;
}
.profile-avatar-ring .profile-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
}
.avatar-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.xp-ring-fill { transition: stroke-dasharray 1s ease; }
.profile-avatar-ring.pulse-glow .avatar-ring-svg { animation: ringPulse 2s ease infinite; }
@keyframes ringPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(20, 184, 166, 0.3)); }
    50% { filter: drop-shadow(0 0 16px rgba(20, 184, 166, 0.7)); }
}

/* ── Enhanced Level Card ─────────────────────────────────────────────── */
.level-badge-big {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #a855f7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.3);
}
.level-num { font-family: var(--mono); font-size: 20px; font-weight: 900; color: #fff; line-height: 1; }
.level-label { font-size: 7px; font-weight: 700; color: rgba(255,255,255,0.7); letter-spacing: 2px; text-transform: uppercase; }
.near-level-hint { font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 4px; animation: hintBlink 1.5s ease infinite; }
@keyframes hintBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.level-card.near-level-up {
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.15);
}
.xp-progress-fill.progress-pulse {
    animation: progressPulse 1.5s ease infinite;
}
@keyframes progressPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(20, 184, 166, 0.3); }
    50% { box-shadow: 0 0 12px rgba(20, 184, 166, 0.7), 0 0 24px rgba(168, 85, 247, 0.3); }
}

/* ── Badge Rarity Pills ──────────────────────────────────────────────── */
.badge-pill.badge-rare {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    color: #7dd3fc;
}
.badge-pill.badge-epic {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    color: #d8b4fe;
    animation: epicPillGlow 3s ease infinite;
}
@keyframes epicPillGlow {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.3); }
}
.badge-pill.badge-legendary {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-weight: 700;
    animation: legendaryPillGlow 2s ease infinite alternate;
}
@keyframes legendaryPillGlow {
    from { box-shadow: 0 0 4px rgba(245, 158, 11, 0.2); }
    to { box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
}

/* ── Enhanced Leaderboard ────────────────────────────────────────────── */
.leaderboard-first {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), transparent);
    border-left: 2px solid #f59e0b;
    padding-left: 12px;
}
.leaderboard-streak {
    font-size: 10px;
    font-weight: 700;
    color: #f59e0b;
    margin-left: 4px;
}


/* ═══════════════════════════════════════════════════════════════════════
   REFERRAL SYSTEM
   ═══════════════════════════════════════════════════════════════════════ */

.referral-section { margin: 16px 0; }
.referral-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    overflow: hidden;
}
.referral-card h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.referral-subtitle { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.referral-code-display {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
    background: var(--surface-1);
    border-radius: 8px;
    border: 1px dashed var(--border-light);
    margin-bottom: 12px;
}
.referral-code {
    font-family: var(--mono);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 3px;
    color: var(--accent);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.referral-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.rstat {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--surface-1);
    border-radius: 8px;
}
.rstat-val { display: block; font-family: var(--mono); font-size: 16px; font-weight: 800; color: var(--text); }
.rstat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Referral Network Modal */
.referral-network-list { max-height: 300px; overflow-y: auto; margin: 12px 0; }
.referral-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
.referral-row:last-child { border-bottom: none; }
.referral-person { min-width: 0; overflow: hidden; }
.referral-person strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; }
.referral-role { font-size: 11px; color: var(--text-muted); margin-left: 6px; }
.referral-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.referral-facility { font-size: 11px; color: var(--text-muted); }
.referral-status {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 4px;
}
.referral-active { color: var(--green); background: rgba(34, 197, 94, 0.1); }
.referral-pending { color: var(--yellow); background: rgba(245, 158, 11, 0.1); }
.referral-verified { color: var(--accent); background: rgba(20, 184, 166, 0.1); }


/* ═══════════════════════════════════════════════════════════════════════
   RICHTAB DESIGN SYSTEM — Intelligence Views
   Ported from Terminal, adapted for PrefCard's teal palette.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Section Headers (collapsible) ─────────────────────────────────── */
.rt-section-hdr {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: var(--surface-2); border-radius: 8px; cursor: pointer;
    border: 1px solid var(--border); margin-bottom: 2px;
    user-select: none; transition: background 0.15s;
}
.rt-section-hdr:hover { background: var(--surface-3); }
.rt-section-chevron { font-size: 10px; color: var(--text-muted); width: 14px; flex-shrink: 0; }
.rt-section-title { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text); flex: 1; }
.rt-section-count { font-size: 11px; font-family: var(--mono); color: var(--text-muted); padding: 1px 8px; background: var(--surface-3); border-radius: 10px; }
.rt-section-body { padding: 8px 0 12px; }
.rt-section-body.collapsed { display: none; }

/* ── Severity Badges ───────────────────────────────────────────────── */
.rt-severity { padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.rt-severity.critical { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.rt-severity.warning { background: rgba(245, 158, 11, 0.15); color: var(--yellow); }
.rt-severity.info { background: rgba(34, 211, 238, 0.12); color: var(--cyan); }
.rt-severity.ok { background: rgba(34, 197, 94, 0.15); color: var(--green); }

/* ── Metric Grid ───────────────────────────────────────────────────── */
.rt-metrics {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px; margin-bottom: 12px;
}
.rt-metric {
    text-align: center; padding: 12px 8px; background: var(--surface-2);
    border-radius: 10px; border: 1px solid var(--border);
}
.rt-metric-val { font-family: var(--mono); font-size: 18px; font-weight: 800; color: var(--text); line-height: 1.2; }
.rt-metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.rt-metric.clickable { cursor: pointer; transition: border-color 0.15s; }
.rt-metric.clickable:hover { border-color: var(--accent); }

/* ── Key-Value Rows ────────────────────────────────────────────────── */
.rt-kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 12px; border-bottom: 1px solid var(--border); gap: 12px; }
.rt-kv:last-child { border-bottom: none; }
.rt-kv-key { color: var(--accent); font-weight: 600; min-width: 80px; flex-shrink: 0; }
.rt-kv-val { text-align: right; flex: 1; word-break: break-word; }

/* ── Ranked List Rows ──────────────────────────────────────────────── */
.rt-rank-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
    margin-bottom: 4px; transition: background 0.15s;
}
.rt-rank-row:hover { background: var(--surface-3); }
.rt-rank-pos { font-family: var(--mono); font-size: 12px; font-weight: 800; color: var(--text-muted); width: 24px; text-align: center; flex-shrink: 0; }
.rt-rank-main { flex: 1; min-width: 0; }
.rt-rank-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-rank-sub { font-size: 11px; color: var(--text-muted); }
.rt-rank-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.rt-rank-val { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.rt-rank-badge { font-size: 10px; }

/* ── Price Display ─────────────────────────────────────────────────── */
.rt-price { font-family: var(--mono); font-weight: 700; }
.rt-price.below-avg { color: var(--green); }
.rt-price.above-avg { color: var(--red); }
.rt-price.at-avg { color: var(--text); }
.rt-price-compare { font-size: 10px; color: var(--text-muted); }

/* ── Safety Score Ring ─────────────────────────────────────────────── */
.rt-safety-ring {
    width: 48px; height: 48px; position: relative; flex-shrink: 0;
}
.rt-safety-ring svg { width: 100%; height: 100%; }
.rt-safety-ring-label {
    position: absolute; inset: 0; display: flex; align-items: center;
    justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 800;
}

/* ── Safety Score Bar ──────────────────────────────────────────────── */
.rt-safety-bar { display: flex; align-items: center; gap: 8px; }
.rt-safety-bar-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.rt-safety-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.rt-safety-bar-val { font-family: var(--mono); font-size: 12px; font-weight: 700; min-width: 36px; text-align: right; }

/* ── Alternative Product Card ──────────────────────────────────────── */
.rt-alt-product {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px;
    background: var(--surface-2); border-radius: 8px; border: 1px solid var(--border);
    margin-bottom: 4px;
}
.rt-alt-product-info { flex: 1; min-width: 0; }
.rt-alt-product-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-alt-product-vendor { font-size: 11px; color: var(--text-muted); }
.rt-alt-product-price { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.rt-alt-swap-btn {
    padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    background: var(--accent); color: #fff; border: none; cursor: pointer;
    transition: opacity 0.15s;
}
.rt-alt-swap-btn:hover { opacity: 0.85; }

/* ── Supply Chain Health Strip ─────────────────────────────────────── */
.supply-health-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px; padding: 12px; background: var(--surface-2); border-radius: 10px;
    border: 1px solid var(--border); margin-bottom: 16px;
}
.supply-health-item {
    text-align: center; padding: 8px 4px; cursor: pointer;
    border-radius: 8px; transition: background 0.15s;
}
.supply-health-item:hover { background: var(--surface-3); }
.supply-health-val { font-family: var(--mono); font-size: 16px; font-weight: 800; }
.supply-health-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

/* ── Intel View Wrappers ───────────────────────────────────────────── */
.intel-view { max-width: 900px; margin: 0 auto; padding: 0 8px; }
.intel-header { margin-bottom: 16px; }
.intel-header h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }
.intel-header-sub { font-size: 12px; color: var(--text-muted); }
.intel-disclaimer {
    margin-top: 16px; padding: 10px 12px; font-size: 11px; color: var(--text-muted);
    background: var(--surface-2); border-radius: 8px; border-left: 3px solid var(--border);
}

/* ── Product Profile v2 (Richtab version) ──────────────────────────── */
.pp-v2-hero { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.pp-v2-hero-info { flex: 1; min-width: 0; }
.pp-v2-hero-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.pp-v2-hero-vendor { font-size: 12px; color: var(--text-muted); }
.pp-v2-hero-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pp-v2-hero-badge {
    font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
    background: var(--surface-3); color: var(--text-dim);
}
.pp-v2-hero-badge.class-ii { background: rgba(245, 158, 11, 0.15); color: var(--yellow); }
.pp-v2-hero-badge.class-iii { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.pp-v2-hero-badge.cleared { background: rgba(34, 197, 94, 0.15); color: var(--green); }

.pp-v2-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.pp-v2-action-btn {
    flex: 1; min-width: 80px; display: flex; align-items: center; justify-content: center;
    gap: 4px; padding: 8px 10px; border-radius: 6px; font-size: 11px; font-weight: 600;
    text-decoration: none; color: var(--text); background: var(--surface-3);
    border: 1px solid var(--border); cursor: pointer; transition: all 0.15s;
}
.pp-v2-action-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.pp-v2-action-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.pp-v2-action-btn.primary:hover { opacity: 0.9; }

/* ── Recall Alert Card ─────────────────────────────────────────────── */
.rt-recall-card {
    padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--red);
    background: rgba(239, 68, 68, 0.06); margin-bottom: 6px;
}
.rt-recall-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.rt-recall-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.rt-recall-meta { display: flex; gap: 8px; margin-top: 6px; font-size: 10px; color: var(--text-muted); }

/* ── Upload Pipeline Progress (claude.ai-style) ─────────────────── */
.upload-pipeline { padding: 16px 0; }
.pipeline-phases { display: flex; flex-direction: column; gap: 2px; }

.pipeline-phase {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 8px 12px; border-radius: 8px;
    font-size: 13px; line-height: 1.5;
    transition: background 0.3s, opacity 0.3s;
}
.pipeline-phase.phase-active { background: rgba(59, 130, 246, 0.06); }
.pipeline-phase.phase-done { opacity: 0.7; }
.pipeline-phase.phase-error { background: rgba(239, 68, 68, 0.06); }

.phase-icon {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700;
}
.phase-done .phase-icon { color: #16a34a; }
.phase-error .phase-icon { color: #dc2626; }
.phase-active .phase-icon { color: #3b82f6; }

.phase-spinner {
    width: 14px; height: 14px; border: 2px solid #e5e7eb;
    border-top-color: #3b82f6; border-radius: 50%;
    animation: phase-spin 0.7s linear infinite;
}
@keyframes phase-spin { to { transform: rotate(360deg); } }

.phase-content { flex: 1; min-width: 0; }
.phase-msg { font-weight: 500; color: var(--text); }
.phase-active .phase-msg { color: #3b82f6; }
.phase-error .phase-msg { color: #dc2626; }

.phase-detail {
    display: block; font-size: 11px; color: var(--text-muted);
    margin-top: 1px; font-weight: 400;
}

/* ── Image Hover Zoom ────────────────────────────────────────────── */
.item-thumb {
    cursor: zoom-in; transition: transform 0.2s, box-shadow 0.2s;
    position: relative; z-index: 1;
}
.item-thumb:hover {
    transform: scale(3.5); z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    border-radius: 6px;
}

/* ── Marketplace Slide-Out Panel ─────────────────────────────────── */
.mkt-panel-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 9000; opacity: 0; transition: opacity 0.3s;
    pointer-events: none;
}
.mkt-panel-overlay.active { opacity: 1; pointer-events: auto; }

.mkt-panel {
    position: fixed; top: 0; right: -480px; bottom: 0;
    width: 480px; max-width: 95vw;
    background: var(--surface); border-left: 1px solid var(--border);
    z-index: 9001; transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
    box-shadow: -8px 0 30px rgba(0,0,0,0.15);
}
.mkt-panel-overlay.active .mkt-panel { right: 0; }

.mkt-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.mkt-panel-header h3 { font-size: 15px; font-weight: 600; margin: 0; }
.mkt-panel-close {
    background: none; border: none; font-size: 22px; cursor: pointer;
    color: var(--text-muted); padding: 0 4px; line-height: 1;
}
.mkt-panel-close:hover { color: var(--text); }

.mkt-panel-hero {
    padding: 20px; text-align: center; background: var(--surface-2);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.mkt-panel-hero img {
    max-width: 100%; max-height: 200px; object-fit: contain;
    border-radius: 8px; background: #fff;
}
.mkt-panel-hero-name {
    font-size: 14px; font-weight: 600; margin-top: 10px; line-height: 1.3;
}
.mkt-panel-hero-vendor {
    font-size: 12px; color: var(--text-muted); margin-top: 2px;
}

.mkt-panel-tabs {
    display: flex; border-bottom: 1px solid var(--border);
    flex-shrink: 0; overflow-x: auto;
}
.mkt-tab {
    flex: 1; padding: 10px 8px; font-size: 11px; font-weight: 600;
    text-align: center; cursor: pointer; border: none; background: none;
    color: var(--text-muted); border-bottom: 2px solid transparent;
    white-space: nowrap; transition: all 0.15s;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.mkt-tab:hover { color: var(--text); background: var(--surface-2); }
.mkt-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.mkt-tab-content {
    flex: 1; overflow-y: auto; padding: 16px 20px;
}

.mkt-field { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 13px; }
.mkt-field-label { color: var(--text-muted); font-weight: 500; min-width: 110px; }
.mkt-field-value { text-align: right; flex: 1; word-break: break-word; }

.mkt-section-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--text-muted); margin: 16px 0 8px; padding-top: 8px;
    border-top: 1px solid var(--border);
}
.mkt-section-title:first-child { margin-top: 0; border-top: none; padding-top: 0; }

.mkt-recall-card {
    padding: 10px 12px; border-radius: 8px; border-left: 3px solid var(--red);
    background: rgba(239, 68, 68, 0.06); margin-bottom: 8px; font-size: 12px;
}
.mkt-recall-title { font-weight: 600; margin-bottom: 4px; }
.mkt-recall-meta { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.mkt-clearance-card {
    padding: 8px 12px; border-radius: 8px; background: rgba(34, 197, 94, 0.06);
    border-left: 3px solid var(--green); margin-bottom: 6px; font-size: 12px;
}

.mkt-alt-card {
    display: flex; gap: 10px; padding: 10px; border-radius: 8px;
    border: 1px solid var(--border); margin-bottom: 8px; cursor: pointer;
    transition: border-color 0.15s;
}
.mkt-alt-card:hover { border-color: var(--accent); }
.mkt-alt-img { width: 40px; height: 40px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.mkt-alt-info { flex: 1; font-size: 12px; }
.mkt-alt-name { font-weight: 600; }
.mkt-alt-vendor { color: var(--text-muted); }

/* Learn tab — educational cards */
.mkt-learn-card {
    padding: 12px 14px; border-radius: 8px; background: var(--surface-2);
    border: 1px solid var(--border); margin-bottom: 10px;
}
.mkt-learn-term {
    font-size: 13px; font-weight: 700; color: var(--accent);
    display: flex; align-items: center; gap: 6px;
}
.mkt-learn-term .badge {
    font-size: 9px; padding: 1px 5px; border-radius: 3px;
    background: var(--accent-dim); color: var(--accent); font-weight: 600;
}
.mkt-learn-def {
    font-size: 12px; color: var(--text); margin-top: 6px; line-height: 1.5;
}
.mkt-learn-example {
    font-size: 11px; color: var(--text-muted); margin-top: 4px; font-style: italic;
}

/* Marketplace CTA button */
.mkt-cta {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600;
    background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff;
    border: none; cursor: pointer; transition: opacity 0.15s;
    white-space: nowrap;
}
.mkt-cta:hover { opacity: 0.9; }

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .rt-metrics { grid-template-columns: repeat(2, 1fr); }
    .supply-health-strip { grid-template-columns: repeat(3, 1fr); }
    .rt-rank-row { padding: 6px 8px; }
    .pp-v2-actions { flex-direction: column; }
    .pp-v2-action-btn { min-width: 100%; }

    /* Item card — compact single row on mobile, tap anywhere to open panel */
    .item-card {
        flex-direction: row;
        align-items: center;
        padding: 10px 8px;
        border-bottom: 1px solid var(--border, #e2e8f0);
        border-radius: 0;
        gap: 8px;
    }
    .item-card-top {
        flex: 1;
        min-width: 0;
        flex-wrap: nowrap;
    }
    .item-card-actions {
        flex-shrink: 0;
    }
    .item-card-actions .mkt-cta {
        padding: 6px 10px;
        font-size: 11px;
    }
    .item-card-actions .find-it-btn {
        display: none; /* hide on mobile — tap the row instead */
    }

    /* Marketplace panel → bottom sheet on mobile */
    .mkt-panel {
        top: auto;
        right: 0;
        bottom: -100%;
        left: 0;
        width: 100%;
        max-width: 100vw;
        height: 85vh;
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        transition: bottom 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mkt-panel-overlay.active .mkt-panel {
        right: 0;
        bottom: 0;
    }
    .mkt-panel-header {
        padding: 12px 16px;
    }
    .mkt-panel-header::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--border, #cbd5e1);
        border-radius: 2px;
        margin: 0 auto 8px;
    }
    .mkt-panel-hero { padding: 12px 16px; }
    .mkt-tab { font-size: 10px; padding: 8px 6px; }
    .mkt-tab-content { padding: 12px 16px; }
    .mkt-field { font-size: 12px; }
    .mkt-learn-card { padding: 10px 12px; }

    /* Ref num wraps on its own line on mobile */
    .ref-num { display: block; margin-left: 0; margin-top: 2px; }
}
