:root {
    --ink: #17213b;
    --navy: #292a57;
    --navy-deep: #1f2148;
    --blue: #4168aa;
    --gold: #c9a551;
    --gold-light: #e8d59c;
    --teal: #3b8a8b;
    --paper: #f6f7fb;
    --surface: #ffffff;
    --line: #e2e6ef;
    --muted: #6d7486;
    --soft: #eef1f7;
    --success: #217a55;
    --danger: #a53f49;
    --warning: #8a671d;
    --radius: 14px;
    --shadow: 0 16px 40px rgba(34, 40, 74, 0.09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.guest-body { background: var(--navy-deep); }
.guest-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 1.1fr) minmax(420px, .9fr); }
.guest-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: clamp(48px, 7vw, 110px); color: white; background: radial-gradient(circle at 74% 22%, rgba(201,165,81,.2), transparent 24%), linear-gradient(145deg, #272957 0%, #171934 100%); }
.guest-brand::after { content: "UNC"; position: absolute; right: -40px; bottom: 35px; color: rgba(255,255,255,.035); font-size: clamp(150px, 24vw, 360px); font-weight: 900; letter-spacing: -.12em; pointer-events: none; }
.guest-logo { width: min(265px, 70%); height: auto; filter: brightness(0) invert(1); opacity: .96; }
.guest-brand .eyebrow { color: var(--gold-light); }
.guest-brand h1 { max-width: 750px; margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(42px, 6vw, 82px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
.guest-copy { max-width: 620px; margin: 24px 0 0; color: rgba(255,255,255,.7); font-size: 17px; line-height: 1.7; }
.brand-rule { display: flex; gap: 8px; width: 180px; }
.brand-rule span { height: 4px; flex: 1; background: var(--gold); }
.brand-rule span:nth-child(2) { opacity: .55; }.brand-rule span:nth-child(3) { opacity: .2; }
.guest-panel { display: grid; place-items: center; padding: 40px; background: #fafbfe; }
.guest-panel-inner { width: min(100%, 510px); }
.auth-header { margin-bottom: 34px; }
.auth-header h2 { margin: 0; color: var(--navy); font-size: clamp(32px, 5vw, 48px); letter-spacing: -.04em; }
.auth-header > p:last-child { margin: 12px 0 0; color: var(--muted); line-height: 1.6; }
.stack-form { display: grid; gap: 20px; }
.auth-note { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.language-switch { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
.language-switch button { min-width: 34px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 900; cursor: pointer; }
.language-switch button.active { color: white; background: var(--navy); box-shadow: 0 3px 8px rgba(41,42,87,.18); }
.guest-language { width: max-content; margin: 0 0 28px auto; }

.field { display: grid; gap: 8px; }
.field > span { color: #454b60; font-size: 12px; font-weight: 800; letter-spacing: .025em; }
.field input, .field select { width: 100%; min-height: 48px; padding: 11px 14px; color: var(--ink); background: white; border: 1px solid #d9deea; border-radius: 9px; outline: none; transition: border .18s, box-shadow .18s; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(65,104,170,.12); }
.field small { color: var(--muted); font-size: 11px; }
.field-error input, .field-error select { border-color: var(--danger); }
.field .error-text { color: var(--danger); }

.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; font-size: 13px; text-decoration: none; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; background: var(--navy); box-shadow: 0 8px 18px rgba(41,42,87,.17); }
.button-primary:hover { background: #33366d; }
.button-secondary { color: var(--navy); background: white; border-color: var(--line); }
.button-full { width: 100%; min-height: 52px; }

.app-body { background: var(--paper); }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 280px; display: flex; flex-direction: column; color: white; background: linear-gradient(180deg, var(--navy) 0%, #202247 100%); box-shadow: 10px 0 35px rgba(20,24,52,.09); }
.sidebar-brand { min-height: 104px; display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-bottom: 1px solid rgba(255,255,255,.09); }
.sidebar-logo { width: 67px; height: auto; filter: brightness(0) invert(1); }
.product-name { display: grid; gap: 4px; }
.product-name strong { font-size: 14px; }.product-name span { color: rgba(255,255,255,.48); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.sidebar-close { display: none; margin-left: auto; color: white; background: transparent; border: 0; font-size: 28px; cursor: pointer; }
.navigation { flex: 1; overflow-y: auto; padding: 16px 12px 26px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-heading { margin: 24px 12px 8px; color: rgba(255,255,255,.4); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .16em; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; margin: 3px 0; padding: 8px 11px; border-radius: 8px; color: rgba(255,255,255,.72); font-size: 13px; text-decoration: none; transition: background .15s, color .15s; }
.nav-item:hover { color: white; background: rgba(255,255,255,.075); }
.nav-item.active { color: white; background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 var(--gold); }
.nav-mark { width: 28px; height: 26px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; color: var(--gold-light); background: rgba(255,255,255,.08); font-size: 9px; font-weight: 900; letter-spacing: .04em; }
.nav-item.disabled { color: rgba(255,255,255,.35); cursor: default; }.nav-item.disabled em { margin-left: auto; font-size: 9px; font-style: normal; color: rgba(255,255,255,.25); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.user-avatar { width: 37px; height: 37px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--navy); background: var(--gold-light); font-size: 11px; font-weight: 900; }
.user-meta { min-width: 0; flex: 1; display: grid; gap: 3px; }.user-meta strong, .user-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.user-meta strong { font-size: 11px; }.user-meta span { color: rgba(255,255,255,.45); font-size: 9px; }
.icon-button { width: 34px; height: 34px; color: rgba(255,255,255,.65); background: rgba(255,255,255,.07); border: 0; border-radius: 7px; cursor: pointer; }
.sidebar-backdrop { display: none; }

.main-column { width: calc(100% - 280px); min-height: 100vh; margin-left: 280px; }
.topbar { min-height: 104px; display: flex; align-items: center; gap: 18px; padding: 18px clamp(22px, 4vw, 56px); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.topbar-context { margin: 0 0 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }
.topbar h1 { margin: 0; color: var(--navy); font-size: 24px; letter-spacing: -.025em; }
.menu-button { display: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--navy); cursor: pointer; }
.topbar-status { margin-left: 4px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }.topbar-status span { width: 7px; height: 7px; border-radius: 50%; background: #36a66c; box-shadow: 0 0 0 4px rgba(54,166,108,.11); }
.content-area { padding: clamp(24px, 4vw, 54px); }

.flash { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 9px; background: white; font-size: 13px; box-shadow: 0 7px 18px rgba(25,31,56,.05); }
.flash span { flex: 1; }.flash button { border: 0; background: transparent; color: var(--muted); font-size: 18px; cursor: pointer; }
.flash-success { border-left: 4px solid var(--success); }.flash-error { border-left: 4px solid var(--danger); }.flash-warning { border-left: 4px solid var(--warning); }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-intro h2 { margin: 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 48px); font-weight: 500; letter-spacing: -.035em; }
.page-intro p:last-child { max-width: 720px; margin: 10px 0 0; color: var(--muted); line-height: 1.6; }
.phase-chip { align-self: center; padding: 8px 12px; border: 1px solid #d7c487; border-radius: 99px; color: #6f5719; background: #fbf7e9; font-size: 10px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 22px; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 16px; margin-bottom: 24px; }
.metric-card { position: relative; overflow: hidden; min-height: 166px; display: flex; flex-direction: column; padding: 23px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 24px rgba(36,44,76,.055); text-decoration: none; transition: transform .18s, box-shadow .18s; }
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-accent { position: absolute; inset: 0 auto 0 0; width: 5px; }.metric-accent.navy { background: var(--navy); }.metric-accent.gold { background: var(--gold); }.metric-accent.blue { background: var(--blue); }.metric-accent.teal { background: var(--teal); }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.metric-card strong { margin: 9px 0 auto; color: var(--navy); font-size: 42px; line-height: 1; }
.metric-link { color: var(--blue); font-size: 11px; font-weight: 800; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 24px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 8px 25px rgba(36,44,76,.045); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; color: var(--navy); font-size: 20px; }.panel-heading .eyebrow { margin-bottom: 5px; }
.roadmap-panel { padding-bottom: 14px; }
.roadmap-row { position: relative; display: grid; grid-template-columns: 42px 1fr 60px; align-items: center; gap: 12px; min-height: 68px; padding: 10px 26px; }
.roadmap-number { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: white; font-size: 11px; font-weight: 900; }
.roadmap-row strong, .roadmap-row small { display: block; }.roadmap-row strong { color: var(--ink); font-size: 13px; }.roadmap-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.roadmap-line { height: 3px; border-radius: 3px; background: var(--soft); }.roadmap-row.active .roadmap-number { color: white; background: var(--navy); border-color: var(--navy); }.roadmap-row.active .roadmap-line { background: var(--gold); }.roadmap-row.next .roadmap-number { color: var(--navy); border-color: var(--gold); }
.activity-list { padding: 10px 26px 18px; }
.activity-row { display: grid; grid-template-columns: 12px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }.activity-row:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--gold); }
.activity-row strong, .activity-row small { display: block; }.activity-row strong { color: var(--ink); font-size: 12px; text-transform: capitalize; }.activity-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }

.table-panel { overflow: hidden; }
.table-tools { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.table-tools > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.search-form { flex: 1; display: flex; align-items: center; gap: 8px; }.search-form input { width: min(100%, 380px); min-height: 40px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }.search-form input:focus { border-color: var(--blue); }.search-form button { min-height: 40px; padding: 8px 14px; color: white; background: var(--navy); border: 0; border-radius: 8px; font-weight: 800; cursor: pointer; }.search-form a { color: var(--blue); font-size: 11px; font-weight: 800; text-decoration: none; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 13px 18px; color: #62697c; background: #f8f9fc; border-bottom: 1px solid var(--line); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
td { padding: 16px 18px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }tbody tr:hover { background: #fbfcfe; }tbody tr:last-child td { border-bottom: 0; }
.actions-column { width: 90px; text-align: right; }.text-link { color: var(--blue); font-weight: 800; text-decoration: none; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 99px; color: #50576a; background: #edf0f5; font-size: 9px; font-weight: 900; text-transform: capitalize; white-space: nowrap; }
.status-active, .status-approved, .status-released { color: #216143; background: #e4f4ec; }.status-draft, .status-prospect { color: #6b591e; background: #f7efd2; }.status-blocked, .status-rejected, .status-discontinued { color: #85353e; background: #f9e5e7; }

.record-form { overflow: hidden; }
.form-section-heading { display: flex; gap: 15px; padding: 24px 28px; border-bottom: 1px solid var(--line); }.form-section-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--navy); font-size: 10px; font-weight: 900; }.form-section-heading h3 { margin: 0; color: var(--navy); font-size: 16px; }.form-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { display: grid; gap: 20px; }.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }.record-form > .form-grid { padding: 28px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 28px; background: #f9fafc; border-top: 1px solid var(--line); }
.empty-state { padding: 42px 24px; color: var(--muted); text-align: center; }.empty-state.large { padding: 80px 24px; }.empty-state strong { display: block; color: var(--ink); font-size: 14px; }.empty-state p { margin: 8px auto 0; max-width: 400px; font-size: 12px; line-height: 1.6; }.empty-mark { width: 46px; height: 46px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; color: var(--navy); background: var(--soft); font-size: 22px; }
.error-page { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 12px; text-align: center; }.error-page > span { color: var(--gold); font-size: 64px; font-weight: 900; }.error-page h2 { margin: 0; color: var(--navy); font-size: 30px; }.error-page p { margin: 0 0 14px; color: var(--muted); }

@media (max-width: 1120px) {
    .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(16,18,38,.5); }
    .sidebar-close, .menu-button { display: inline-grid; place-items: center; }
    .main-column { width: 100%; margin-left: 0; }
}

@media (max-width: 820px) {
    .guest-shell { grid-template-columns: 1fr; }
    .guest-brand { min-height: 310px; padding: 34px; gap: 35px; }.guest-brand h1 { font-size: 40px; }.guest-copy, .brand-rule { display: none; }.guest-logo { width: 180px; }
    .guest-panel { padding: 34px 22px 50px; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .page-intro { align-items: flex-start; flex-direction: column; }.page-intro .button { width: 100%; }
    .topbar-status { display: none; }
}

@media (max-width: 620px) {
    .topbar { min-height: 82px; padding: 14px 18px; }.topbar-context { display: none; }.topbar h1 { font-size: 19px; }.topbar .language-switch { margin-left: auto; }
    .content-area { padding: 24px 16px 44px; }
    .metric-grid { gap: 10px; }.metric-card { min-height: 140px; padding: 18px; }.metric-card strong { font-size: 34px; }
    .form-grid.two-columns { grid-template-columns: 1fr; }.record-form > .form-grid { padding: 22px 18px; }.form-actions { padding: 18px; }.form-actions .button { flex: 1; }
    .table-tools { align-items: flex-start; flex-direction: column; }.search-form { width: 100%; flex-wrap: wrap; }.search-form input { flex: 1; min-width: 180px; }
    table, thead, tbody, th, td, tr { display: block; } thead { position: absolute; width: 1px; height: 1px; overflow: hidden; }
    tbody tr { padding: 13px 16px; border-bottom: 1px solid var(--line); } tbody tr:last-child { border-bottom: 0; }
    td { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 7px 0; border: 0; text-align: left; } td::before { content: attr(data-label); color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }.actions-column { width: auto; text-align: left; }.actions-column::before { content: ""; }
}
