/* ---------------------------------------------------------------------
   IGREP-hidden-guard

   `[hidden]` is a browser default rule, and ANY author rule that sets
   display beats it. `.badge-dot { display: flex }` in dashboard.css did
   exactly that, so the notification badge on every admin page was pinned
   open reading "0" - permanently, on every screen, for every account.
   A badge that always says zero teaches people to ignore badges, which
   is worse than having none.

   One rule, declared once, that outranks them all.
   --------------------------------------------------------------------- */
[hidden] { display: none !important; }

/* ==========================================================================
   ui.css — modals, toasts, and the shared component vocabulary.
   Loaded after main.css / dashboard.css / admin.css so it can settle
   disagreements between them.
   ========================================================================== */

:root {
    --ok-green:    #15803d;
    --ok-green-bg: #f0fdf4;
    --warn-amber:  #b45309;
    --warn-bg:     #fef3c7;
    --danger-red:  #b91c1c;
    --danger-bg:   #fee2e2;
    --info-blue:   #172a45;
    --info-bg:     #e2e8f0;
    --surface-2:   #f1f5f9;
    --border-soft: #e2e8f0;
    --radius-lg:   10px;
    --shadow-lift: 0 10px 30px rgba(10, 25, 47, .16), 0 2px 6px rgba(10, 25, 47, .08);
}

/* ---------------------------------------------------------------- backdrop */
.ui-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 25, 47, .55);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 5vh 20px 40px;
    overflow-y: auto;
    /* Above the accessibility widget (main.css uses 9999), otherwise the
       floating button sits on top of every dialog. */
    z-index: 10000;
    opacity: 0;
    transition: opacity .14s ease;
}
.ui-backdrop.ui-open   { opacity: 1; }
.ui-backdrop.ui-closing{ opacity: 0; }

.ui-dialog {
    background: var(--surface-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lift);
    width: 100%;
    max-width: 560px;
    transform: translateY(-10px) scale(.99);
    transition: transform .16s cubic-bezier(.2, .8, .3, 1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}
.ui-open .ui-dialog { transform: none; }

@keyframes uiModalShake {
    0%, 100% { transform: scale(1); }
    20%, 60% { transform: scale(1.015); }
    40%, 80% { transform: scale(0.99); }
}
.ui-dialog.ui-shake {
    animation: uiModalShake 0.25s ease;
}

/* a roomier dialog, for a profile read in two columns (the supplier's profile) */
.ui-dialog.ui-lg { max-width: 880px; }

/* a wide dialog, for a notice shown beside its details */
.ui-dialog.ui-xl { max-width: 1120px; }
.ui-dialog.ui-xl .ui-head { padding: 24px 30px 18px; }
.ui-dialog.ui-xl .ui-title { font-size: 1.3rem; }
.ui-dialog.ui-xl .ui-subtitle { font-size: .92rem; margin-top: 6px; }
.ui-dialog.ui-xl .ui-body { padding: 24px 30px 28px; }

/* ------------------------------------------------------------------ header */
.ui-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--border-soft);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
}
.ui-head-text { flex: 1; min-width: 0; }
.ui-title {
    font-size: 1.06rem;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1.35;
    margin: 0;
}
.ui-subtitle {
    margin: 4px 0 0;
    font-size: .82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.ui-x {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    border-radius: 4px;
    flex-shrink: 0;
}
.ui-x:hover { background: var(--surface-2); color: var(--text-dark); }

/* -------------------------------------------------------------------- body */
.ui-body {
    padding: 18px 22px;
    overflow-y: auto;
    font-size: .9rem;
    color: var(--text-dark);
    line-height: 1.6;
    flex: 1 1 auto;
}
.ui-body > p { margin: 0 0 10px; }
.ui-body > p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */
.ui-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border-soft);
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.ui-btn {
    font-size: .86rem;
    font-weight: 650;
    padding: 9px 18px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    letter-spacing: 0.01em;
    transition: all .16s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
.ui-btn:hover:not(:disabled) {
    transform: translateY(-1px);
}
.ui-btn:active:not(:disabled) {
    transform: translateY(1px);
}
.ui-btn:disabled { opacity: .6; cursor: progress; transform: none !important; box-shadow: none !important; }

.ui-btn-primary {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff !important;
    border-color: #020617;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 5px rgba(15, 23, 42, 0.22);
}
.ui-btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #334155 0%, #1e293b 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(15, 23, 42, 0.32);
}

.ui-btn-danger  {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: #fff !important;
    border-color: #991b1b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 5px rgba(185, 28, 28, 0.25);
}
.ui-btn-danger:hover:not(:disabled) {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(185, 28, 28, 0.35);
}

