﻿/* =============================================================================================
   Gurori PMS – Console.Web design system
   Tokens are shared with MudBlazor (Components/Layout/GuroriTheme.cs) and the MAUI app
   (Resources/Styles/Colors.xaml). Signature: the Safety Amber / Site Navy hazard stripe, used only at
   the top edge of the portal and on the sign-in panel. Everything else stays quiet.
   ============================================================================================= */
:root {
    --gp-navy: #14304A;          /* Site Navy – primary, navigation */
    --gp-navy-2: #1C4063;        /* hover / raised navy */
    --gp-amber: #F5B301;         /* Safety Amber – signature, primary action */
    --gp-amber-2: #DDA000;
    --gp-bg: #F3F5F7;            /* Survey Grey – page */
    --gp-surface: #FFFFFF;
    --gp-ink: #0E1C2B;           /* body text */
    --gp-steel: #5A6B7D;         /* Rebar Steel – secondary text */
    --gp-line: #DDE2E8;
    --gp-go: #2F855A;            /* status: on track / approved */
    --gp-hold: #C77700;          /* status: on hold / at risk */
    --gp-stop: #C53030;          /* status: overdue / error */
    --gp-review: #2B6CB0;        /* status: submitted / in review */

    --gp-font-display: "Barlow Condensed", "Barlow", "Segoe UI", sans-serif;
    --gp-font-body: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
    --gp-font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;

    --gp-radius: 6px;
    --gp-shadow: 0 1px 2px rgba(14, 28, 43, .06), 0 4px 16px rgba(14, 28, 43, .05);
    --gp-hazard: repeating-linear-gradient(-45deg, var(--gp-amber) 0 12px, var(--gp-navy) 12px 24px);
}

html, body {
    margin: 0;
    background: var(--gp-bg);
    color: var(--gp-ink);
    font-family: var(--gp-font-body);
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

*:focus-visible {
    outline: 3px solid var(--gp-amber);
    outline-offset: 2px;
}

.gp-icon { display: inline-block; flex: none; vertical-align: middle; }

/* ---------------------------------------------------------------- shell */
.gp-appbar.mud-appbar {
    background: var(--gp-surface);
    color: var(--gp-ink);
    border-bottom: 1px solid var(--gp-line);
}

.gp-appbar.mud-appbar::before {             /* signature hazard stripe */
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: var(--gp-hazard);
}

.gp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: var(--gp-radius);
    background: transparent;
    cursor: pointer;
}

.gp-icon-btn:hover { background: var(--gp-bg); }

.gp-user { display: flex; align-items: center; gap: 10px; margin-right: 8px; }

.gp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gp-navy);
    color: #fff;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: .03em;
}

.gp-user-text { display: flex; flex-direction: column; line-height: 1.15; }
.gp-user-name { font-weight: 600; font-size: 14px; }
.gp-user-role { font-size: 12px; color: var(--gp-steel); }
.gp-signout { margin: 0; }

.gp-drawer.mud-drawer { background: var(--gp-navy); color: #fff; }

.gp-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.gp-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.gp-brand-name { font-family: var(--gp-font-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.gp-brand-sub { font-size: 12px; color: rgba(255, 255, 255, .64); }

.gp-nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; }

.gp-nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: var(--gp-radius);
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
    font-weight: 500;
}

.gp-nav-link .gp-icon { opacity: .78; }
.gp-nav-link:hover { background: var(--gp-navy-2); color: #fff; }

.gp-nav-link.active {
    background: var(--gp-navy-2);
    color: #fff;
    font-weight: 600;
}

.gp-nav-link.active .gp-icon { opacity: 1; }

.gp-nav-link.active::before {               /* amber marker, like a site-board tab */
    content: "";
    position: absolute;
    left: -10px;
    top: 8px;
    bottom: 8px;
    width: 4px;
    border-radius: 0 3px 3px 0;
    background: var(--gp-amber);
}

.gp-main { min-height: 100vh; }
.gp-page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }

/* ---------------------------------------------------------------- page header */
.gp-page-header { margin-bottom: 28px; }

.gp-eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gp-steel);
}

.gp-title {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: 40px;
    line-height: 1.05;
    letter-spacing: .005em;
}

.gp-lead { margin: 8px 0 0; max-width: 64ch; color: var(--gp-steel); font-size: 16px; }

