/* Premier Connect — shell styles. Palette lifted from the mockup (reference/premier-connect.html). */
:root {
    --navy: #0e2a47;
    --amber: #f2a13b;
    --amber-d: #d8851d;
    --green: #7ab648;
    --green-d: #5f9636;
    --ink: #1b2733;
    --muted: #5e6b7a;
    --line: #e4e9ef;
    --bg: #f4f6f9;
    --card: #ffffff;
    --good: #1f9d63;
    --bad: #d6492f;
    --warn: #e0a106;
    --topbar-h: 56px;
    --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

h1, h2, h3 { color: var(--navy); }
h1:focus { outline: none; }
code { color: #c02d76; }

/* ---------- App frame ---------- */
.pc-app { min-height: 100vh; }

.pc-topbar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h);
    display: flex; align-items: center; gap: 14px; padding: 0 16px;
    background: var(--navy); color: #fff; z-index: 40;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.pc-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.pc-logo-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--amber), var(--amber-d));
    color: var(--navy); font-weight: 800; font-size: 18px;
}
.pc-logo-lg { width: 56px; height: 56px; border-radius: 14px; font-size: 30px; }
.pc-wordmark { display: flex; flex-direction: column; line-height: 1; }
.pc-wordmark .w1 { font-size: 11px; letter-spacing: 3px; color: var(--amber); font-weight: 700; }
.pc-wordmark .w2 { font-size: 15px; letter-spacing: 2px; font-weight: 700; }
.pc-wordmark-lg .w1 { font-size: 14px; }
.pc-wordmark-lg .w2 { font-size: 22px; }

.pc-spacer { flex: 1; }

.pc-search {
    display: flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,.12); border-radius: 8px; padding: 6px 10px; min-width: 220px;
}
.pc-search input {
    background: transparent; border: 0; outline: 0; color: #fff; width: 100%; font-size: 13px;
}
.pc-search input::placeholder { color: rgba(255,255,255,.6); }
.pc-search-icon { opacity: .8; font-size: 13px; }

.pc-iconbtn {
    background: transparent; border: 0; color: #fff; font-size: 17px; cursor: pointer;
    width: 34px; height: 34px; border-radius: 8px;
}
.pc-iconbtn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.pc-iconbtn:disabled { opacity: .5; cursor: default; }
.pc-menu-toggle { font-size: 18px; }