.ui-btn-success {
    background: linear-gradient(180deg, #15803d 0%, #15803d 100%);
    color: #fff !important;
    border-color: #166534;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 5px rgba(22, 101, 52, 0.25);
}
.ui-btn-success:hover:not(:disabled) {
    background: linear-gradient(180deg, #16a34a 0%, #15803d 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(22, 101, 52, 0.35);
}

.ui-btn-quiet {
    background: var(--surface-white);
    color: var(--text-dark);
    border-color: var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.ui-btn-quiet:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--primary-navy);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.ui-btn:focus-visible { outline: 3px solid var(--accent-gold); outline-offset: 2px; }

/* -------------------------------------------------------------------- form */
.ui-form { display: grid; gap: 16px; }
.ui-field { display: block; }
.ui-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--primary-navy);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.ui-req { color: var(--danger-red); font-style: normal; }
.ui-input {
    width: 100%;
    padding: 10px 12px;
    font-size: .9rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--surface-white);
    color: var(--text-dark);
}
.ui-input:focus {
    outline: none;
    border-color: var(--primary-navy);
    box-shadow: 0 0 0 3px rgba(10, 25, 47, .1);
}
textarea.ui-input { resize: vertical; min-height: 84px; font-family: inherit; }
.ui-help { display: block; margin-top: 5px; font-size: .76rem; color: var(--text-muted); line-height: 1.45; }
.ui-error { display: none; margin-top: 5px; font-size: .78rem; color: var(--danger-red); font-weight: 600; }
.has-error .ui-error { display: block; }
.has-error .ui-input { border-color: var(--danger-red); background: #fff5f5; }

/* checklist — used for assigning duties */
.ui-checklist { display: grid; gap: 8px; }
.ui-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--surface-white);
    transition: border-color .12s, background .12s;
}
.ui-check:hover { border-color: var(--primary-navy); background: var(--surface-2); }
.ui-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary-navy); }
.ui-check-text { display: block; min-width: 0; }
.ui-check-text strong { display: block; font-size: .86rem; color: var(--text-dark); font-weight: 600; }
.ui-check-text small  { display: block; font-size: .76rem; color: var(--text-muted); margin-top: 2px; line-height: 1.45; }
.ui-check.is-locked { opacity: .62; cursor: not-allowed; background: var(--surface-2); }

/* ------------------------------------------------------------------ toasts */
.ui-toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10500;
    max-width: min(400px, calc(100vw - 40px));
}
.ui-toast {
    background: var(--primary-navy);
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .86rem;
    font-weight: 500;
    box-shadow: var(--shadow-lift);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
}
.ui-toast.is-in { opacity: 1; transform: none; }

/* ==========================================================================
   SHARED COMPONENTS — the vocabulary every admin screen uses.
   ========================================================================== */

/* key/value grid, for profile modals */
.kv {
    display: grid;
    grid-template-columns: minmax(140px, max-content) 1fr;
    gap: 8px 20px;
    font-size: .87rem;
    align-items: baseline;
}
.kv dt { color: var(--text-muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--text-dark); font-weight: 600; word-break: break-word; }