.gp-section-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }

.gp-section-title {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 22px;
}

.gp-count {
    font-family: var(--gp-font-mono);
    font-size: 13px;
    color: var(--gp-steel);
}

/* ---------------------------------------------------------------- cards */
.gp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.gp-card {
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    padding: 18px 20px;
}

.gp-project {
    display: flex;
    flex-direction: column;
    gap: 6px;
    animation: gp-rise .45s ease-out both;
    animation-delay: calc(var(--i, 0) * 60ms);
}

.gp-project-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.gp-code {
    font-family: var(--gp-font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--gp-bg);
    color: var(--gp-navy);
    border: 1px solid var(--gp-line);
}

.gp-project-name {
    margin: 6px 0 0;
    font-family: var(--gp-font-display);
    font-weight: 600;
    font-size: 22px;
    line-height: 1.15;
}

.gp-project-client { margin: 0; color: var(--gp-steel); }

.gp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.gp-meta dt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--gp-steel); }
.gp-meta dd { margin: 3px 0 0; font-weight: 600; }

.gp-money {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--gp-line);
    font-size: 13px;
    color: var(--gp-steel);
}

.gp-money strong { font-family: var(--gp-font-mono); font-size: 15px; font-weight: 500; color: var(--gp-ink); }

/* Status pills – colour always paired with a word, never colour alone. */
.gp-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: #EEF1F4;
    color: var(--gp-steel);
}

.gp-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.gp-status-active { background: #E6F4EC; color: var(--gp-go); }
.gp-status-onhold { background: #FFF3DC; color: var(--gp-hold); }
.gp-status-completed { background: #E7F0FA; color: var(--gp-review); }
.gp-status-closed, .gp-status-tender { background: #EEF1F4; color: var(--gp-steel); }

.gp-skeleton {
    min-height: 190px;
    background: linear-gradient(90deg, #fff 0%, #F0F3F6 50%, #fff 100%);
    background-size: 200% 100%;
    animation: gp-shimmer 1.2s linear infinite;
}

/* ---------------------------------------------------------------- empty / alerts */
.gp-empty {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 28px;
    background: var(--gp-surface);
    border: 1px dashed #C9D1DA;
    border-radius: var(--gp-radius);
    max-width: 720px;
}

.gp-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: #FFF6DB;
    flex: none;
}

.gp-empty h2 { margin: 2px 0 6px; font-family: var(--gp-font-display); font-weight: 600; font-size: 22px; }
.gp-empty p { margin: 0; color: var(--gp-steel); }

.gp-alert {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: var(--gp-radius);
    background: #FDECEC;
    color: var(--gp-stop);
    font-weight: 500;
}

/* ---------------------------------------------------------------- buttons */
.gp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: var(--gp-radius);
    border: 1px solid transparent;
    font-family: var(--gp-font-body);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.gp-btn-primary { background: var(--gp-amber); color: var(--gp-navy); }
.gp-btn-primary:hover { background: var(--gp-amber-2); }
.gp-btn-secondary { background: #fff; color: var(--gp-navy); border-color: #C9D1DA; }
.gp-btn-secondary:hover { border-color: var(--gp-navy); }
.gp-btn-ghost { background: transparent; color: var(--gp-ink); }
.gp-btn-ghost:hover { background: var(--gp-bg); }
.gp-btn-block { width: 100%; min-height: 48px; margin-top: 22px; font-size: 16px; }

/* ---------------------------------------------------------------- account (static SSR) pages */
.gp-account { display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; min-height: 100vh; }

.gp-account-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 40px 48px 56px;
    background: var(--gp-navy);
    color: #fff;
    overflow: hidden;
}

.gp-account-panel .gp-hazard {
    position: absolute;
    inset: auto 0 0 0;
    height: 14px;
    background: var(--gp-hazard);
}

.gp-account-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: 24px;
    letter-spacing: .02em;
}

.gp-account-kicker {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gp-amber);
}

.gp-account-headline {
    margin: 0;
    font-family: var(--gp-font-display);
    font-weight: 700;
    font-size: clamp(40px, 4.4vw, 60px);
    line-height: 1.02;
}

.gp-account-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 14px; color: rgba(255, 255, 255, .86); }
.gp-account-points li { display: flex; align-items: center; gap: 12px; font-size: 16px; }

.gp-account-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.gp-account-card {
    width: 100%;
    max-width: 420px;
    background: var(--gp-surface);
    border: 1px solid var(--gp-line);
    border-radius: 10px;
    box-shadow: var(--gp-shadow);
    padding: 36px 36px 32px;
    box-sizing: border-box;
}

.gp-account-brand-compact { display: none; margin-bottom: 20px; color: var(--gp-navy); font-size: 22px; }
.gp-account-foot { max-width: 420px; margin: 18px 0 0; font-size: 13px; color: var(--gp-steel); text-align: center; }

.gp-form-title { margin: 0; font-family: var(--gp-font-display); font-weight: 700; font-size: 32px; line-height: 1.1; }
.gp-form-lead { margin: 6px 0 18px; color: var(--gp-steel); }

.gp-account-card label { display: block; margin: 16px 0 6px; font-size: 14px; font-weight: 600; }

.gp-field {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid #C9D1DA;
    border-radius: var(--gp-radius);
    background: #fff;
}

.gp-field:focus-within { border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }

.gp-field input {
    flex: 1;
    min-width: 0;
    height: 46px;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--gp-font-body);
    font-size: 16px;
    color: var(--gp-ink);
}

.gp-field input.gp-code-input { font-family: var(--gp-font-mono); font-size: 22px; letter-spacing: .3em; }

.gp-form-error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: var(--gp-radius);
    background: #FDECEC;
    color: var(--gp-stop);
    font-weight: 500;
}

.gp-account-card .validation-message { margin-top: 4px; font-size: 13px; color: var(--gp-stop); }
.gp-hint { margin: 12px 0 0; font-size: 13px; color: var(--gp-steel); }

.gp-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px; margin-bottom: 4px; border-radius: var(--gp-radius); background: #FFF6DB; }
.gp-step p { margin: 0; }

.gp-steps { margin: 0 0 12px; padding-left: 20px; color: var(--gp-ink); }
.gp-steps li { margin: 4px 0; }

.gp-secret { padding: 14px; margin: 12px 0 4px; border-radius: var(--gp-radius); background: var(--gp-bg); border: 1px solid var(--gp-line); }
.gp-secret-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-steel); }
.gp-secret-key { display: block; margin: 6px 0 12px; font-family: var(--gp-font-mono); font-size: 18px; letter-spacing: .08em; color: var(--gp-navy); }
.gp-secret-uri { font-size: 12px; word-break: break-all; color: var(--gp-review); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
    .gp-account { grid-template-columns: 1fr; }
    .gp-account-panel { display: none; }
    .gp-account-brand-compact { display: flex; }
    .gp-account-main { border-top: 6px solid transparent; border-image: var(--gp-hazard) 1; }
}

@media (max-width: 600px) {
    .gp-page { padding: 20px 16px 40px; }
    .gp-title { font-size: 32px; }
    .gp-user-text, .gp-signout span { display: none; }
    .gp-card-grid { grid-template-columns: 1fr; }
    .gp-account-card { padding: 28px 20px; }
}


/* =============================================================================================
   Admin & data screens (P3): tables, forms, toolbars. Quiet by design – amber only for primary actions.
   ============================================================================================= */
.gp-muted { color: var(--gp-steel); }
.gp-strong { font-weight: 600; }
.gp-mono { font-family: var(--gp-font-mono); font-size: .92em; }
.gp-nowrap { white-space: nowrap; }
.gp-section-gap { margin-top: 36px; }

.gp-subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: -12px 0 24px; border-bottom: 1px solid var(--gp-line); }
.gp-subnav-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: -1px;
    color: var(--gp-steel); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent;
}
.gp-subnav-link:hover { color: var(--gp-ink); }
.gp-subnav-link.active { color: var(--gp-navy); font-weight: 600; border-bottom-color: var(--gp-amber); }

.gp-hub { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s ease; }
.gp-hub:hover { border-color: var(--gp-navy); }
.gp-hub-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; background: #FFF6DB; margin-bottom: 6px; }
.gp-hub-title { font-family: var(--gp-font-display); font-weight: 600; font-size: 22px; }
.gp-hub-text { color: var(--gp-steel); }