/* User chip + hover menu */
.pc-user { position: relative; }
.pc-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--green); color: #fff; font-weight: 700; font-size: 13px; cursor: default;
}
.pc-avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.pc-user .pc-usermenu {
    position: absolute; right: 0; top: 42px; background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 190px;
    box-shadow: 0 8px 24px rgba(0,0,0,.16); display: none;
}
.pc-user:hover .pc-usermenu { display: block; }
.pc-usermenu-name { font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.pc-signout {
    width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
    border-radius: 8px; padding: 7px; cursor: pointer; font-size: 13px;
}
.pc-signout:hover { background: #eef1f5; }

/* ---------- Body: sidebar + main ---------- */
.pc-body { display: flex; padding-top: var(--topbar-h); min-height: 100vh; }

.pc-sidebar {
    position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
    background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column;
    transition: transform .18s ease;
}
.sidebar-collapsed .pc-sidebar { transform: translateX(-100%); }
.pc-side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.pc-side-title { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.pc-side-search {
    display: flex; align-items: center; gap: 6px; margin-top: 10px;
    background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px;
}
.pc-side-search input { background: transparent; border: 0; outline: 0; width: 100%; font-size: 13px; color: var(--ink); }
.pc-nav-scroll { flex: 1; overflow-y: auto; padding: 12px; }
.pc-nav-empty { color: var(--muted); font-size: 13px; padding: 10px; text-align: center; }
.pc-side-foot { padding: 12px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.pc-main {
    flex: 1; margin-left: var(--sidebar-w); padding: 28px 32px; transition: margin .18s ease;
}
.sidebar-collapsed .pc-main { margin-left: 0; }

/* ---------- Content ---------- */
.pc-h1 { font-size: 26px; margin: 0 0 6px; }
.pc-lede { color: var(--muted); margin: 0 0 22px; }
.pc-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 620px; box-shadow: 0 1px 3px rgba(16,32,54,.05); }
.pc-card-error { border-color: var(--bad); color: var(--bad); }
.pc-muted { color: var(--muted); }
.pc-small { font-size: 12.5px; }
.pc-mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; }

.pc-profile { display: flex; align-items: center; gap: 16px; }
.pc-profile-name { font-weight: 700; font-size: 17px; color: var(--navy); }
.pc-profile-sub { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }

.pc-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.pc-badge-active { background: rgba(31,157,99,.14); color: var(--good); }
.pc-badge-disabled { background: rgba(214,73,47,.14); color: var(--bad); }

.pc-facts { display: flex; gap: 40px; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.pc-facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.pc-facts dd { margin: 4px 0 0; font-weight: 600; }

/* ---------- Buttons ---------- */
.pc-btn { display: inline-block; border: 0; border-radius: 9px; padding: 11px 18px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; }
.pc-btn-primary { background: linear-gradient(135deg, var(--amber), var(--amber-d)); color: var(--navy); }
.pc-btn-primary:hover:not(:disabled) { filter: brightness(1.04); }
.pc-btn:disabled { opacity: .65; cursor: default; }

/* ---------- Login ---------- */
.pc-login-shell, .pc-splash { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 50% -10%, #17385c, var(--navy)); }
.pc-splash { color: #fff; }
.pc-login-card { background: #fff; border-radius: 18px; padding: 40px 36px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); text-align: center; }
.pc-login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 8px; }
.pc-login-brand .pc-wordmark { align-items: center; }
.pc-login-sub { color: var(--muted); font-size: 14px; margin: 6px 0 22px; }
.pc-login-card .pc-btn-primary { width: 100%; padding: 13px; font-size: 15px; }
.pc-login-note { color: var(--muted); font-size: 12px; margin-top: 14px; }
.pc-login-error { background: rgba(214,73,47,.1); color: var(--bad); border-radius: 8px; padding: 10px; font-size: 13px; margin-bottom: 16px; }

/* ---------- Sidebar nav links ---------- */
.pc-nav-link { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.pc-nav-link:hover { background: var(--bg); }
.pc-nav-link.active { background: rgba(242,161,59,.16); color: var(--navy); font-weight: 600; }
.pc-nav-ico { width: 18px; text-align: center; }
.pc-nav-group { margin: 14px 8px 4px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ---------- Admin pages ---------- */
.pc-h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy); }
.pc-strong { font-weight: 600; color: var(--ink); }
.pc-right { text-align: right; }
.pc-mt { margin-top: 8px; }
.pc-breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.pc-breadcrumb a { color: var(--muted); }

.pc-toolbar { margin-bottom: 16px; }
.pc-input { padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; color: var(--ink); }
select.pc-input { min-width: 120px; }
.pc-input-wide { display: block; width: 100%; max-width: 560px; margin-bottom: 10px; box-sizing: border-box; }
.pc-textarea { min-height: 90px; resize: vertical; font-family: inherit; }

.pc-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pc-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.pc-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.pc-table tr:last-child td { border-bottom: 0; }
.pc-table-tight td, .pc-table-tight th { padding: 8px 12px; }
.pc-row { cursor: pointer; }
.pc-row:hover td { background: var(--bg); }

.pc-panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(16,32,54,.04); }
.pc-panel-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; gap: 12px; }

.pc-columns { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.pc-col { flex: 1; min-width: 320px; }
.pc-col-narrow { flex: 0 0 300px; }
.pc-profile-head { margin-bottom: 18px; }

.pc-form-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.pc-btn-sm { padding: 8px 14px; font-size: 13px; }
.pc-link-danger { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 13px; padding: 0; }
.pc-link-danger:hover { text-decoration: underline; }

.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-family: ui-monospace, Consolas, monospace; color: var(--ink); }

.pc-badge-system { background: rgba(14,42,71,.1); color: var(--navy); }
.pc-badge-custom { background: rgba(242,161,59,.18); color: var(--amber-d); }
.pc-badge-grant { background: rgba(31,157,99,.14); color: var(--good); }
.pc-badge-deny { background: rgba(214,73,47,.14); color: var(--bad); }

.pc-tree-row { display: flex; align-items: center; gap: 9px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.pc-tree-row:last-child { border-bottom: 0; }
.pc-tree-type { width: 20px; text-align: center; }

/* ---------- Tools / launcher ---------- */
.pc-section { margin-top: 30px; }
.pc-badge-kind { background: rgba(14,42,71,.1); color: var(--navy); }
.pc-badge-legacy { background: rgba(224,161,6,.16); color: var(--warn); }
.pc-tool-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.pc-tool-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; width: 200px; box-shadow: 0 1px 3px rgba(16,32,54,.05); }
.pc-tool-name { font-weight: 700; color: var(--navy); margin-bottom: 2px; }
.pc-tool-card .pc-btn { margin-top: 12px; }

/* ---------- Blazor framework UI (from template; index.html depends on these) ---------- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); box-sizing: border-box;
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #b32121; padding: 1rem 1rem 1rem 1rem; color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.loading-progress {
    position: absolute; display: block; width: 8rem; height: 8rem; inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle {
    fill: none; stroke: #e0e0e0; stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--amber);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }
