/* Alpha Health server panels — replicates the HSCo ERP v2 design system
   (steel-grey + orange, light theme). Same file as
   ../../panel-mockups/erp-theme.css — kept here for Django static serving. */

:root {
  --bg: #f3f4f6; --s1: #ffffff; --s2: #f9fafb; --s3: #f0f1f3;
  --border: #e5e7eb; --border2: #d1d5db;
  --brand: #4b5563; --brand2: #374151; --brand3: #6b7280;
  --accent: #e97a1f; --accent2: #f59e0b; --accent-bg: #fef3e2;
  --teal: #0d9488; --sky: #2563eb; --rose: #dc2626; --violet: #7c3aed;
  --warn: #e97a1f; --red: #dc2626; --green: #16a34a;
  --text: #1f2937; --muted: #9ca3af; --muted2: #6b7280; --navy: #1e2a4a;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-heading: 'Syne', system-ui, sans-serif;
  --font-body: 'Karla', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Consolas', monospace;
  --radius: 8px; --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); font-family: var(--font-body); color: var(--text); min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--sky); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--text); }
h1 { font-size: 28px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.mono { font-family: var(--font-mono); }

.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: var(--s1); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 300; overflow-y: auto; }
.sidebar-logo { padding: 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.sidebar-logo .mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.sidebar-logo .name { font-family: var(--font-heading); font-weight: 700; font-size: 14px; color: var(--text); }
.sidebar-logo .name small { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: 1.5px; color: var(--muted2); text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 12px 0; list-style: none; }
.nav-section-title { font-family: var(--font-mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; padding: 9px 20px; margin-top: 4px; color: #fff; }
.nav-section-title.admin { background: #a0aebf; color: #2d3748; }
.nav-section-title.records { background: #7edcba; color: #1a4d3a; }
.nav-section-title.account { background: #93b8f7; color: #1e3a6e; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-size: 12.5px; font-weight: 500; color: var(--muted2); cursor: pointer; border-left: 3px solid transparent; white-space: nowrap; }
.nav-item:hover { background: var(--s2); color: var(--text); }
.nav-item.active { color: var(--accent); background: var(--accent-bg); border-left-color: var(--accent); font-weight: 600; }
.nav-item .icon { width: 18px; text-align: center; font-size: 14px; }
.nav-item .badge { margin-left: auto; background: var(--red); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.sidebar-footer { padding: 14px 20px; border-top: 1px solid var(--border); font-size: 10px; color: var(--muted); font-family: var(--font-mono); }

.main-content { margin-left: 220px; min-height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 28px; background: var(--s1); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; }
.topbar-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.owner-tag { background: var(--accent-bg); border: 1px solid var(--accent); padding: 6px 16px; font-family: var(--font-mono); font-size: 10px; color: var(--accent); letter-spacing: 2px; text-transform: uppercase; border-radius: 4px; }
.user-area { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; border-radius: 50%; }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { font-family: var(--font-mono); font-size: 9px; color: var(--muted2); }
.datetime { font-family: var(--font-mono); font-size: 10px; color: var(--muted); background: var(--s2); padding: 5px 12px; border: 1px solid var(--border); border-radius: 4px; }

.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 16px 28px; background: var(--bg); }
.kpi { padding: 14px 18px; background: var(--s1); border: 1px solid var(--border); border-top: 3px solid var(--kc, var(--accent)); border-radius: 10px; box-shadow: var(--shadow); position: relative; display: block; text-decoration: none; color: inherit; transition: box-shadow .15s, border-color .15s; }
a.kpi:hover { box-shadow: var(--shadow-md); border-color: var(--kc, var(--accent)); }
.kpi-label { font-family: var(--font-mono); font-size: 8px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted2); margin-bottom: 5px; }
.kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--kc, var(--accent)); line-height: 1; }
.kpi-sub { font-size: 10px; color: var(--muted); margin-top: 4px; }

.page-wrapper { padding: 22px 28px; display: flex; flex-direction: column; gap: 20px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.card-subtitle { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted2); letter-spacing: 1px; text-transform: uppercase; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th { text-align: left; padding: 9px 12px; font-family: var(--font-mono); font-size: 8.5px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.85); font-weight: 600; background: var(--navy); white-space: nowrap; }
thead th:first-child { border-top-left-radius: 6px; }
thead th:last-child { border-top-right-radius: 6px; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: var(--s2); }
tbody td { padding: 10px 12px; color: var(--muted2); vertical-align: middle; }
.td-name { color: var(--text); font-weight: 600; }
.td-gold { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--accent); }
.td-teal { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--teal); }
.td-mono { font-family: var(--font-mono); font-weight: 600; font-size: 12px; color: var(--text); }

.chip { display: inline-block; padding: 3px 9px; font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: .5px; border-radius: 4px; text-transform: uppercase; }
.chip-gold { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent); }
.chip-teal { background: #e6f7f4; color: var(--teal); border: 1px solid #9bd9d0; }
.chip-sky { background: #e8f0ff; color: var(--sky); border: 1px solid #b9d0f8; }
.chip-violet { background: #f1eafe; color: var(--violet); border: 1px solid #cdb6f5; }
.chip-grey { background: var(--s3); color: var(--muted2); border: 1px solid var(--border2); }
.pct { display: inline-block; font-family: var(--font-mono); font-size: 9.5px; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.pct-green { background: #e6f6ec; color: var(--green); border: 1px solid #b6e2c4; }
.pct-amber { background: #fef3e2; color: var(--warn); border: 1px solid #f4d4a6; }
.pct-red { background: #fdeaea; color: var(--rose); border: 1px solid #f4b6b6; }

.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border: none; border-radius: var(--radius); font-family: var(--font-body); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn-primary { background: var(--teal); color: #fff; } .btn-primary:hover { background: #0f766e; }
.btn-gold { background: var(--accent); color: #fff; font-weight: 700; } .btn-gold:hover { background: #d96d12; }
.btn-secondary { background: var(--s2); color: var(--text); border: 1px solid var(--border); } .btn-secondary:hover { background: var(--s3); }
.btn-danger { background: #fdeaea; color: var(--rose); border: 1px solid #f4b6b6; }
.btn-sm { padding: 6px 13px; font-size: 11.5px; }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted2); margin-bottom: 6px; font-weight: 600; }
.input, .select, .textarea { width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid var(--border); border-radius: var(--radius); font-family: var(--font-body); font-size: 14px; color: var(--text); background: var(--s1); outline: none; transition: border-color .15s; }
.textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 90px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); }
.field-hint { font-size: 11px; color: var(--muted); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--rose); margin-top: 5px; }

.profile-head { display: flex; align-items: center; gap: 18px; }
.profile-avatar { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 28px; }
.profile-meta h2 { font-size: 22px; }
.profile-meta .sub { font-family: var(--font-mono); font-size: 11px; color: var(--muted2); margin-top: 3px; }

.note { background: var(--s2); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.note .meta { font-family: var(--font-mono); font-size: 9px; color: var(--muted2); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.note .body { font-size: 13px; color: var(--text); }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f3f4f6, #fef3e2); padding: 20px; }
.login-card { background: var(--s1); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 400px; max-width: 100%; padding: 34px 32px; }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 6px; }
.login-brand .mark { width: 44px; height: 44px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 26px; display: flex; align-items: center; justify-content: center; }
.login-title { text-align: center; font-family: var(--font-heading); font-weight: 700; font-size: 18px; margin: 14px 0 2px; }
.login-sub { text-align: center; font-family: var(--font-mono); font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted2); margin-bottom: 24px; }

.muted-line { font-size: 12px; color: var(--muted2); }
.right { margin-left: auto; }
.flex { display: flex; align-items: center; gap: 10px; }
.empty-state { text-align: center; padding: 30px 20px; color: var(--muted); }
.empty-state p { font-size: 13px; margin-top: 8px; }