.gp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.gp-toolbar-spacer { flex: 1; }
.gp-search { display: flex; align-items: center; gap: 8px; min-width: 280px; flex: 1 1 280px; max-width: 420px;
    padding: 0 12px; background: #fff; border: 1px solid #C9D1DA; border-radius: var(--gp-radius); }
.gp-search:focus-within { border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }
.gp-search input { flex: 1; height: 40px; border: 0; outline: none; font: inherit; background: transparent; }

.gp-input, .gp-select {
    height: 40px; padding: 0 10px; box-sizing: border-box; font: inherit; color: var(--gp-ink);
    background: #fff; border: 1px solid #C9D1DA; border-radius: var(--gp-radius);
}
.gp-input:focus, .gp-select:focus { outline: none; border-color: var(--gp-navy); box-shadow: 0 0 0 3px rgba(245, 179, 1, .35); }
.gp-input:disabled { background: var(--gp-bg); color: var(--gp-steel); }
.gp-narrow { width: 120px; }
.gp-tiny { width: 72px; height: 34px; }
.gp-inline-label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--gp-steel); }

.gp-table-card { padding: 0; overflow-x: auto; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gp-table th {
    text-align: left; padding: 10px 14px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--gp-steel); background: #F8FAFB; border-bottom: 1px solid var(--gp-line); white-space: nowrap;
}
.gp-table td { padding: 10px 14px; border-bottom: 1px solid #EEF1F4; vertical-align: top; }
.gp-table tbody tr:last-child td { border-bottom: 0; }
.gp-row { cursor: pointer; }
.gp-row:hover td { background: #F8FAFB; }
.gp-row.selected td { background: #FFF9E6; }
.gp-row:focus-visible { outline: 3px solid var(--gp-amber); outline-offset: -3px; }
.gp-row-error td { background: #FFF6F6; }
.gp-detail-row td { background: #F8FAFB; }
.gp-cell-actions { text-align: right; white-space: nowrap; }

.gp-tag {
    display: inline-block; margin: 1px 4px 1px 0; padding: 1px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
    background: #EEF1F4; color: var(--gp-navy);
}
.gp-action-create { background: #E6F4EC; color: var(--gp-go); }
.gp-action-update { background: #E7F0FA; color: var(--gp-review); }
.gp-action-delete { background: #FDECEC; color: var(--gp-stop); }
.gp-status-stop { background: #FDECEC; color: var(--gp-stop); }

.gp-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--gp-line); color: var(--gp-steel); font-size: 14px; }

.gp-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
.gp-panel { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; }
.gp-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.gp-panel-head h2 { margin: 0; font-family: var(--gp-font-display); font-weight: 600; font-size: 24px; }
.gp-panel-head p { margin: 2px 0 0; }

.gp-form { display: grid; gap: 12px; border: 0; margin: 0; padding: 0; min-width: 0; }
.gp-form label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 600; }
.gp-form .gp-input { width: 100%; }
.gp-form-inline { grid-template-columns: repeat(auto-fit, minmax(140px, max-content)); align-items: end;
    padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--gp-line); border-left: 4px solid var(--gp-amber); border-radius: var(--gp-radius); }
.gp-form-inline .gp-grow { min-width: 260px; }
.gp-form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end;
    padding: 16px; margin-bottom: 16px; background: #fff; border: 1px solid var(--gp-line); border-left: 4px solid var(--gp-amber); border-radius: var(--gp-radius); }
.gp-span-all { grid-column: 1 / -1; }
.gp-mobile-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.gp-mobile-label { font-size: 14px; font-weight: 600; }
.gp-mobile-input { display: grid; grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 8px; }
.gp-mobile-hint { font-size: 13px; }
.gp-field-label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-steel); margin: 4px 0 6px; }

.gp-form label.gp-check, label.gp-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.gp-check input { width: 18px; height: 18px; accent-color: var(--gp-navy); flex: none; }
.gp-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.gp-checks-scroll { max-height: 220px; overflow-y: auto; margin-top: 8px; padding: 8px; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); }

.gp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.gp-danger-zone { display: grid; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--gp-line); }
.gp-danger-zone .gp-btn { justify-content: flex-start; }
.gp-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--gp-radius); background: #FFF6DB; font-size: 14px; }
.gp-btn-danger { background: var(--gp-stop); color: #fff; }
.gp-btn-danger:hover { background: #A62828; }
.gp-btn-danger-outline { color: var(--gp-stop); }
.gp-btn:disabled { opacity: .5; cursor: not-allowed; }

.gp-credentials {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px;
    background: #FFF6DB; border: 1px solid #F3D57A; border-radius: var(--gp-radius);
}
.gp-credentials p { margin: 2px 0 0; color: var(--gp-steel); font-size: 14px; }
.gp-credentials code { font-family: var(--gp-font-mono); font-size: 20px; letter-spacing: .06em; padding: 6px 12px; background: #fff; border-radius: 4px; }

.gp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.gp-pill {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px;
    border: 1px solid #C9D1DA; background: #fff; color: var(--gp-ink); font: inherit; font-weight: 500; cursor: pointer;
}
.gp-pill:hover { border-color: var(--gp-navy); }
.gp-pill.active { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-pill.active .gp-count { color: rgba(255, 255, 255, .7); }

.gp-perm-card { padding: 20px 24px; }
.gp-perm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 32px; }
.gp-perm-groups section { display: grid; gap: 8px; align-content: start; }
.gp-perm-groups .gp-check { font-weight: 500; }
.gp-perm-groups code { margin-left: auto; font-size: 11px; }
.gp-money-perm span::after { content: "MYR"; margin-left: 6px; padding: 0 5px; border-radius: 3px; font-size: 10px; font-weight: 700; background: #FFF3DC; color: var(--gp-hold); }
.gp-note { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--gp-radius); background: var(--gp-bg); color: var(--gp-steel); }

.gp-editor .gp-panel-head { align-items: center; }
.gp-hint-line { margin: -4px 0 14px; max-width: 80ch; }

.gp-days { display: flex; flex-wrap: wrap; gap: 6px; }
.gp-day { display: inline-flex !important; flex-direction: row !important; align-items: center; justify-content: center; min-width: 52px; height: 38px;
    border: 1px solid #C9D1DA; border-radius: var(--gp-radius); cursor: pointer; font-weight: 600 !important; background: #fff; }
.gp-day input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gp-day.on { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }
.gp-day:focus-within { box-shadow: 0 0 0 3px rgba(245, 179, 1, .45); }

.gp-stepper { display: flex; gap: 0; margin: 0 0 20px; padding: 0; list-style: none; counter-reset: step; }
.gp-stepper li { counter-increment: step; display: flex; align-items: center; gap: 8px; padding-right: 28px; color: var(--gp-steel); font-weight: 500; }
.gp-stepper li::before { content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border-radius: 50%; border: 2px solid #C9D1DA; font-family: var(--gp-font-mono); font-size: 13px; }
.gp-stepper li.current { color: var(--gp-ink); font-weight: 600; }
.gp-stepper li.current::before { border-color: var(--gp-amber); background: var(--gp-amber); color: var(--gp-navy); }
.gp-stepper li.done::before { content: "✓"; border-color: var(--gp-go); background: var(--gp-go); color: #fff; }

.gp-dropzone, .gp-result { display: flex; gap: 18px; align-items: flex-start; padding: 28px; max-width: 820px; }
.gp-dropzone { border: 2px dashed #C9D1DA; box-shadow: none; }
.gp-dropzone h2, .gp-result h2 { margin: 0 0 6px; font-family: var(--gp-font-display); font-weight: 600; font-size: 24px; }
.gp-dropzone p, .gp-result p { margin: 0; color: var(--gp-steel); }
.gp-result { margin-bottom: 16px; }
.gp-file { position: relative; overflow: hidden; }
.gp-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gp-ok { display: inline-flex; align-items: center; gap: 4px; color: var(--gp-go); font-weight: 600; }
.gp-row-errors { margin: 0; padding-left: 16px; color: var(--gp-stop); font-size: 13px; }

.gp-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.gp-settings-group h2 { margin: 0 0 8px; font-family: var(--gp-font-display); font-weight: 600; font-size: 20px; }
.gp-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid #EEF1F4; }
.gp-setting label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.gp-setting code { font-size: 11px; }
.gp-setting input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gp-navy); }
.gp-sticky-actions {
    position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 10px;
    margin: 16px -32px 0; padding: 12px 32px; background: rgba(243, 245, 247, .94); border-top: 1px solid var(--gp-line);
    backdrop-filter: blur(4px);
}
.gp-sticky-actions .gp-muted { margin-right: auto; }

.gp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gp-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid #C9D1DA; background: #fff; font: inherit; font-size: 12px; font-weight: 600; color: var(--gp-steel); cursor: pointer; }
.gp-chip.on { background: var(--gp-navy); border-color: var(--gp-navy); color: #fff; }

.gp-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 8px; }
.gp-diff pre { margin: 0; padding: 10px 12px; max-height: 320px; overflow: auto; font-family: var(--gp-font-mono); font-size: 12px;
    background: #fff; border: 1px solid var(--gp-line); border-radius: var(--gp-radius); white-space: pre-wrap; word-break: break-word; }

@media (max-width: 1100px) {
    .gp-split { grid-template-columns: 1fr; }
    .gp-panel { position: static; max-height: none; }
}

@media (max-width: 600px) {
    .gp-settings { grid-template-columns: 1fr; }
    .gp-sticky-actions { margin: 16px -16px 0; padding: 12px 16px; }
    .gp-diff { grid-template-columns: 1fr; }
    .gp-search { min-width: 0; max-width: none; }
}

/* ---------------------------------------------------------------- motion */
@keyframes gp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes gp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- Blazor error UI */
#blazor-error-ui {
    background: #FFF6DB;
    border-top: 4px solid var(--gp-amber);
    bottom: 0;
    display: none;
    left: 0;
    padding: .7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .6rem; }

/* ---------------------------------------------------------------- project workspace (P4+) */
.gp-header-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 8px; }
.gp-header-meta .gp-muted { display: inline-flex; align-items: center; gap: 6px; }
.gp-status-tender { background: #EEF2F6; color: var(--gp-steel); }
.gp-status-notstarted { background: #EEF2F6; color: var(--gp-steel); }
.gp-status-inprogress { background: #E6F4EC; color: var(--gp-go); }
.gp-status-submitted { background: #E7F0FA; color: var(--gp-review); }
.gp-status-approved { background: #E6F4EC; color: var(--gp-go); }
.gp-status-rework { background: #FDECEC; color: var(--gp-stop); }
.gp-status-hold { background: #FFF3E0; color: var(--gp-hold); }
.gp-text-stop { color: var(--gp-stop); }
.gp-text-go { color: var(--gp-go); }
.gp-text-hold { color: var(--gp-hold); }
.gp-num { text-align: right; font-variant-numeric: tabular-nums; }
.gp-pad { padding: 16px; }
.gp-scroll-y { max-height: 420px; overflow-y: auto; }
.gp-plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.gp-tree-name { display: inline-block; padding-left: calc(var(--level, 0) * 20px); }
.gp-tree-name::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-left: 2px solid var(--gp-line);
    border-bottom: 2px solid var(--gp-line); vertical-align: middle; }
.gp-tree tr[draggable="true"] { cursor: grab; }
.gp-drop-target td { background: #FFF6DB; box-shadow: inset 0 2px 0 var(--gp-amber); }
.gp-drop-root td { text-align: center; color: var(--gp-steel); background: #FFFBEA; border: 2px dashed var(--gp-amber); }
.gp-kanban { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.gp-kanban-col { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); padding: 10px; min-height: 200px; }
.gp-kanban-col h3 { margin: 0 0 8px; font-family: var(--gp-font-display); font-size: 16px; display: flex; justify-content: space-between; }
.gp-kanban-card { display: block; width: 100%; text-align: left; background: var(--gp-bg); border: 1px solid var(--gp-line); border-radius: var(--gp-radius);
    padding: 8px 10px; margin-bottom: 8px; font: inherit; color: inherit; cursor: pointer; }
.gp-kanban-card.overdue { border-left: 4px solid var(--gp-stop); }
.gp-gantt { position: relative; overflow-x: auto; }
.gp-gantt-row { display: grid; grid-template-columns: 260px 1fr; align-items: center; border-bottom: 1px solid var(--gp-line); min-height: 30px; }
.gp-gantt-label { padding: 4px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-gantt-track { position: relative; height: 30px; }
.gp-gantt-bar { position: absolute; top: 7px; height: 16px; border-radius: 3px; background: var(--gp-navy); }
.gp-gantt-bar.baseline { top: 22px; height: 4px; background: var(--gp-steel); opacity: .5; }
.gp-gantt-bar.done { background: var(--gp-go); }
.gp-gantt-bar.late { background: var(--gp-stop); }
.gp-gantt-bar.phase { background: var(--gp-amber); height: 8px; top: 11px; }
.gp-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--gp-amber); }
.gp-gantt-scale { display: grid; grid-template-columns: 260px 1fr; font-size: 12px; color: var(--gp-steel); }
.gp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gp-photo { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); overflow: hidden; font-size: 13px; }
.gp-photo img, .gp-photo video { width: 100%; height: 160px; object-fit: cover; display: block; background: #0E1C2B; }
.gp-photo dl { margin: 0; padding: 8px 10px; display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; }
.gp-photo dt { color: var(--gp-steel); }
.gp-photo dd { margin: 0; }
.gp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.gp-kpi { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); padding: 12px 14px; text-decoration: none; color: inherit; }
.gp-kpi span { display: block; color: var(--gp-steel); font-size: 13px; }
.gp-kpi strong { display: block; font-family: var(--gp-font-display); font-size: 26px; }
.gp-light { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.gp-light::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.gp-light-green { color: var(--gp-go); }
.gp-light-amber { color: var(--gp-hold); }
.gp-light-red { color: var(--gp-stop); }
.gp-chat { display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 8px; }
.gp-chat-msg { padding: 10px 12px; border-radius: var(--gp-radius); background: var(--gp-surface); border: 1px solid var(--gp-line); white-space: pre-wrap; }
.gp-chat-msg.user { background: #E7F0FA; justify-self: end; max-width: 80%; }
.gp-chat-msg.assistant { max-width: 90%; }
.gp-bell { position: relative; margin-right: 8px; }
.gp-bell-count { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--gp-stop);
    color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.gp-bell-panel { position: absolute; right: 0; top: 44px; width: 360px; max-height: 70vh; overflow-y: auto; z-index: 1300; padding: 12px; color: var(--gp-ink); }
.gp-bell-item { display: grid; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--gp-line); padding: 8px 4px;
    font: inherit; color: inherit; cursor: pointer; }
.gp-bell-item:hover { background: var(--gp-bg); }
.gp-pre-wrap { white-space: pre-wrap; font-size: 13px; }
.gp-ai { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.gp-ai-list { padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.gp-ai-conv { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: none; border: 0; border-radius: 6px; padding: 8px; cursor: pointer; font: inherit; color: inherit; }
.gp-ai-conv:hover, .gp-ai-conv.active { background: var(--gp-bg); }
.gp-ai-chat { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 60vh; }
.gp-ai-messages { flex: 1; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; max-height: 60vh; }
.gp-ai-msg { max-width: 80%; padding: 10px 12px; border-radius: 8px; background: var(--gp-bg); }
.gp-ai-msg.user { align-self: flex-end; background: #E6EDF4; }
.gp-ai-pending { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px; border-left: 4px solid var(--gp-amber); background: #FFF8E1; border-radius: 6px; }
.gp-ai-input { display: flex; gap: 8px; align-items: flex-end; }
.gp-ai-input textarea { flex: 1; resize: vertical; }
@media (max-width: 900px) { .gp-ai { grid-template-columns: 1fr; } }
.gp-mt { margin-top: 16px; }
.gp-consent { padding: 20px; margin-bottom: 16px; border-top: 6px solid var(--gp-amber); } .gp-consent h2 { margin: 0 0 8px; font-family: var(--gp-font-display); }
.gp-tag-go { background: #E6F4EC; color: var(--gp-go); }
.gp-tag-hold { background: #FDF1DE; color: var(--gp-hold); }
.gp-tag-stop { background: #FBE7E7; color: var(--gp-stop); }
.gp-tag-review { background: #E5EEF8; color: var(--gp-review); }
.gp-row-link { cursor: pointer; }
.gp-row-link:hover td { background: var(--gp-bg); }
.gp-po-lines input.gp-input, .gp-po-lines select.gp-select { min-width: 0; width: 100%; }
.gp-po-lines td { vertical-align: top; }
.gp-po-totals { display: grid; grid-template-columns: auto auto; gap: 4px 24px; justify-content: end; padding: 12px 16px; }
.gp-po-totals dt { color: var(--gp-steel); }
.gp-po-totals dd { margin: 0; text-align: right; font-family: var(--gp-font-mono); }
.gp-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; } .gp-facts dt { color: var(--gp-steel); } .gp-facts dd { margin: 0; }
