/*
 * facility-pages-2026-06-17.css
 * Forms + simple table + 4-state status segmented + vital cards + status timeline.
 * For /facility/submit, /facility/requests, /facility/status.
 */

/* Breadcrumb */
.appshell .breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.appshell .breadcrumb a { color: var(--muted); text-decoration: none; }
.appshell .breadcrumb a:hover { color: var(--hra-purple); text-decoration: underline; }
.appshell .breadcrumb .sep { opacity: 0.4; }

/* Page header w/ actions */
.appshell .pg-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.appshell .pg-header .pg-title { margin: 0 0 4px; font-size: 22px; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.appshell .pg-header .pg-sub { margin: 0; font-size: 13px; color: var(--muted); max-width: 64ch; }
.appshell .pg-header .pg-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* fac-layout: 2-col form + aside */
.appshell .fac-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: flex-start; }
@media (max-width: 1100px) { .appshell .fac-layout { grid-template-columns: 1fr; } }
.appshell .fac-aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
@media (max-width: 1100px) { .appshell .fac-aside { position: static; } }
.appshell .aside-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.appshell .aside-card h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.appshell .aside-card p { margin: 0 0 10px; font-size: 12.5px; color: var(--text); line-height: 1.5; }
.appshell .aside-card.tinted { background: linear-gradient(180deg, var(--hra-lavender-bg) 0%, var(--surface) 100%); border-color: var(--hra-lavender); }
.appshell .aside-card ol { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text); line-height: 1.55; }
.appshell .aside-card ol li { margin-bottom: 6px; }

/* Section card (form section) */
.appshell .section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 22px 24px; margin-bottom: 16px; }
.appshell .section-card h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--ink); }
.appshell .section-card .sub { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }

/* Field block */
.appshell .fld { margin-bottom: 14px; }
.appshell .fld label { display: block; font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.appshell .fld .req { color: var(--critical); }
.appshell .fld .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.appshell .fld input[type="text"], .appshell .fld input[type="date"], .appshell .fld input[type="tel"], .appshell .fld textarea, .appshell .fld select { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); }
.appshell .fld textarea { min-height: 80px; resize: vertical; }
.appshell .fld input:focus, .appshell .fld textarea:focus, .appshell .fld select:focus { outline: 2px solid var(--hra-lavender); outline-offset: 0; border-color: var(--hra-purple-light); }
.appshell .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .appshell .row2 { grid-template-columns: 1fr; } }

/* Category chip row (multi-select) */
.appshell .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.appshell .chip-row label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; background: var(--surface); color: var(--text); }
.appshell .chip-row label:hover { border-color: var(--hra-lavender); background: var(--hra-lavender-bg); }
.appshell .chip-row label:has(input:checked) { background: var(--hra-lavender-bg); border-color: var(--hra-purple-light); color: var(--hra-purple); font-weight: 600; }
.appshell .chip-row input { display: none; }

/* Priority segmented control */
.appshell .seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 640px) { .appshell .seg { grid-template-columns: repeat(2, 1fr); } }
.appshell .seg label { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text); background: var(--surface); }
.appshell .seg input { display: none; }
.appshell .seg .ld { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.appshell .seg label.crit .ld { background: var(--critical); }
.appshell .seg label.hi .ld { background: var(--warning); }
.appshell .seg label.med .ld { background: var(--hra-purple-light); }
.appshell .seg label.lo .ld { background: var(--success); }
.appshell .seg label:has(input:checked) { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hra-purple); }

/* Form footer */
.appshell .form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.appshell .form-foot .save-hint { font-size: 11.5px; color: var(--muted); }
.appshell .form-foot .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Summary row (3 cards for requests page) */
.appshell .summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 768px) { .appshell .summary-row { grid-template-columns: 1fr; } }
.appshell .sum-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; gap: 12px; }
.appshell .sum-card .ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.appshell .sum-card .ico svg { width: 16px; height: 16px; }
.appshell .sum-card.open .ico { background: var(--hra-lavender-bg); color: var(--hra-purple); }
.appshell .sum-card.prog .ico { background: var(--warning-bg); color: var(--warning); }
.appshell .sum-card.done .ico { background: var(--success-bg); color: var(--success); }
.appshell .sum-card .n { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1; }
.appshell .sum-card .l { font-size: 12px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.appshell .sum-card .l small { display: block; font-size: 11px; margin-top: 2px; }

/* Requests table */
.appshell .req-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.appshell .rt-toolbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.appshell .rt-toolbar .rt-search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.appshell .rt-toolbar .rt-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--muted); }
.appshell .rt-toolbar .rt-search input { width: 100%; height: 32px; border: 1px solid var(--border); border-radius: 7px; padding: 0 10px 0 30px; font: inherit; font-size: 13px; }
.appshell .rt-toolbar select { font: inherit; font-size: 12.5px; border: 1px solid var(--border); border-radius: 7px; padding: 5px 26px 5px 10px; background: var(--surface); height: 32px; }
.appshell .rt-toolbar .seg-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.appshell .rt-toolbar .seg-tabs button { font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); background: transparent; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; }
.appshell .rt-toolbar .seg-tabs button.active { background: var(--surface); color: var(--hra-purple); font-weight: 600; box-shadow: 0 1px 2px rgba(20,16,42,0.06); }