/* section inside a modal */
.ui-section { margin-top: 22px; }
.ui-section:first-child { margin-top: 0; }
.ui-section > h4 {
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 700;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

/* status pills (the shape is in dash-theme.css; these are the colours) */
.pill-ok      { background: var(--ok-green-bg); color: var(--ok-green);   border-color: #22c55e; }
.pill-warn    { background: var(--warn-bg);     color: var(--warn-amber); border-color: #fcd34d; }
.pill-danger  { background: var(--danger-bg);   color: var(--danger-red); border-color: #fca5a5; }
.pill-info    { background: var(--info-bg);     color: var(--info-blue);  border-color: #cbd5e1; }
.pill-neutral { background: var(--surface-2);   color: var(--text-muted); border-color: var(--border-color); }

/* data tables inside modals and cards */
.ui-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.ui-table th {
    text-align: left;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    font-weight: 700;
    padding: 8px 10px;
    border-bottom: 2px solid var(--border-soft);
    white-space: nowrap;
}
.ui-table td { padding: 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.ui-table tr:last-child td { border-bottom: none; }
.ui-table tbody tr:hover { background: var(--surface-2); }
.ui-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-scroll { overflow-x: auto; }

/* empty and loading states */
.ui-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: .87rem;
    background: var(--surface-2);
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
}
.ui-empty strong { display: block; color: var(--text-dark); margin-bottom: 4px; font-size: .92rem; }

.ui-skeleton {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--surface-2) 25%, #e8edf3 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: ui-shimmer 1.2s infinite;
    margin-bottom: 8px;
}
@keyframes ui-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* an inline notice inside a card */
.ui-note {
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: .84rem;
    line-height: 1.55;
    margin-bottom: 16px;
}
.ui-note-info   { background: var(--info-bg);   color: #172a45; }
.ui-note-warn   { background: var(--warn-bg);   color: #b45309; }
.ui-note-danger { background: var(--danger-bg); color: #7f1d1d; }

.ui-note strong { font-weight: 700; }

/* the stage rail, shown on an award's progress */

@media (max-width: 640px) {
    .ui-backdrop { padding: 0; align-items: stretch; }
    .ui-dialog { max-width: none; border-radius: 0; max-height: 100vh; min-height: 100vh; }
    .ui-head { border-radius: 0; }
    .ui-foot { border-radius: 0; }
    .ui-foot .ui-btn { flex: 1; }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 10px; }
}

/* ==========================================================================
   AWARD CARDS — the approval chain
   ========================================================================== */

.award-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-navy);
    margin-top: 2px;
    line-height: 1.4;
}

/* duty chips in the staff table */
.duty-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.duty-chip {
    font-size: .68rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border-soft);
    border-radius: 4px;
    padding: 2px 7px;
    white-space: nowrap;
}
.duty-chip-none { background: var(--danger-bg); color: var(--danger-red); border-color: #fca5a5; }

/* the one-time password panel */
.otp-box {
    background: var(--primary-navy);
    color: #fff;
    padding: 16px 18px;
    border-radius: var(--radius);
    text-align: center;
    margin: 14px 0;
}
.otp-code {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--accent-gold);
    display: block;
    margin: 8px 0;
    word-break: break-all;
}
.otp-box small { display: block; color: rgba(255,255,255,.72); font-size: .76rem; line-height: 1.5; }

/* ==========================================================================
   TABLE ROW ACTIONS + small notes
   ========================================================================== */

/* The staff table carries more columns than the others; keep the headers on
   one line and let the duty chips take the slack. */
#staffTableBody + thead th,
.dash-table th { white-space: nowrap; }
#staffTableBody td { vertical-align: middle; }
#staffTableBody td:nth-child(4) { min-width: 220px; }
#staffTableBody td:last-child   { text-align: right; }

/* Toolbar with a heading on the left and a button on the right */
.toolbar { align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar .sec-title { white-space: normal; }

/* =========================================================================
   SUPPLIER PORTAL — the pieces the bidder screens need.

   These live in ui.css, not admin.css, on purpose. .btn-danger was defined
   ONLY in admin.css, which the supplier dashboard never loads, so a "Withdraw"
   button rendered there came out as unstyled browser chrome — grey, square and
   indistinguishable from Cancel. A destructive action has to LOOK like one.
   ========================================================================= */

/* One outstanding payment, one row, one button that belongs to it.
   The dashed box this replaces had no handler at all: it opened a file
   picker and threw the file away. */

.pay-instructions {
    background: #f1f5f9;
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}
.pay-instructions p { font-size: .75rem; color: var(--text-muted, #64748b); margin: 0; line-height: 1.55; }
.pay-instructions .hd { font-size: .8rem; font-weight: 700; color: var(--primary-navy, #1e293b); margin-bottom: 6px; }

/* the Profile & Eligibility tab is styled in supplier/supplier.css */

/* =========================================================================
   THE NOTIFICATION CENTRE (both portals)

   The supplier bell used to open a modal reading "Loading messages…" that
   nothing ever replaced; the admin bell had no JavaScript at all and a badge
   welded open at "0". This is what they open now.
   ========================================================================= */
/* .bell-panel moved to dashboard.css - it was defined here and in admin.css
   with different widths, and which one won depended on stylesheet order. */

/* Unread is a left edge and a tint, not a different layout — so the list does
   not jump around as things are read. */

/* The explanatory paragraph above a form's fields. UI.form used to drop
   opts.message on the floor, so every word written to explain what a dialog
   was about — the ABC ceiling, the submission deadline, what replacing a
   bidding document does to bidders who already paid — never reached anyone. */
.ui-form-intro {
    margin: 0 0 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.ui-form-intro p {
    margin: 0 0 9px;
    font-size: .84rem;
    line-height: 1.55;
    color: var(--text-muted, #64748b);
    white-space: pre-line;
}
.ui-form-intro p:last-child { margin-bottom: 0; }

/* Ensure no unintended strikethroughs or underlines on buttons/actions across portals */
button,
.btn,
a.btn,
.msg-list-item,
.sidebar-menu a,
.dash-table a,
.tab-btn {
    text-decoration: none !important;
}

