/* LabReady Pro app — layers on top of ../assets/labready.css */
.container { max-width: 1100px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.app-nav .nav-right { display: flex; align-items: center; gap: 0.8rem; font-size: 0.88rem; color: var(--muted); }
.app-nav .nav-right button { font-size: 0.85rem; padding: 0.45rem 0.9rem; }
.tabs { display: flex; gap: 0.2rem; overflow-x: auto; border-top: 1px solid var(--line); }
.tabs a {
    padding: 0.7rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600;
    font-size: 0.92rem; border-bottom: 3px solid transparent; white-space: nowrap;
}
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

.demo-banner { background: var(--warn-soft); color: #7c3d06; text-align: center; font-size: 0.85rem; padding: 0.5rem 16px; }
.demo-banner a { color: inherit; font-weight: 700; }

.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: 1.8rem 0 1.2rem; }
.view-head h1 { font-size: 1.6rem; letter-spacing: -0.02em; line-height: 1.2; }
.view-head p { color: var(--muted); font-size: 0.92rem; }
.view-head .actions { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; margin-bottom: 1.2rem; }
.stat-tile { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.stat-tile b { display: block; font-size: 1.7rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-tile span { color: var(--muted); font-size: 0.82rem; }
.stat-tile.overdue b { color: var(--danger); }
.stat-tile.due b { color: var(--warn); }
.stat-tile.complete b { color: var(--accent-dark); }

.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; padding: 0.5rem 0.7rem; font-size: 0.88rem; }

table.list { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; font-size: 0.9rem; }
table.list th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--bg); padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
table.list td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: none; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #f8fbfc; }
table.list td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-wrap { overflow-x: auto; margin-bottom: 1.5rem; }
.empty { background: white; border: 1px dashed var(--line); border-radius: 12px; padding: 2rem; text-align: center; color: var(--muted); }

.pill { font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; display: inline-block; }
.pill.complete { background: #dcfce7; color: var(--accent-dark); }
.pill.due { background: var(--warn-soft); color: var(--warn); }
.pill.overdue { background: var(--danger-soft); color: var(--danger); }
.pill.scheduled { background: var(--brand-soft); color: var(--brand); }
.pill.not-competent { background: var(--danger-soft); color: var(--danger); }

.progress { display: inline-flex; gap: 3px; vertical-align: middle; }
.progress i { width: 9px; height: 9px; border-radius: 2px; background: var(--line); display: block; }
.progress i.on { background: var(--brand); }

.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
.btn.danger { background: white; color: var(--danger); border: 1px solid #fecaca; }
.btn.danger:hover { background: var(--danger-soft); }

.form-card { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 1.3rem; margin-bottom: 1.2rem; }
.form-card h2 { font-size: 1.05rem; margin-bottom: 0.8rem; }
.form-row { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: flex-end; }
.form-row > div { flex: 1 1 180px; }
.form-row .btn { flex: none; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.3rem 1rem; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; }
.checks-grid label { display: flex; gap: 0.5rem; align-items: center; font-size: 0.9rem; cursor: pointer; }
.checks-grid input { accent-color: var(--brand); }

/* Competency record */
.record-head { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem 1.2rem; margin-bottom: 0.5rem; }
.record-head div span { display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.record-head div b { font-size: 0.95rem; }
.element { border-top: 1px solid var(--line); padding: 1rem 0; display: grid; grid-template-columns: 1.1fr 2fr; gap: 1rem; }
.element:first-of-type { border-top: none; }
.element h3 { font-size: 0.95rem; margin: 0 0 0.2rem; }
.element p { color: var(--muted); font-size: 0.82rem; }
.element .el-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.element .el-fields .full { grid-column: 1 / -1; }
.signoffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.signoff { border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem; }
.signoff h3 { font-size: 0.9rem; margin: 0 0 0.4rem; }
.signoff .signed { color: var(--accent-dark); font-size: 0.88rem; }
.signoff .signed small { display: block; color: var(--muted); }
.sticky-save { position: sticky; bottom: 0; background: rgba(245,248,250,0.95); padding: 0.8rem 0; border-top: 1px solid var(--line); display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; z-index: 5; }
.sticky-save .muted { font-size: 0.85rem; }

/* Auth */
.auth-wrap { max-width: 440px; margin: 3rem auto; }
.auth-wrap .card h1 { font-size: 1.4rem; margin-bottom: 0.4rem; }
.auth-wrap .or { text-align: center; color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }
.auth-wrap .stack { display: grid; gap: 0.7rem; }
.auth-wrap .btn { width: 100%; text-align: center; }
.linkish { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; font-size: 0.88rem; padding: 0; }
.error { color: var(--danger); font-size: 0.88rem; }

.toast {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(120%);
    background: var(--ink); color: white; padding: 0.7rem 1.1rem; border-radius: 10px; font-size: 0.9rem;
    transition: transform 0.25s, opacity 0.25s; z-index: 200; max-width: calc(100% - 32px);
    opacity: 0; pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.bad { background: var(--danger); }

.print-only { display: none; }

.history { list-style: none; border-left: 2px solid var(--line); margin-left: 0.3rem; }
.history li { position: relative; padding: 0 0 0.8rem 1rem; }
.history li::before { content: ""; position: absolute; left: -6px; top: 0.4rem; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.history li.ev-signed::before, .history li.ev-completed::before { background: var(--accent); }
.history li.ev-unsigned::before, .history li.ev-reopened::before, .history li.ev-deleted::before { background: var(--warn); }
.history li b { display: block; color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.history li span { color: var(--muted); font-size: 0.8rem; }

@media (max-width: 800px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .element { grid-template-columns: 1fr; gap: 0.5rem; }
    .element .el-fields { grid-template-columns: 1fr 1fr; }
    .signoffs, .record-head { grid-template-columns: 1fr 1fr; }
    table.list .hide-sm { display: none; }
    .app-nav .nav-right .who { display: none; }
}
@media (max-width: 480px) {
    .signoffs, .record-head { grid-template-columns: 1fr; }
    .element .el-fields { grid-template-columns: 1fr; }
}

@media print {
    .tabs, .demo-banner, .sticky-save, .toast, .view-head .actions, .no-print { display: none !important; }
    .print-only { display: block; }
    .form-card { border: 1px solid #999; break-inside: avoid; }
    input, select, textarea { border: none !important; padding: 0 !important; background: none !important; }
    select { appearance: none; }
    .element { break-inside: avoid; }
}