.appshell .rt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.appshell .rt-table th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); background: var(--surface-2); padding: 10px 18px; border-bottom: 1px solid var(--border-2); }
.appshell .rt-table td { padding: 14px 18px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
.appshell .rt-table tr:last-child td { border-bottom: none; }
.appshell .rt-table tr:hover td { background: var(--surface-2); }
.appshell .rt-table .req-num { font-size: 11px; font-weight: 600; color: var(--hra-purple); display: block; margin-bottom: 2px; }
.appshell .rt-table .item-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.appshell .rt-table .item-cat { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.appshell .rt-table .stage { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.appshell .rt-table .stage::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.appshell .rt-table .stage.open { background: var(--hra-lavender-bg); color: var(--hra-purple); }
.appshell .rt-table .stage.inprogress { background: var(--warning-bg); color: var(--warning); }
.appshell .rt-table .stage.completed { background: var(--success-bg); color: var(--success); }
.appshell .rt-table .pledged { font-size: 12px; color: var(--text); }
.appshell .rt-table .pledged b { color: var(--ink); font-weight: 600; }
.appshell .rt-table .pledged small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.appshell .rt-table .when b { color: var(--ink); font-weight: 600; display: block; }
.appshell .rt-table .when small { color: var(--muted); font-size: 11px; }
.appshell .rt-table .priority { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; }
.appshell .rt-table .priority::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.appshell .rt-table .priority.critical { background: var(--critical-bg); color: var(--critical); }
.appshell .rt-table .priority.high { background: var(--warning-bg); color: var(--warning); }
.appshell .rt-table .priority.medium { background: var(--hra-lavender-bg); color: var(--hra-purple); }

/* Status 4-state segmented (the key README rule) */
.appshell .status-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 768px) { .appshell .status-seg { grid-template-columns: 1fr; } }
.appshell .status-seg label { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 9px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: var(--text); background: var(--surface); }
.appshell .status-seg input { display: none; }
.appshell .status-seg label .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.appshell .status-seg label.green .dot { background: var(--status-green); }
.appshell .status-seg label.yellow .dot { background: var(--status-yellow); }
.appshell .status-seg label.red .dot { background: var(--status-red); }
.appshell .status-seg label.pink .dot { background: var(--status-pink); }
.appshell .status-seg label.green:has(input:checked) { background: var(--status-green-bg); border-color: var(--status-green); }
.appshell .status-seg label.yellow:has(input:checked) { background: var(--status-yellow-bg); border-color: var(--status-yellow); }
.appshell .status-seg label.red:has(input:checked) { background: var(--status-red-bg); border-color: var(--status-red); }
.appshell .status-seg label.pink:has(input:checked) { background: var(--status-pink-bg); border-color: var(--status-pink); }
.appshell .status-seg label b { color: var(--ink); }

/* Vital cards grid */
.appshell .vital-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 768px) { .appshell .vital-grid { grid-template-columns: 1fr; } }
.appshell .vital-card { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.appshell .vital-card .v-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--hra-lavender-bg); color: var(--hra-purple); display: grid; place-items: center; flex-shrink: 0; }
.appshell .vital-card .v-ico svg { width: 18px; height: 18px; }
.appshell .vital-card h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.appshell .vital-card p { margin: 0 0 10px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* Status history timeline */
.appshell .s-timeline { position: relative; padding-left: 18px; }
.appshell .s-timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 1px; }
.appshell .s-tli { position: relative; padding-bottom: 14px; }
.appshell .s-tli::before { content: ""; position: absolute; left: -18px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--hra-purple); border: 2px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border); }
.appshell .s-tli.green::before { background: var(--status-green); }
.appshell .s-tli.yellow::before { background: var(--status-yellow); }
.appshell .s-tli.red::before { background: var(--status-red); }
.appshell .s-tli .when { font-size: 10.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 2px; }
.appshell .s-tli .what { font-size: 12.5px; color: var(--ink); font-weight: 500; line-height: 1.4; }
.appshell .s-tli .what b { font-weight: 600; }
.appshell .s-tli .by { font-size: 11px; color: var(--muted); margin-top: 2px; }
