/* ------------------------------
   1. Design tokens / root
   ------------------------------ */

:root {
    /* Brand colors */
    --color-header-bg: #071424;        /* deep navy */
    --color-page-bg:   #f4f5fb;        /* soft grey */
    --color-surface:   #ffffff;
    --color-primary:   #ff3f86;        /* SAWEI pink */
    --color-primary-soft: rgba(255, 63, 134, 0.08);
    --color-primary-dark: #e02b6e;

    --color-text-main:   #0f172a;
    --color-text-muted:  #6b7280;
    --color-border-subtle: #e5e7eb;
    --color-border-strong: #cbd5e1;

    --color-success: #16a34a;
    --color-danger:  #ef4444;
    --color-warning: #f97316;
    --color-info:    #0ea5e9;

    /* Role badge colors */
    --role-forum-admin:   #0ea5e9;
    --role-forum-auditor: #6366f1;
    --role-company-admin: #22c55e;
    --role-company-user:#a855f7;

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 sans-serif;
    --font-size-base: 15px;
    --font-size-sm:   13px;
    --font-size-lg:   17px;
    --line-height-base: 1.5;

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-7: 1.75rem;
    --space-8: 2rem;

    /* Radii & shadows */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
    --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.06);

    /* Layout */
    --max-width-page: 1180px;
    /* Admin pages can be a touch wider so tables and dashboards breathe */
    --max-width-admin: min(88vw, 2100px);
}

@media (min-width: 1600px){
    :root{
        --max-width-admin: 1440px;
    }
}


/* ------------------------------
   2. Base reset / typography
   ------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/*
  IMPORTANT (layout):
  Use min-height instead of height so the document grows naturally.
  This prevents the footer appearing "fixed" while content scrolls.
*/
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text-main);
    background-color: var(--color-page-bg);
    -webkit-font-smoothing: antialiased;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
    background: var(--color-bg, #f3f3f8);
    overflow-x: hidden; /* prevent tiny horizontal scroll from full-width accents */
    min-height: 100vh;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

button {
    font-family: inherit;
}

/* Focus ring for accessibility */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ------------------------------
   3. Layout: header, nav, page
   ------------------------------ */

header {
    background: linear-gradient(90deg, #06162c 0%, var(--color-header-bg) 55%, #0b1020 100%);
    color: #e5e7eb;
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.3);
    flex-shrink: 0;
}

/* Add a subtle “brand” accent line under the main site header */
header.site-header { position: relative; }
header.site-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    background: linear-gradient(90deg,
        #ef4444 0%,
        #f97316 16%,
        #eab308 32%,
        #22c55e 48%,
        #06b6d4 64%,
        #3b82f6 80%,
        #a855f7 100%
    );
}

/*
   Top site header alignment
   ------------------------
   Many pages include <header> elements inside the main content.
   The *top* navigation bar is the one with class .site-header.
   We constrain it to the same width as the dashboards so the
   "Home/Admin/..." links and signed-in info align with page content.
*/

header.site-header {
    /* Let the inner container handle horizontal padding so it can align with page-shell/admin-page. */
    padding: 0;
}

.site-header-inner {
    max-width: var(--max-width-admin);
    margin: 0 auto;
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
}

header.site-header .main-nav {
    /* The base header layout stacks nav below the title; in the site header we keep it aligned in the same row. */
    margin-top: 0;
}

@media (max-width: 720px) {
    .site-header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    header.site-header .main-nav {
        width: 100%;
    }
}

header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.site-title{
    display:flex;
    align-items:center;
    gap: 0.65rem;
    flex-wrap:wrap;
}

.site-brand{
    display:flex;
    align-items:center;
    gap: 0.9rem;
    text-decoration:none;
    color:inherit;
}

.site-brand__mark{
    width:48px;
    height:48px;
    object-fit:contain;
    border-radius:12px;
    background:#ffffff;
    padding:0.2rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
}

.site-brand__copy{
    display:flex;
    flex-direction:column;
    gap:0.1rem;
}

.site-brand__eyebrow,
.instructions-header__eyebrow,
.auth-card__eyebrow{
    font-size:12px;
    font-weight:700;
    letter-spacing:0.08em;
    text-transform:uppercase;
    color:#d61a72;
}

.site-brand h1{
    margin:0;
    line-height:1.15;
}

.env-badge{
    display:inline-flex;
    align-items:center;
    gap: 0.35rem;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(245,158,11,0.35);
    background: rgba(245,158,11,0.16);
    color: #92400e;
}

.env-badge__dot{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-2);
    font-size: 14px;
}

.main-nav a {
    display: inline-flex;
    align-items: center;

    color: #e5e7eb;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-pill);
    transition: background-color 0.16s ease, color 0.16s ease;
}

.main-nav a:hover {
    background-color: rgba(148, 163, 184, 0.21);
}

/* Buttons: disabled state (used for profile attestation gating) */
.btn:disabled,
.btn.btn--disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.btn:disabled:hover {
    transform: none;
}

.nav-spacer {
    flex: 1;
}

.nav-user {
    font-size: 14px;

    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: #e5e7eb;
}

main {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-height: 0;
    padding: 2rem clamp(1rem, 2vw, 2rem) 1.75rem;
}

/* Remove default HR dividers in the shared layout (we use the brand accent bars instead) */
header.site-header hr,
footer hr {
    display: none;
}

/* Auth layout: ensure invite-only/register pages are centered and don't leave huge whitespace */
.auth-layout{
    width: 100%;
    max-width: var(--max-width-admin);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 2.25rem 1.25rem 2.5rem;
}
.auth-layout--centered{ align-items: center; }

/* Empty states should look intentional and aligned */
.empty-state{
    border: 1px dashed rgba(148,163,184,0.55);
    background: rgba(148,163,184,0.10);
    border-radius: 16px;
    padding: 1.1rem 1.2rem;
    text-align: center;
}

.container{
    width: 100%;
    max-width: var(--max-width-page);
    margin: 0 auto;
}

.container--wide{
    width: 100%;
    max-width: var(--max-width-admin);
    margin: 0 auto;
}

footer {
    background: linear-gradient(90deg, #06162c 0%, var(--color-header-bg) 55%, #0b1020 100%);
    color: #cbd5e1;
    padding: var(--space-4) var(--space-4);
    text-align: center;
    font-size: var(--font-size-sm);
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    /* Ensure the footer is part of the normal document flow (never fixed/overlay). */
    position: relative !important;
    bottom: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex-shrink: 0;
}

/* Reports tabs: keep cards aligned to the container width */
.report-tab{ width: 100%; }
.report-tab .card{ width: 100%; }
.card .empty-state{ width: 100%; box-sizing: border-box; }

footer::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #ef4444 0%,
        #f97316 16%,
        #eab308 32%,
        #22c55e 48%,
        #06b6d4 64%,
        #3b82f6 80%,
        #a855f7 100%
    );
}

footer hr { display: none; }
footer small { color: #e2e8f0; letter-spacing: 0.2px; }


/* ------------------------------
   Instructions page (company)
   ------------------------------ */
.instructions-page {
    padding: var(--space-5) var(--space-4) var(--space-6);
}

.instructions-header {
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.12), rgba(14, 165, 233, 0.10));
    border: 1px solid rgba(148, 163, 184, 0.22);
    max-width: var(--max-width-admin);
    margin: 0 auto var(--space-5);
    padding: var(--space-4);
}

.instructions-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.instructions-header__logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
}

.instructions-header__title {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.instructions-header__subtitle {
    font-size: 14px;
    color: #475569;
}

.instructions-content {
    max-width: var(--max-width-admin);
    margin: 0 auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08);
    padding: var(--space-5);
}

.instructions-content h1 {
    font-size: 22px;
    margin: 0 0 var(--space-3);
}

.instructions-cta {
    margin-top: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.10);
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.instructions-cta__note {
    font-size: 13px;
    color: #475569;
}

@media (max-width: 640px) {
    .instructions-header__inner { flex-direction: column; align-items: flex-start; }
    .instructions-cta { flex-direction: column; align-items: stretch; }
    .instructions-cta .btn { width: 100%; }
}


/* ------------------------------
   4. Generic components
   ------------------------------ */

/* Home page layout: center the card in the available space */

.home-layout {
  max-width: 960px;
  margin: 0 auto;
  /* Match the login/register vertical centering behaviour */
  min-height: calc(100vh - 170px);
  display: flex;
  align-items: center;      /* vertical centering */
  justify-content: center;  /* horizontal centering */
  padding: 0;
}

/* The actual welcome panel */
.home-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 2.5rem 3rem;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.15);
  width: 100%;
  max-width: 720px;
}

.home-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--color-text, #0f172a);
}

.home-text {
  margin: 0 0 0.75rem;
  color: var(--color-text-muted, #4b5563);
  line-height: 1.6;
}

.home-actions {
  margin-top: 1.5rem;
}

/* Optional: ensure the primary button feels right on the home card */
.home-card .btn-primary {
  font-size: 0.95rem;
  padding-inline: 1.75rem;
}



/* Cards */

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: var(--space-5);
}

.card--assessment {
    padding: var(--space-4) var(--space-5);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.55rem 1.4rem;
    border-radius: 0px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease,
                transform 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
    color: #ffffff;
}

.btn:active {
    transform: translateY(1px);
}

.btn-pink,
.btn-primary {
    background: #ec2e7d;
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(244, 63, 94, 0.4);
}

.btn-pink:hover,
.btn-primary:hover {
    background-color: var(--color-primary-dark);
    text-decoration: none;
}

.btn-dark {
    background: #020617;
    color: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
}

.btn-dark:hover {
    background: #020515;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #0f172a;
    color: #e5e7eb;
}

.btn-secondary:hover {
    background: #111827;
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
}

.btn-ghost:hover {
    background: #f9fafb;
}

/* Destructive/Remove action (used for note removal) */
.btn-danger{
    background: transparent;
    color: #991b1b;
    border: 1px solid rgba(239,68,68,0.35);
    box-shadow: none;
}
.btn-danger:hover{
    background: rgba(239,68,68,0.10);
}

/* Tables */

.table-responsive{
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: collapse;
    width: 100%;
}

.assessment-table,
.table {
    width: 100%;
    border-spacing: 0;
    font-size: 14px;
}

.assessment-table thead tr,
.table thead tr {
    background: #f9fafb;
}

.assessment-table th,
.assessment-table td,
.table th,
.table td {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--color-border-subtle);
    text-align: left;
}

.assessment-table th,
.table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 13px;
}

.assessment-table tbody tr:hover,
.table tbody tr:hover {
    background: #f9fafb;
}

/* Admin tables: same styling as .table, but used across admin pages */
.admin-table {
    width: 100%;
    border-spacing: 0;
    font-size: 14px;
}

.admin-table thead tr {
    background: #f9fafb;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    vertical-align: middle;
}

.admin-table th {
    font-weight: 600;
    color: #475569;
    font-size: 0.85rem;
}

.admin-table tbody tr:hover {
    background: #f9fafb;
}

/* Forms */

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea,
.input-text,
.input-select,
.input-textarea {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    font-family: inherit;
    font-size: 14px;
    color: var(--color-text-main);
    background-color: #ffffff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease,
                background-color 0.16s ease;
}

textarea,
.input-textarea {
    min-height: 80px;
    resize: vertical;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.input-text:focus-visible,
.input-select:focus-visible,
.input-textarea:focus-visible {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary-soft);
}

/* Section divider */

.section-divider {
    border: none;
    border-top: 1px solid var(--color-border-subtle);
    margin: var(--space-6) 0 var(--space-4);
}

/* Upload block */

.upload-inline {
    margin-top: var(--space-3);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.upload-list {
    list-style: none;
    padding: 0;
    margin: var(--space-3) 0;
    font-size: 14px;
}

.upload-list li + li {
    margin-top: 0.25rem;
}

/* Evidence thumbnails/grid */

.evidence-upload-form .evidence-upload-row{
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
}

.evidence-grid{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
}

@media (max-width: 980px){
    .evidence-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px){
    .evidence-grid{ grid-template-columns: 1fr; }
}

.evidence-item{
    border: 1px solid var(--color-border-subtle);
    border-radius: 14px;
    padding: var(--space-3);
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.evidence-thumb{
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.evidence-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.evidence-file-icon{
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.evidence-meta{
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.evidence-name{
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: block;
}

.evidence-actions{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.evidence-action{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Evidence compact gallery + modal helpers */

.card-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.card-head h2{ line-height: 1.15; }

.evidence-compact .evidence-item--more{
    border-style: dashed;
    cursor: pointer;
    text-align: left;
    background: rgba(148,163,184,0.08);
    appearance: none;
}

.evidence-thumb--more{
    background: rgba(148,163,184,0.12);
}

.evidence-more{
    font-weight: 800;
    font-size: 1.15rem;
}

.upload-progress{
    position: relative;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148,163,184,0.22);
    border: 1px solid rgba(148,163,184,0.25);
    margin-top: 0.75rem;
}

.upload-progress__bar{
    height: 100%;
    width: 0;
    background: rgba(236,72,153,0.85);
    transition: width 0.12s linear;
}

.upload-progress__label{
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: rgba(2,6,23,0.75);
}

/* Modal */

.modal{ display:none; position:fixed; inset:0; z-index: 1000; }
.modal.is-open{ display:block; }

.modal__backdrop{ position:absolute; inset:0; background: rgba(2,6,23,0.65); }

.modal__dialog{
    position: relative;
    width: min(980px, calc(100% - 2rem));
    margin: 6vh auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(2,6,23,0.35);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal__header{
    padding: 1rem 1.1rem;
    border-bottom: 1px solid rgba(148,163,184,0.35);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.modal__title{ font-size: 1.15rem; font-weight: 800; }
.modal__subtitle{ margin-top: 0.15rem; }

.modal__close{
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
}

.modal__close:hover{ background: rgba(148,163,184,0.18); }

.modal__body{ padding: 1rem 1.1rem 1.25rem; overflow:auto; }

.modal-open{ overflow: hidden; }

.modal-open{ overflow: hidden; }

/* Evidence: compact view + "+X more" tile */
.evidence-compact{
    align-items: stretch;
}

.evidence-item--more{
    appearance: none;
    border: 1px dashed var(--color-border-subtle);
    background: rgba(148,163,184,0.08);
    cursor: pointer;
    text-align: left;
    transition: transform 0.08s ease;
}

.evidence-item--more:hover{
    transform: translateY(-1px);
}

.evidence-thumb--more{
    background: rgba(2,6,23,0.06);
}

.evidence-more{
    font-weight: 800;
    font-size: 1.15rem;
}

/* Upload progress bar */
.upload-progress{
    position: relative;
    margin-top: 0.75rem;
    height: 12px;
    border-radius: 999px;
    background: rgba(148,163,184,0.25);
    overflow: hidden;
}

.upload-progress__bar{
    height: 100%;
    width: 0%;
    background: rgba(236,72,153,0.90);
    transition: width 0.08s linear;
}

.upload-progress__label{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: rgba(2,6,23,0.75);
    mix-blend-mode: multiply;
}

/* Card header row (title + action) */
.card-head{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

/* Modal (generic) */
.modal{
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.modal.is-open{
    display: block;
}

.modal__backdrop{
    position: absolute;
    inset: 0;
    background: rgba(2,6,23,0.60);
}

.modal__dialog{
    position: relative;
    width: min(980px, calc(100% - 2rem));
    margin: 6vh auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(2,6,23,0.35);
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal__header{
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal__title{
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}

.modal__subtitle{
    margin-top: 0.1rem;
}

.modal__close{
    appearance: none;
    border: 0;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
}

.modal__close:hover{
    background: rgba(148,163,184,0.18);
}

.modal__body{
    padding: 1rem 1.1rem 1.25rem;
    overflow: auto;
}

.modal-open{
    overflow: hidden;
}

/* ---------- Generic page shell (also useful for other pages) ---------- */

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3.5rem;
}

/* Specific flavour for admin pages if you want to tweak later */

.page-shell--admin {

    /* leave here for future admin-specific overrides */
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin: 0 0 0.5rem;
}

.page-lead {
    margin: 0;
    max-width: 640px;
    color: #6b7280; /* muted grey */
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Centered pages (home, login, etc.) */

.page--centered {
    display: flex;
    justify-content: center;
    align-items: center;
    /* header + footer height buffer */
    min-height: calc(100vh - 170px);
}

.auth-screen{
    width:100%;
    max-width:960px;
    margin:0 auto;
}

.auth-screen--login{
    min-height:calc(100vh - 250px);
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:1rem;
}

.auth-page--login.page--centered{
    min-height:auto;
    align-items:flex-start;
}


/* Hero header (assessment pages) */

.page-header--hero {
    /* Match the portal page background for a consistent, lighter look */
    background: var(--color-page-bg);
    /* Subtle separation so the hero feels integrated with the page */
    padding: var(--space-3) 0 var(--space-4);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid rgba(15, 23, 42, 0.10);
}

.page-header--hero .hero-image {
    max-width: var(--max-width-admin);
    margin: 0 auto;
    padding: var(--space-4) var(--space-4) var(--space-2);
}

/* Responsive hero banner (landscape assets) */
.page-header--hero .hero-image picture,
.page-header--hero .hero-image img{
    display: block;
    width: 100%;
}

.page-header--hero .hero-image__img,
.page-header--hero .hero-image img{
    /* Fill width on wide screens while keeping text readable */
    height: clamp(220px, 22vw, 420px);
    object-fit: cover;
    object-position: center;
    background: #071424;
    border-radius: 16px;
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.12);
}

/* Landing hero uses the same image class */
.landing-hero-banner picture,
.landing-hero-banner img{
    display: block;
    width: 100%;
}

.landing-hero-banner .hero-image__img,
.landing-hero-banner img{
    height: clamp(220px, 22vw, 420px);
    object-fit: cover;
    object-position: center;
    border-radius: 18px;
    background: #071424;
}

.assessment-title{
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    margin: 0 0 1rem;
}

/* Edition + status pills under the section title */
.assessment-meta{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: -0.35rem 0 1rem; /* creates spacing between title/pills and the stepper */
}

/* =========================
   Phase A: Stepper + save/completion helpers
   ========================= */

.assessment-stepper{
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0 0 1.25rem;
}

.assessment-step{
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--color-border-subtle);
    background: #fff;
    text-decoration: none;
    color: var(--color-text-main);
    box-shadow: 0 8px 18px rgba(11, 26, 42, 0.04);
}

.assessment-step.is-active{
    border-color: rgba(236, 72, 153, 0.35);
    box-shadow: 0 10px 22px rgba(236, 72, 153, 0.10);
}

.assessment-step__label{
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
}

.step-badge{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--color-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.step-badge--done{
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
}

.questions-right{ display: flex; flex-direction: column; align-items: flex-end; gap: 0.5rem; }

.questions-status{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.save-badge{
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #065f46;
    font-weight: 800;
    font-size: 0.78rem;
}

.save-badge--saving{
    background: rgba(59, 130, 246, 0.12);
    color: #1d4ed8;
}

.save-badge--error{
    background: rgba(239, 68, 68, 0.12);
    color: #991b1b;
}

.incomplete-banner{
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #92400e;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.q-card--incomplete{
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 10px 26px rgba(245, 158, 11, 0.10);
}

.q-card--pulse{
    animation: qPulse 1.2s ease-in-out;
}

@keyframes qPulse{
    0%{ transform: translateY(0); }
    30%{ transform: translateY(-3px); }
    100%{ transform: translateY(0); }
}

/* =========================
   Assessment question UX
   ========================= */

.questions-form .questions-wrap{
    margin-top: 0.25rem;
}

.questions-head{
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin: 0 0 var(--space-3);
}

.questions-head h3{
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-text-main);
}

.questions-help{
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.q-card{
    background: #fff;
    border: 1px solid var(--color-border-subtle);
    border-radius: 14px;
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: 0 10px 24px rgba(11, 26, 42, 0.06);
}

.q-grid{
    display: grid;
    grid-template-columns: 1.65fr 1.35fr;
    gap: var(--space-4);
    align-items: start;
}

@media (max-width: 980px){
    .q-grid{ grid-template-columns: 1fr; }
}

.q-left{ min-width: 0; }
.q-right{ min-width: 0; }

.q-code-pill{
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.06em;
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
    margin-bottom: var(--space-2);
}

.q-code-pill .q-local{
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.25);
    letter-spacing: 0.02em;
}

.q-code-pill .q-code{
    font-weight: 700;
    color: rgba(15, 23, 42, 0.6);
    letter-spacing: 0.02em;
}

.q-text-block{
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(15, 23, 42, 0.88);
}

.q-fields{
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.q-fields--single{
    grid-template-columns: 1fr;
}

.q-field label{
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgba(15, 23, 42, 0.72);
    margin: 0 0 0.35rem;
}


/* Mini-panels for Response / Consistency / Context (enterprise feel) */
.q-panel{
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    padding: 12px;
}

.q-panel__body{ margin-top: 0; }

.q-label{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 0.45rem;
}

.q-label__left{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.q-ico{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(15, 23, 42, 0.72);
}
.q-ico svg{ width: 16px; height: 16px; }

.q-tip{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    cursor: help;
    background: rgba(233, 30, 99, 0.12);
    color: rgba(233, 30, 99, 0.95);
    position: relative;
    flex: 0 0 auto;
    user-select: none;
}

.q-tip:focus{ outline: none; box-shadow: 0 0 0 4px rgba(233, 30, 99, 0.12); }

.q-tip[data-tip]:hover::after,
.q-tip[data-tip]:focus::after{
    content: attr(data-tip);
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 240px;
    background: #0b1a2a;
    color: #fff;
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
    box-shadow: 0 18px 40px rgba(11, 26, 42, 0.28);
    z-index: 50;
}

.q-tip[data-tip]:hover::before,
.q-tip[data-tip]:focus::before{
    content: "";
    position: absolute;
    right: 8px;
    top: calc(100% + 2px);
    border: 6px solid transparent;
    border-bottom-color: #0b1a2a;
    z-index: 51;
}

/* Bigger, more comfortable controls inside the assessment */
.input-select--lg{
    height: 48px;
    padding: 0.75rem 0.95rem;
    font-size: 15px;
}

.input-text--lg{
    height: 48px;
    padding: 0.75rem 0.95rem;
    font-size: 15px;
}

.input-textarea--lg{
    min-height: 140px;
    padding: 0.75rem 0.95rem;
    font-size: 15px;
    line-height: 1.5;
}

.form-actions--assessment{
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: var(--space-4);
}



/* ------------------------------
   5. Role badges
   ------------------------------ */

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(148, 163, 184, 0.25);
    color: #e5e7eb;
}

.role-badge__icon {
    font-size: 13px;
}

/* specific colours per role */

.role-badge--forum-admin {
    background: rgba(14, 165, 233, 0.16);
    color: #bae6fd;
}

.role-badge--forum-auditor {
    background: rgba(99, 102, 241, 0.18);
    color: #c7d2fe;
}

.role-badge--company-admin {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.role-badge--company-user {
    background: rgba(168, 85, 247, 0.18);
    color: #e9d5ff;
}

/* === Admin dashboard layout tweaks === */

.admin-dashboard {
    /* Width/spacing is now governed by .admin-page so every dashboard matches */
    width: 100%;
    margin: 3rem 0 4rem;
    padding: 0;
}

/* Header area: tabs + title */
.admin-dashboard__header {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: flex-start;
}

/* Tabs bar */
.admin-dashboard-tabs {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: #ffffff;
    border-radius: 999px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Individual tab */
.admin-dashboard-tab {
    border-radius: 999px;
    padding: 0.45rem 1.2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;                  /* muted grey */
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease,
                box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-dashboard-tab:hover {
    background: #f9fafb;
    color: #111827;
    transform: translateY(-1px);
}

/* Active tab */
.admin-dashboard-tab--active {
    background: #020617;             /* deep navy to match header */
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.35);
}

/* Title + subtitle block */
.admin-dashboard__title-block h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #020617;
    margin-bottom: 0.25rem;
}

.admin-dashboard__title-block p {
    margin: 0;
    color: #6b7280;
    max-width: 42rem;
}

/* Card grid – slightly wider cards */
.admin-dashboard-grid {
    margin-top: 2.25rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); /* wider */
    gap: 1.8rem;
}

/* ------------------------------
   6. Admin dashboard shell
   ------------------------------ */

.admin-shell {
    width: 100%;
    /* Keep admin nav aligned with admin content width */
    max-width: var(--max-width-admin);
    margin: 0 auto;
}

.admin-header {
    margin-bottom: 1.75rem;
}

.admin-header__lead {
    margin: 0;
    color: #8a8fa0;
    font-size: 0.95rem;
}

.admin-header h1 {
    margin: 0 0 var(--space-2);
    font-size: 1.9rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.admin-header p {
    margin: 0;
    color: var(--color-text-muted);
}


/* Tabs row: Overview / Maintenance / Reports */

.admin-tabs {
    display: flex;
    gap: var(--space-5);
    border-bottom: 1px solid var(--color-border-subtle);
    margin-bottom: var(--space-5);
    overflow-x: auto;
}

.admin-tabs a {
    position: relative;
    padding: var(--space-3) 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.admin-tabs a:hover {
    color: var(--color-text-main);
    text-decoration: none;
}

/* support several "active" class names */
.admin-tabs a.active,
.admin-tabs a.is-active,
.admin-tabs__link--active {
    color: var(--color-text-main);
}

.admin-tabs a.active::after,
.admin-tabs a.is-active::after,
.admin-tabs__link--active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg,
        var(--color-primary),
        #fb7185
    );
}

/* Summary cards grid on Overview */

.admin-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.75rem;
    align-items: stretch;
}

/* Force a single-column stack (useful for compact pages like Reports). */
.admin-card-grid--1 {
    grid-template-columns: 1fr;
}

/* Assessment detail: force 3 cards on the first row (desktop) */
.admin-card-grid--detail-top {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .admin-card-grid--detail-top {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-card-grid--detail-top {
        grid-template-columns: 1fr;
    }
}

.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-4);
}

/* .admin-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
} */

.admin-card {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 1.75rem 1.9rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    /* justify-content: space-between; */
}

.admin-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right,
                rgba(248, 113, 155, 0.08),
                transparent 55%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.admin-card:hover::before {
    opacity: 1;
}

.admin-card__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--space-2);
}

.admin-card__body {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.admin-card__actions .btn {
    font-size: 13px;
}

.admin-card h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #020617;
    margin: 0;
}

.admin-card h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Admin: answers filter (assessment review) */

.admin-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0 0 0.75rem;
}

.admin-filter-row--compact {
    margin-bottom: 0.5rem;
    flex-direction: column;
    align-items: stretch;
}

.admin-filter-row--compact .admin-filter-controls {
    width: 100%;
    justify-content: flex-start;
}

.admin-filter-row--compact .admin-filter-select {
    width: 100%;
    min-width: 0;
}

.admin-card .admin-table-wrapper {
    overflow-x: auto;
}

/* Utility: force horizontal scrolling when a table is wide (used on notes log) */
.admin-table-wrapper--scroll {
    overflow-x: auto;
}

/* Utility: allow long names/emails to wrap in table cells */
.cell-wrap {
    white-space: normal;
    word-break: break-word;
}

.admin-filter-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* Notes log: inline edit panel */
.note-edit-form{
    padding: 0.85rem;
    border-radius: 16px;
    border: 1px solid rgba(148,163,184,0.30);
    background: rgba(148,163,184,0.08);
}
.note-edit-grid{
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
}
.note-edit-actions{
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 0.75rem;
}
@media (max-width: 768px){
    .note-edit-grid{ grid-template-columns: 1fr; }
    .note-edit-actions{ justify-content: flex-start; }
}

.admin-filter-label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.admin-filter-select {
    min-width: 240px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.is-hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .admin-filter-controls {
        width: 100%;
    }

    .admin-filter-select {
        width: 100%;
        min-width: 0;
    }
}

.admin-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #6b7280;
}

/* Make buttons sit nicely at the bottom */
.admin-card .btn {
    align-self: flex-start;
    display: inline-flex;          /* so we can center content */
    align-items: center;
    justify-content: center;
    width: 220px;                  /* pick a width that fits your longest label */
    text-align: center;
}

/* Small-screen tweaks */
@media (max-width: 768px) {
    .page-shell {
        padding: 1.75rem 1.25rem 3rem;
    }

    .page-header {
        text-align: left;
    }

    .page-title {
        font-size: 1.5rem;
    }
}



/* Maintenance: user table */

.admin-table-wrapper {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: var(--space-4) var(--space-5);
}

.admin-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.admin-table-header h2 {
    margin: 0;
    font-size: 18px;
}

/* Admin layout container */

.admin-page {
    /* Admin pages: centered and a little wider than standard pages */
    max-width: var(--max-width-admin);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;  /* was a bit taller before */
}

/* Nav wrapper: center and bring closer to the title */

/* .admin-nav-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
} */

/* Wrapper so tabs line up with the cards */
.admin-shell--nav {
    /* The base .admin-shell already controls width/max-width */
    max-width: 100%;
    margin: 0 0 var(--space-6);
}

/* Admin nav as pill tabs */
.admin-nav {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    /* background: rgba(15, 23, 42, 0.02); */
    padding: 0.35rem;
    /* border-radius: var(--radius-pill); */
    /* border: 1px solid rgba(148, 163, 184, 0.35); */
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-subtle);
    width: fit-content; /* take only as much width as needed */
    margin: 0;          /* IMPORTANT: no centering here */
}

/* Individual tab */
.admin-nav__tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #9fa5b7;
    transition:
        color 0.18s ease,
        background-color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.12s ease;
}

.admin-nav__tab:hover {
    background: rgba(254, 92, 144, 0.08);
    color: #0f1220;
    transform: translateY(-1px);
}

/* Active tab */
.admin-nav__tab--active {
    color: #0f1220;
    background: #ffffff;
    border-radius: 4px;          /* ← square-ish instead of pill */
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(255, 255, 255, 0.4);
}

/* Remove the pink underline for the flat style */
.admin-nav__tab--active::after {
    content: none;
}

/* Small pink underline on the active tab for brand touch */
.admin-nav__tab--active::after {
    content: "";
    position: absolute;
    left: 16%;
    right: 16%;
    bottom: 0.2rem;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ff2f7f, #ff6cab);
}

/* Make sure the nav and header align with the cards grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem;
    max-width: var(--max-width-admin);
    margin: 0 auto;
}

/* On smaller screens, keep the 1-column layout comfortable */

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

/* === Admin layout alignment =================================== */

/* One shared column width for the whole admin area */
.admin-page {
    max-width: var(--max-width-admin);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 3rem;
}

/* Nav wrapper: same width as cards, left-aligned inside it */
.admin-nav-wrapper {
    max-width: var(--max-width-admin);
    margin: 1.5rem auto 1.5rem;    /* center the whole group, not the tabs themselves */
    display: flex;
    justify-content: flex-start;   /* tabs start where the cards start */
}

/* Grid uses same width so everything lines up vertically */
.admin-grid {
    max-width: var(--max-width-admin);
    margin: 0 auto;
}



/* ------------------------------
   7. Auth pages (login / register)
   ------------------------------ */

.auth-shell {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
}

.auth-brand-header{
    margin-top: 0;
    margin-bottom: 0;
}

.auth-card__meta{
    display:flex;
    gap:0.5rem;
    flex-wrap:wrap;
    align-items:center;
    margin:0 0 1rem;
    color:#64748b;
    font-size:13px;
}

.auth-support-links{
    display:flex;
    gap:0.75rem;
    flex-wrap:wrap;
    align-items:center;
    justify-content:flex-start;
    margin-top:1rem;
    color:#64748b;
}

.auth-support-links a{
    color:#b3125b;
    text-decoration:none;
    font-weight:600;
}

.auth-support-links a:hover{
    text-decoration:underline;
}

.auth-support-panel{
    border:1px solid rgba(148, 163, 184, 0.22);
    background:rgba(148, 163, 184, 0.08);
    border-radius:16px;
    padding:1rem 1.1rem;
    margin-top:1rem;
}

.auth-support-panel h2{
    margin:0 0 0.5rem;
    font-size:16px;
}

.auth-support-panel ul{
    margin:0;
    padding-left:1.2rem;
    color:#475569;
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: var(--space-6) var(--space-5);
}

/* Wider card for the longer registration form */

.auth-card--wide {
    max-width: 960px;
}

/*                End              */

/* Special tweaks for register page */

.register-page .auth-card {
    padding: 2.25rem 2.5rem 2.5rem;
}

.auth-intro {
    margin-bottom: 1.5rem;
    color: #6b7280;
    font-size: 0.95rem;
}

/*                End              */

.auth-card h2 {
    margin-top: 0;
    margin-bottom: var(--space-2);
    font-size: 24px;
}

.auth-card p.lead {
    margin-top: 0;
    margin-bottom: var(--space-5);
    color: var(--color-text-muted);
}

.auth-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
}

/* Auth-specific tweaks */

.auth-page .auth-card {
    width: 100%;
    max-width: 540px;        /* keeps the login nice and compact */
}

.auth-page--login .auth-card{
    padding-bottom: 1.75rem;
}


@media (min-width: 880px) {
    .auth-form-grid {
        grid-template-columns: 1.1fr 0.9fr;
        column-gap: var(--space-8);
    }
}

/* Make admin cards equal height in each row */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 1.75rem 2rem;
    align-items: stretch;           /* stretch cards to same height */
}

/* Stack card content vertically so we can pin the button to the bottom */
.admin-card {
    display: flex;
    flex-direction: column;
}

/* Give text a bit of breathing room, but let the button sit at the bottom */
.admin-card p {
    margin-bottom: 1.5rem;
}

/* Anchor the button to the bottom of the card */
.admin-card .btn {
    margin-top: auto;               /* pushes button down within flex column */
    align-self: flex-start;         /* keep it left-aligned inside the card */
    width: 220px;                   /* from earlier for uniform width */
}


/* Error banner */

.error,
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-4);
    font-size: 14px;
}

/* Form spacing: consistent gaps between rows and button */

.form-row {
    margin-bottom: 1rem;     /* space between email and password */
}

/* Consistent action row: spaced buttons, wraps on small screens */
.form-actions {
    margin-top: 1.75rem;      /* space between last input and buttons */
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

/* Stacked form layout (one field per row) */
.form-grid.form-grid--stacked {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* Fieldsets inside the card */
.form-section {
    border: 0;
    padding: 0;
    margin: 1.5rem 0 0;
}

.form-section:first-of-type {
    margin-top: 0.5rem;
}

.form-section > legend {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

/* Fields */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #374151;
}

/* Profile form layout */

.profile-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.profile-grid .form-group--full{
    grid-column: 1 / -1;
}

@media (max-width: 680px){
    .profile-grid{ grid-template-columns: 1fr; }
}

/* Optional: left-aligned action rows (only if a view adds this modifier) */
.form-actions.form-actions--start {
    justify-content: flex-start;
}

/* Make the registration card sit nicely on tall screens */
.register-page .auth-layout {
    align-items: flex-start;
}

@media (min-height: 780px) {
    .register-page.auth-layout--centered {
        align-items: center;
    }
}

/* ------------------------------
   8. Assessment pages tweaks
   ------------------------------ */

h1, h2, h3 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 26px;
}

h2 {
    font-size: 20px;
}

.lead-text {
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

/* Question table specific */

.q-code {
    white-space: nowrap;
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-muted);
}

.q-text {
    font-size: 14px;
}


/* --- Pills (badges) --- */

.pill{
    display:inline-block;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(148,163,184,0.14);
    color: #475569;
    white-space: nowrap;
}
.pill--ok{
    background: rgba(34,197,94,0.14);
    border-color: rgba(34,197,94,0.28);
    color: #166534;
}
.pill--warn{
    background: rgba(249,115,22,0.12);
    border-color: rgba(249,115,22,0.26);
    color: #9a3412;
}
.pill--bad{
    background: rgba(239,68,68,0.12);
    border-color: rgba(239,68,68,0.26);
    color: #991b1b;
}
.pill--neutral{
    background: rgba(148,163,184,0.14);
    border-color: rgba(148,163,184,0.35);
    color: #475569;
}


/* Admin table actions (right side) */
.admin-table-actions{ display:flex; gap:0.5rem; flex-wrap:wrap; justify-content:flex-end; }


/* Admin pages: keep nav and content aligned (avoid double horizontal padding) */
.page-shell.page-shell--admin{
    /* Admin pages already constrain width via .admin-page – don't double-limit */
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}
/* Force the same behaviour on mobile where .page-shell padding is redefined */
@media (max-width: 768px){
    .page-shell.page-shell--admin{
        padding-left: 0;
        padding-right: 0;
    }
}

/* Ensure active admin tab never shows underline (dedupe guard) */
.admin-nav__tab--active::after{ content:none !important; }

/* Extra-small buttons */
.btn-xs{ padding: 0.35rem 0.85rem; font-size: 0.78rem; }


/* --- Flash / alerts --- */
.flash-success,
.flash-error,
.flash-warning{
    padding: 0.85rem 1rem;
    border-radius: 14px;
    margin: 0 0 1rem 0;
    border: 1px solid rgba(148,163,184,0.35);
    background: rgba(148,163,184,0.10);
}
.flash-success{
    border-color: rgba(34,197,94,0.28);
    background: rgba(34,197,94,0.12);
    color: #166534;
}
.flash-error{
    border-color: rgba(239,68,68,0.26);
    background: rgba(239,68,68,0.10);
    color: #991b1b;
}

.flash-warning{
    border-color: rgba(245,158,11,0.30);
    background: rgba(245,158,11,0.12);
    color: #92400e;
}
.alert.alert--info{
    padding: 0.85rem 1rem;
    border-radius: 14px;
    margin: 0 0 1rem 0;
    border: 1px solid rgba(56,189,248,0.28);
    background: rgba(56,189,248,0.10);
    color: #075985;
}

.alert.alert--error{
    padding: 0.85rem 1rem;
    border-radius: 14px;
    margin: 0 0 1rem 0;
    border: 1px solid rgba(239,68,68,0.26);
    background: rgba(239,68,68,0.10);
    color: #991b1b;
}

.alert.alert--warning{
    padding: 0.85rem 1rem;
    border-radius: 14px;
    margin: 0 0 1rem 0;
    border: 1px solid rgba(245,158,11,0.30);
    background: rgba(245,158,11,0.12);
    color: #92400e;
}

/* Form validation: highlight required fields on submit (client-side) */
.form--submitted input:invalid,
.form--submitted select:invalid,
.form--submitted textarea:invalid{
    border-color: rgba(239,68,68,0.55) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.form-error-summary{
    margin-bottom: 1rem;
}

.field-error{
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: #991b1b;
}



.reports-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.reports-chart {
    min-height: 380px;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
}

.autosave-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 6px;
    background: #f1f1f1;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    z-index: 1000;
    transition: all .2s ease;
}

.autosave-saving {
    background: #fff3cd;
    color: #856404;
}

.autosave-saved {
    background: #e6fffa;
    color: #065f46;
}

.autosave-error {
    background: #fde2e2;
    color: #7f1d1d;
}

.float-left-button {
  float: left;
}



/* --- Traffic Light Dashboard --- */
.score-grid {
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    margin-bottom:20px;
}

.traffic-dashboard {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.traffic-card {
    padding: 12px 18px;
    border-radius: 8px;
    color: #fff;
    min-width: 110px;
    text-align: center;
}
.green { background: #2E7D32; }
.orange { background: #F57C00; }
.red { background: #C62828; }


.score-tile {
    padding:15px;
    border-radius:8px;
    color:white;
    min-width:120px;
    text-align:center;
    font-weight:600;
}

/* Print-friendly reports (browser "Save as PDF") */
@media print {
  ._admin_nav,
  nav,
  header,
  .tabs,
  .btn,
  #downloadPDF {
    display: none !important;
  }

  .container,
  .container--wide {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  /* --- Page-break control: keep key blocks from splitting across pages --- */
  .print-block,
  .traffic-group,
  .traffic-dashboard,
  .risk-indicator,
  .report-card,
  .chart-card,
  .card {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Keep headings with the content that follows */
  h1, h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }
}


/* Reports empty-state / disabled export button */
.btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}


/* --- Admin Reports: cleaner Organisation Trends legend (2-row grid) --- */
.chart-legend-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px 14px;
  padding: 12px 14px;
  margin-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.chart-legend-item{
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 12px;
  color: rgba(15, 23, 42, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  /* now a button (clickable legend) */
  background: transparent;
  border: 0;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

.chart-legend-item:hover{
  background: rgba(15, 23, 42, 0.04);
}

.chart-legend-item:focus-visible{
  outline: 2px solid rgba(233, 30, 99, 0.35);
  outline-offset: 2px;
}

.chart-legend-item.is-off{
  opacity: .45;
}
.chart-legend-swatch{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}
@media (max-width: 900px){
  .chart-legend-grid{ grid-template-columns: repeat(2, minmax(140px, 1fr)); }
}
@media print{
  .chart-legend-grid{ grid-template-columns: repeat(4, minmax(120px, 1fr)); }
}


/* ------------------------------
   Portal language switch
   ------------------------------ */

.portal-google-translate,
.goog-te-banner-frame,
.goog-logo-link,
.goog-te-gadget > span,
.goog-te-gadget span > a {
    display: none !important;
}

.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}

body {
    top: 0 !important;
}

.portal-language-switch {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 9999;
}

.portal-language-switch__toggle {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: var(--color-text-main);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    padding: 0.75rem 0.95rem;
    min-width: 4.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.portal-language-switch__toggle:hover {
    background: #f8fafc;
}

.portal-language-switch__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.6rem);
    min-width: 13rem;
    padding: 0.45rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
}

.portal-language-switch__option {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.7rem 0.8rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    text-align: left;
    color: var(--color-text-main);
    font-size: 0.95rem;
    text-decoration: none;
}

.portal-language-switch__option:hover,
.portal-language-switch__option:focus-visible,
.portal-language-switch__option.is-active {
    background: rgba(255, 63, 134, 0.10);
    outline: none;
}

.portal-language-switch__option::before {
    content: attr(data-language-flag);
    font-size: 1.1rem;
    line-height: 1;
}

.portal-language-switch__current-flag {
    font-size: 1rem;
    line-height: 1;
}

.portal-language-switch__current-label {
    letter-spacing: 0.04em;
}

.portal-language-switch__chevron {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

@media (max-width: 640px) {
    .portal-language-switch {
        right: 0.85rem;
        bottom: 0.85rem;
    }

    .portal-language-switch__toggle {
        min-width: 4.25rem;
        padding: 0.7rem 0.85rem;
    }

    .portal-language-switch__menu {
        min-width: 11.5rem;
        max-width: calc(100vw - 1.7rem);
    }
}

.nav-notifications {
  position: relative;
}

.nav-notifications summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: inherit;
}
.nav-notifications summary::-webkit-details-marker { display:none; }

.nav-notifications__badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.1rem;
  height:1.1rem;
  padding:0 .25rem;
  border-radius:999px;
  background:#ef476f;
  color:#fff;
  font-size:.72rem;
  font-weight:700;
}

.nav-notifications__panel {
  position:absolute;
  inset-inline-end:0;
  top:calc(100% + .5rem);
  width:min(26rem, 85vw);
  background:#fff;
  color:#111827;
  border:1px solid #dbe3f0;
  border-radius:14px;
  box-shadow:0 18px 45px rgba(15, 23, 42, .18);
  padding:1rem;
  z-index:1000;
}

.nav-notifications__header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem;
  margin-bottom:.75rem;
}

.nav-notifications__actions {
  display:flex;
  gap:.5rem;
  align-items:center;
  flex-wrap:wrap;
}

.nav-notifications__actions a {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:2rem;
  padding:.35rem .65rem;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#ffffff;
  color:#0f172a !important;
  text-decoration:none;
  font-size:.85rem;
  font-weight:600;
  line-height:1;
}

.nav-notifications__actions a:hover {
  background:#f8fafc;
  border-color:#94a3b8;
}

.nav-notifications__actions a:visited,
.nav-notifications__actions a:active {
  color:#0f172a !important;
}

.nav-notifications__list {
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:.55rem;
}

.nav-notifications__list li a {
  display:block;
  text-decoration:none;
  color:inherit;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:.75rem;
  background:#fff;
}
.nav-notifications__list li.is-unread a {
  border-color:#ffd6e0;
  background:#fff8fb;
}
.nav-notifications__list li a strong,
.nav-notifications__list li a span,
.nav-notifications__list li a small {
  display:block;
}
.nav-notifications__list li a span { margin-top:.2rem; font-size:.92rem; }
.nav-notifications__list li a small { margin-top:.35rem; color:#6b7280; }

.report-panel {
  display:grid;
  gap:1rem;
}
.report-panel__meta {
  display:flex;
  flex-wrap:wrap;
  gap:.65rem 1rem;
  color:#475569;
  font-size:.95rem;
}
.report-panel textarea {
  width:100%;
}
.report-output {
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:1rem;
  background:#fff;
  white-space:pre-wrap;
}


/* Improvement report print tuning */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm;
  }

  html, body {
    background: #fff !important;
  }

  .report-pack-page,
  .report-pack-page .page-shell,
  .report-pack-page .page-header,
  .report-pack-page .admin-card,
  .report-pack-page section,
  .report-pack-page table,
  .report-pack-page ul,
  .report-pack-page li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-pack-page .admin-card-grid {
    display: block !important;
  }

  .report-pack-page .admin-card {
    display: block !important;
    margin: 0 0 12px 0 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-pack-page .page-header {
    margin-bottom: 12px !important;
    page-break-after: avoid;
  }

  .report-pack-page .admin-card-actions {
    display: none !important;
  }

  .report-pack-page h1,
  .report-pack-page h2,
  .report-pack-page h3 {
    page-break-after: avoid;
    break-after: avoid;
  }
}

/* Reporting / governance polish */
.report-print-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  font-size: .92rem;
  color: #475569;
  margin-bottom: 1rem;
}
.report-print-meta strong {
  color: #0f172a;
  margin-right: .5rem;
}
.report-section-label {
  padding: .85rem 1rem;
  border-left: 4px solid rgba(15, 23, 42, .18);
  background: rgba(255,255,255,.75);
  border-radius: 12px;
}

.flash-success--brand,
.flash-error--brand,
.alert--brand{
  display:flex;
  align-items:flex-start;
  gap:.65rem;
}
.flash-success--brand strong,
.flash-error--brand strong,
.alert--brand strong{
  display:block;
  min-width:155px;
  font-size:.85rem;
  letter-spacing:.01em;
}
.flash-success--brand span,
.flash-error--brand span,
.alert--brand span{
  display:block;
}
.brand-empty-state,
.empty-state--brand{
  padding:1.35rem 1.25rem;
  border:1px dashed #d5dfeb;
  border-radius:18px;
  background:linear-gradient(180deg,#fbfdff 0%,#f5f8fc 100%);
  color:#405168;
}
.brand-empty-state h3,
.empty-state--brand h3{
  margin:0 0 .35rem;
  font-size:1.05rem;
  color:#0f172a;
}
.brand-empty-state p,
.empty-state--brand p{
  margin:0;
}
.brand-empty-state__eyebrow{
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  border-radius:999px;
  border:1px solid #d8e6f5;
  background:#eef6ff;
  color:#0b5a7a;
  padding:.2rem .55rem;
  font-size:.72rem;
  font-weight:700;
  margin-bottom:.55rem;
}
.report-brand-note{
  border:1px solid #d9e8f6;
  background:linear-gradient(180deg,#fbfdff 0%,#f3f8fe 100%);
  color:#264861;
  border-radius:14px;
  padding:12px 14px;
  margin:.75rem 0 1rem;
  font-size:13px;
}
.report-brand-note strong{
  display:block;
  margin-bottom:.2rem;
  color:#0f172a;
}
.client-report-brand-mark{
  display:flex;
  align-items:center;
  gap:.75rem;
  margin-bottom:1rem;
}
.client-report-brand-mark img{
  width:42px;
  height:42px;
  border-radius:10px;
  background:rgba(255,255,255,.12);
  padding:6px;
}
.client-report-brand-mark small{
  display:block;
  color:rgba(255,255,255,.75);
  letter-spacing:.03em;
  text-transform:uppercase;
}
.client-report-brand-mark strong{
  display:block;
  color:#fff;
  font-size:1rem;
}

.empty-state--helpful p {
  line-height: 1.45;
}

.empty-state--compact{
  padding:1rem 1.05rem;
  border-radius:14px;
}
.empty-state--compact h3{
  font-size:.98rem;
  margin-bottom:.25rem;
}
.empty-state--compact .brand-empty-state__eyebrow{
  margin-bottom:.4rem;
}
.empty-state__actions{
  margin-top:.85rem;
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:.5rem;
}
.form-submit-status{
  display:inline-flex;
  align-items:center;
  gap:.5rem;
  margin-top:.75rem;
  color:#526071;
  font-size:.9rem;
}
.form-submit-status[hidden]{
  display:none !important;
}
.form-submit-status::before{
  content:"";
  width:.9rem;
  height:.9rem;
  border-radius:999px;
  border:2px solid rgba(82,96,113,.25);
  border-top-color: var(--color-primary);
  animation: sawei-spin .8s linear infinite;
}
.btn.is-loading,
button.is-loading,
input.is-loading{
  position:relative;
  pointer-events:none;
  opacity:.88;
}
.btn.is-loading::before,
button.is-loading::before{
  content:"";
  width:.9rem;
  height:.9rem;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.35);
  border-top-color:#fff;
  display:inline-block;
  vertical-align:middle;
  margin-right:.45rem;
  animation: sawei-spin .8s linear infinite;
}
.btn.btn-secondary.is-loading::before,
button.btn-secondary.is-loading::before,
.btn.btn-ghost.is-loading::before,
button.btn-ghost.is-loading::before{
  border-color: rgba(15,23,42,.18);
  border-top-color: #0f172a;
}
@keyframes sawei-spin{
  to{ transform: rotate(360deg); }
}
@media screen {
  .print-only { display: none !important; }
}
@media print {
  @page { size: A4 portrait; margin: 10mm; }

  header,
  nav,
  .site-header,
  .top-nav,
  .admin-nav,
  .admin-tabs,
  ._admin_nav,
  .screen-only,
  .report-filters-card,
  .tabs,
  .form-actions,
  .portal-language-switch,
  #downloadPDF,
  .btn {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #0f172a !important;
  }

  .container,
  .container--wide {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .report-print-meta {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    border: 1px solid #d1d5db !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .card,
  .print-block,
  .traffic-group,
  .report-section-label,
  .chart-card,
  .report-tab,
  table,
  canvas {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .card {
    box-shadow: none !important;
    border: 1px solid #d1d5db !important;
    margin: 0 0 10px 0 !important;
    padding: 12px !important;
  }

  h1,
  h2,
  h3 {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .traffic-dashboard {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px !important;
  }

  .traffic-card,
  .traffic-card.green,
  .traffic-card.orange,
  .traffic-card.red {
    background: #fff !important;
    color: #111827 !important;
    border: 1px solid #374151 !important;
    box-shadow: none !important;
    min-width: 0 !important;
  }

  .chart-legend-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
@media print {
  .report-tab { display: block !important; }
}

@media (max-width: 860px) {
    .auth-screen--login{
        min-height:auto;
        gap:0.85rem;
    }
}



/* === Client-ready dashboard polish pass === */
.dashboard-shell{
  display:grid;
  gap:1.25rem;
}

.dashboard-hero{
  display:grid;
  grid-template-columns:minmax(0, 1.7fr) minmax(280px, .9fr);
  gap:1rem;
  align-items:stretch;
  padding:1.35rem 1.4rem;
  border-radius:24px;
  background:
    radial-gradient(circle at top right, rgba(214,26,114,.12), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(253,248,250,.98));
  border:1px solid rgba(214,26,114,.12);
  box-shadow:0 18px 40px rgba(14, 21, 35, .08);
}

.dashboard-hero--company{
  background:
    radial-gradient(circle at top right, rgba(214,26,114,.10), transparent 35%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.98));
}

.dashboard-hero__content{
  display:grid;
  gap:.85rem;
  align-content:start;
}

.dashboard-hero__eyebrow,
.dashboard-section__eyebrow,
.dashboard-callout__eyebrow,
.dashboard-empty__eyebrow,
.dashboard-hero-card__label,
.dashboard-action-card__tag{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#b11f63;
}

.dashboard-hero__title{
  margin:0;
  font-size:clamp(1.8rem, 2.6vw, 2.7rem);
  line-height:1.05;
  color:#161c2d;
}

.dashboard-hero__subtitle{
  margin:0;
  max-width:74ch;
  font-size:1rem;
  line-height:1.65;
  color:#556079;
}

.dashboard-meta-row,
.dashboard-chip-row{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

.dashboard-meta-pill,
.dashboard-chip{
  display:inline-flex;
  align-items:center;
  padding:.48rem .78rem;
  border-radius:999px;
  background:#fff;
  border:1px solid rgba(17, 28, 45, .08);
  color:#465067;
  font-size:.86rem;
  line-height:1.2;
  box-shadow:0 8px 20px rgba(17, 28, 45, .04);
}

.dashboard-hero__aside{
  display:flex;
}

.dashboard-hero-card{
  width:100%;
  display:grid;
  gap:.65rem;
  align-content:start;
  padding:1rem 1.05rem;
  border-radius:20px;
  background:linear-gradient(180deg, #fff, #fff7fb);
  border:1px solid rgba(214,26,114,.14);
  box-shadow:0 12px 30px rgba(214,26,114,.08);
}

.dashboard-hero-card__value{
  font-size:1.15rem;
  color:#161c2d;
}

.dashboard-hero-card__text{
  margin:0;
  color:#5b6478;
  line-height:1.55;
}

.dashboard-hero-card__actions{
  display:flex;
  flex-wrap:wrap;
  gap:.55rem;
}

.dashboard-callout{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:1rem;
  align-items:center;
  padding:1rem 1.15rem;
  border-radius:22px;
  border:1px solid rgba(17, 28, 45, .08);
  background:linear-gradient(180deg, #fff, #f8fbff);
  box-shadow:0 12px 26px rgba(17, 28, 45, .05);
}

.dashboard-callout__copy{
  display:grid;
  gap:.3rem;
}

.dashboard-callout__title{
  margin:0;
  font-size:1.15rem;
  color:#161c2d;
}

.dashboard-callout__text{
  margin:0;
  color:#5c6780;
  line-height:1.55;
}

.dashboard-section{
  display:grid;
  gap:.9rem;
}

.dashboard-section__header{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  align-items:end;
  flex-wrap:wrap;
}

.dashboard-section__title{
  margin:.1rem 0 0;
  font-size:1.35rem;
  line-height:1.2;
  color:#161c2d;
}

.dashboard-section__subtitle{
  margin:.2rem 0 0;
  color:#606a80;
  line-height:1.55;
}

.dashboard-section__actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}

.dashboard-metric-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:1rem;
}

.dashboard-metric-grid--company{
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
}

.dashboard-metric-card{
  display:grid;
  gap:.65rem;
  padding:1rem 1.05rem;
  border-radius:22px;
  background:#fff;
  color:inherit;
  text-decoration:none;
  border:1px solid rgba(17, 28, 45, .08);
  box-shadow:0 12px 28px rgba(17, 28, 45, .06);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.dashboard-metric-card:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 36px rgba(17, 28, 45, .10);
  border-color:rgba(214,26,114,.18);
}

.dashboard-metric-card__top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.75rem;
}

.dashboard-metric-card__label{
  display:block;
  font-size:.85rem;
  line-height:1.4;
  color:#667086;
}

.dashboard-metric-card__value{
  margin-top:.2rem;
  font-size:clamp(1.7rem, 2.2vw, 2.4rem);
  font-weight:800;
  line-height:1;
  color:#161c2d;
}

.dashboard-metric-card__help{
  margin:0;
  color:#59637a;
  line-height:1.55;
}

.dashboard-metric-card__cta{
  font-weight:700;
  color:#c71f69;
}

.dashboard-metric-card--good{
  background:linear-gradient(180deg, #ffffff, #f6fffb);
}
.dashboard-metric-card--warning{
  background:linear-gradient(180deg, #ffffff, #fffaf2);
}
.dashboard-metric-card--danger{
  background:linear-gradient(180deg, #ffffff, #fff6f8);
}
.dashboard-metric-card--neutral{
  background:linear-gradient(180deg, #ffffff, #fafbff);
}

.dashboard-panel-stack{
  display:grid;
  gap:1rem;
}

.dashboard-panel{
  border-radius:22px;
  border:1px solid rgba(17, 28, 45, .08);
  background:#fff;
  box-shadow:0 12px 28px rgba(17, 28, 45, .05);
  overflow:hidden;
}

.dashboard-panel__header{
  padding:1rem 1.1rem .25rem;
}

.dashboard-panel__title{
  margin:0;
  font-size:1.08rem;
  color:#161c2d;
}

.dashboard-panel__subtitle{
  margin:.28rem 0 0;
  color:#637089;
  line-height:1.55;
}

.dashboard-table-wrap{
  overflow:auto;
  padding:.25rem 0 0;
}

.dashboard-table{
  margin:0;
}

.dashboard-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:#fbfcff;
  font-size:.78rem;
  letter-spacing:.03em;
  text-transform:uppercase;
  color:#6b758c;
}

.dashboard-table tbody td{
  vertical-align:top;
}

.dashboard-empty{
  display:grid;
  gap:.22rem;
  padding:.35rem 0;
}

.dashboard-empty__title{
  color:#161c2d;
  font-size:1rem;
}

.dashboard-empty__text{
  margin:0;
  color:#6a748a;
  line-height:1.55;
}

.dashboard-action-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px, 1fr));
  gap:1rem;
}

.dashboard-action-card{
  display:grid;
  gap:.65rem;
  align-content:start;
  padding:1rem 1.05rem;
  border-radius:22px;
  background:linear-gradient(180deg, #fff, #fbfcff);
  border:1px solid rgba(17, 28, 45, .08);
  box-shadow:0 12px 28px rgba(17, 28, 45, .05);
}

.dashboard-action-card--quiet{
  background:linear-gradient(180deg, #ffffff, #f8f9fb);
}

.dashboard-action-card h3{
  margin:0;
  font-size:1.08rem;
  color:#161c2d;
}

.dashboard-action-card p{
  margin:0;
  color:#5f6980;
  line-height:1.6;
}

.dashboard-action-card__buttons,
.dashboard-inline-form,
.dashboard-inline-stack{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
}

.dashboard-inline-form{
  align-items:end;
}

.dashboard-inline-form label{
  flex:1 1 100%;
}

.dashboard-inline-form .form-control{
  min-width:220px;
}

.dashboard-inline-card{
  padding:.8rem .85rem;
  border-radius:18px;
  background:#fff;
  border:1px solid rgba(17, 28, 45, .08);
}

.dashboard-inline-card p{
  margin:.1rem 0;
}

.dashboard-key-value-list{
  display:grid;
  gap:.45rem;
}

@media (max-width: 980px){
  .dashboard-hero{
    grid-template-columns:1fr;
  }

  .dashboard-callout{
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px){
  .dashboard-hero{
    padding:1rem;
    border-radius:18px;
  }

  .dashboard-metric-card,
  .dashboard-action-card,
  .dashboard-panel,
  .dashboard-callout{
    border-radius:18px;
  }

  .dashboard-section__header{
    align-items:start;
  }

  .dashboard-table thead th{
    position:static;
  }
}



/* === Dashboard polish pass 2 === */
.dashboard-hero__toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
}

.dashboard-section__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:2rem;
  margin-left:.55rem;
  padding:.18rem .55rem;
  border-radius:999px;
  background:rgba(214,26,114,.10);
  color:#b11f63;
  font-size:.82rem;
  font-weight:700;
  vertical-align:middle;
}

.dashboard-hero-card__stats{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:.6rem;
}

.dashboard-mini-stat{
  display:grid;
  gap:.15rem;
  padding:.65rem .7rem;
  border-radius:16px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(17,28,45,.07);
}

.dashboard-mini-stat strong{
  font-size:1rem;
  color:#151c2e;
}

.dashboard-mini-stat em{
  font-style:normal;
  font-size:.78rem;
  color:#65708a;
}

.dashboard-panel__count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:4.5rem;
  padding:.28rem .65rem;
  border-radius:999px;
  background:#f5f7fb;
  border:1px solid rgba(17,28,45,.08);
  color:#5f6980;
  font-size:.78rem;
  font-weight:700;
}

.dashboard-table tbody tr:hover{
  background:rgba(214,26,114,.03);
}

.dashboard-table tbody td:first-child strong,
.dashboard-table tbody td:first-child a{
  color:#1b2436;
}

.dashboard-action-card{
  position:relative;
}

.dashboard-action-card__buttons .btn,
.dashboard-hero__toolbar .btn,
.dashboard-section__actions .btn{
  box-shadow:0 8px 18px rgba(17,28,45,.05);
}

.dashboard-callout__action{
  display:flex;
  align-items:center;
}

.dashboard-panel__header,
.dashboard-callout,
.dashboard-action-card,
.dashboard-metric-card,
.dashboard-hero-card{
  backdrop-filter:saturate(120%);
}

.dashboard-section__header > div{
  max-width:70ch;
}

@media (max-width: 640px){
  .dashboard-hero-card__stats{
    grid-template-columns:1fr;
  }
  .dashboard-panel__count{
    min-width:unset;
  }
}


/* Rebuild cockpit polish */
.rebuild-link-card,
.rebuild-detail-card{
  align-content:start;
}

.rebuild-link-list{
  display:grid;
  gap:.55rem;
}

.rebuild-link-list__item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.72rem .85rem;
  border-radius:14px;
  background:rgba(255,255,255,.88);
  border:1px solid rgba(17, 28, 45, .08);
  color:#c71f69;
  text-decoration:none;
  font-weight:600;
  box-shadow:0 8px 20px rgba(17, 28, 45, .04);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rebuild-link-list__item::after{
  content:'→';
  color:#8c96ac;
  font-weight:700;
}

.rebuild-link-list__item:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(17, 28, 45, .08);
  border-color:rgba(214,26,114,.18);
}

.rebuild-stat-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:.65rem;
}

.rebuild-stat-list li{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:.72rem .82rem;
  border-radius:14px;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(17, 28, 45, .06);
}

.rebuild-stat-list span{
  color:#586277;
  line-height:1.45;
}

.rebuild-stat-list strong{
  color:#161c2d;
  font-weight:700;
  white-space:nowrap;
}

@media (max-width: 640px){
  .rebuild-stat-list li{
    flex-direction:column;
  }
}

/* ==========================================================
   Client-ready shared chrome pass: tables, empty states, buttons
   UI-only: no workflow, controller, or database behavior changed.
   ========================================================== */

:root{
  --chrome-page-padding: clamp(1rem, 2.2vw, 2rem);
  --chrome-card-radius: 22px;
  --chrome-control-radius: 12px;
  --chrome-table-row: rgba(248, 250, 252, .72);
  --chrome-table-row-hover: rgba(214, 26, 114, .045);
  --chrome-ring: 0 0 0 3px rgba(214, 26, 114, .14);
  --shadow-card-client: 0 16px 42px rgba(15, 23, 42, .075);
  --shadow-card-client-hover: 0 22px 54px rgba(15, 23, 42, .12);
}

/* Shared page chrome ------------------------------------------------------ */
main{
  background:
    radial-gradient(circle at 7% 0%, rgba(214,26,114,.045), transparent 28rem),
    radial-gradient(circle at 96% 12%, rgba(14,165,233,.045), transparent 24rem),
    var(--color-page-bg);
}

.page-shell,
.admin-page,
.container,
.container--wide{
  position:relative;
}

.page-header{
  margin:0 0 1.25rem;
  padding:1.15rem 1.25rem;
  border-radius:var(--chrome-card-radius);
  background:
    radial-gradient(circle at top right, rgba(214,26,114,.10), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
  border:1px solid rgba(148,163,184,.20);
  box-shadow:var(--shadow-card-client);
}

.page-title{
  margin:0;
  letter-spacing:-.025em;
  color:#0f172a;
}

.page-lead{
  max-width:78ch;
  margin:.4rem 0 0;
  color:#64748b;
  line-height:1.65;
}

.admin-nav{
  width:100%;
  max-width:100%;
  overflow-x:auto;
  padding:.45rem;
  border:1px solid rgba(148,163,184,.18);
  border-radius:16px;
  background:rgba(255,255,255,.78);
  box-shadow:0 12px 28px rgba(15,23,42,.055);
}

.admin-nav__tab{
  border-radius:12px;
  color:#64748b;
  min-height:38px;
  white-space:nowrap;
}

.admin-nav__tab--active{
  border-radius:12px;
  color:#0f172a;
  background:linear-gradient(180deg,#ffffff,#f8fafc);
  box-shadow:0 10px 24px rgba(15,23,42,.10), inset 0 0 0 1px rgba(214,26,114,.08);
}
.admin-nav__tab--active::after{ content:none !important; }

.site-header-inner{
  gap:clamp(.9rem, 2vw, 1.5rem);
}

.main-nav{
  gap:.35rem;
}

.main-nav a,
.nav-notifications summary{
  min-height:38px;
  border:1px solid transparent;
}

.main-nav a:hover,
.nav-notifications summary:hover{
  border-color:rgba(255,255,255,.10);
  text-decoration:none;
}

/* Client-ready buttons --------------------------------------------------- */
.btn,
button.btn,
a.btn,
input[type="submit"].btn,
input[type="button"].btn{
  min-height:40px;
  border-radius:var(--chrome-control-radius);
  padding:.62rem 1rem;
  font-weight:700;
  letter-spacing:.005em;
  border:1px solid transparent;
  box-shadow:0 10px 22px rgba(15,23,42,.08);
  transition:transform .16s ease, box-shadow .16s ease, background-color .16s ease, border-color .16s ease, color .16s ease;
}

.btn:hover,
button.btn:hover,
a.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 16px 30px rgba(15,23,42,.13);
  text-decoration:none;
}

.btn:active,
button.btn:active,
a.btn:active{
  transform:translateY(0);
  box-shadow:0 8px 18px rgba(15,23,42,.10);
}

.btn:focus-visible,
button:focus-visible,
a.btn:focus-visible{
  outline:none;
  box-shadow:var(--chrome-ring), 0 14px 30px rgba(15,23,42,.12);
}

.btn-pink,
.btn-primary{
  background:linear-gradient(135deg, #ec2e7d, #d61a72);
  color:#fff;
  border-color:rgba(214,26,114,.20);
}

.btn-dark,
.btn-secondary{
  background:linear-gradient(135deg, #071424, #111827);
  color:#fff;
  border-color:rgba(15,23,42,.18);
}

.btn-ghost{
  background:rgba(255,255,255,.82);
  color:#172033;
  border-color:rgba(148,163,184,.35);
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}
.btn-ghost:hover{
  background:#fff;
  border-color:rgba(214,26,114,.24);
}

.btn-danger{
  border-radius:var(--chrome-control-radius);
  background:#fff;
  color:#b42318;
  border-color:rgba(239,68,68,.30);
  box-shadow:0 8px 18px rgba(239,68,68,.06);
}
.btn-danger:hover{
  background:#fff6f6;
  border-color:rgba(239,68,68,.44);
}

.btn-sm{ min-height:36px; padding:.48rem .82rem; font-size:.84rem; }
.btn-xs{ min-height:32px; padding:.38rem .7rem; font-size:.78rem; border-radius:10px; }

.admin-card .btn{
  width:auto;
  max-width:100%;
}

.admin-table-actions,
.dashboard-section__actions,
.dashboard-hero__toolbar,
.dashboard-action-card__buttons{
  align-items:center;
}

/* Tables: clearer, calmer, client-ready -------------------------------- */
.table-responsive,
.admin-table-wrapper,
.dashboard-table-wrap,
.admin-card .admin-table-wrapper,
.report-tab .card{
  scrollbar-width:thin;
  scrollbar-color:#cbd5e1 transparent;
}

.admin-table-wrapper,
.dashboard-panel,
.card,
.admin-card{
  border:1px solid rgba(148,163,184,.18);
  box-shadow:var(--shadow-card-client);
}

.admin-table-wrapper{
  border-radius:var(--chrome-card-radius);
  padding:0;
  overflow:hidden;
}

.admin-table-header{
  margin:0;
  padding:1rem 1.1rem;
  border-bottom:1px solid rgba(148,163,184,.18);
  background:linear-gradient(180deg,#fff,#fbfcff);
  gap:1rem;
}

.admin-table-header h2,
.card-head h2,
.dashboard-panel__title{
  letter-spacing:-.01em;
}

.admin-table,
.table,
.assessment-table,
.dashboard-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:.91rem;
}

.admin-table thead tr,
.table thead tr,
.assessment-table thead tr,
.dashboard-table thead tr{
  background:linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.admin-table th,
.table th,
.assessment-table th,
.dashboard-table thead th{
  padding:.78rem .95rem;
  color:#5b667a;
  font-size:.75rem;
  font-weight:800;
  letter-spacing:.065em;
  text-transform:uppercase;
  border-bottom:1px solid rgba(148,163,184,.26);
  white-space:nowrap;
}

.admin-table td,
.table td,
.assessment-table td,
.dashboard-table tbody td{
  padding:.86rem .95rem;
  color:#263246;
  border-bottom:1px solid rgba(148,163,184,.16);
  vertical-align:middle;
}

.admin-table tbody tr:nth-child(even),
.table tbody tr:nth-child(even),
.assessment-table tbody tr:nth-child(even),
.dashboard-table tbody tr:nth-child(even){
  background:var(--chrome-table-row);
}

.admin-table tbody tr:hover,
.table tbody tr:hover,
.assessment-table tbody tr:hover,
.dashboard-table tbody tr:hover{
  background:var(--chrome-table-row-hover);
}

.admin-table tbody tr:last-child td,
.table tbody tr:last-child td,
.assessment-table tbody tr:last-child td,
.dashboard-table tbody tr:last-child td{
  border-bottom:0;
}

.admin-table td:last-child,
.table td:last-child,
.assessment-table td:last-child{
  white-space:nowrap;
}

.admin-table td:first-child,
.table td:first-child,
.assessment-table td:first-child{
  font-weight:650;
  color:#101827;
}

.admin-table-wrapper--scroll,
.table-responsive,
.dashboard-table-wrap{
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Keep tables readable on smaller laptops without crushing columns. */
@media (max-width: 980px){
  .admin-table,
  .table,
  .assessment-table,
  .dashboard-table{
    min-width:760px;
  }

  .admin-table-header{
    align-items:flex-start;
    flex-direction:column;
  }

  .admin-table-actions{
    justify-content:flex-start;
  }
}

/* Status pills and badges ------------------------------------------------ */
.pill,
.role-badge,
.env-badge,
.dashboard-meta-pill,
.dashboard-chip,
.step-badge,
.save-badge{
  border-radius:999px;
  font-weight:750;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.45);
}

.pill{
  padding:.28rem .66rem;
  line-height:1.25;
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}
.pill::before{
  content:"";
  width:.42rem;
  height:.42rem;
  border-radius:999px;
  background:currentColor;
  opacity:.68;
}

/* Empty states ----------------------------------------------------------- */
.empty-state,
.brand-empty-state,
.empty-state--brand,
.dashboard-empty{
  position:relative;
  overflow:hidden;
}

.empty-state,
.brand-empty-state,
.empty-state--brand{
  border-radius:20px;
  padding:1.35rem 1.25rem;
  background:
    radial-gradient(circle at top right, rgba(214,26,114,.075), transparent 42%),
    linear-gradient(180deg,#ffffff,#f8fbff);
  border:1px dashed rgba(148,163,184,.45);
  box-shadow:0 10px 26px rgba(15,23,42,.045);
}

.empty-state::before,
.empty-state--brand::before,
.brand-empty-state::before{
  content:"";
  position:absolute;
  inset:auto 1.1rem 1.1rem auto;
  width:72px;
  height:72px;
  border-radius:24px;
  background:linear-gradient(135deg, rgba(214,26,114,.09), rgba(14,165,233,.08));
  transform:rotate(10deg);
  pointer-events:none;
}

.brand-empty-state__eyebrow,
.dashboard-empty__eyebrow{
  background:#eef6ff;
  color:#075985;
  border-color:rgba(14,165,233,.18);
}

.empty-state h3,
.empty-state--brand h3,
.brand-empty-state h3{
  letter-spacing:-.01em;
}

.empty-state__actions .btn{
  min-width:180px;
}

/* Forms and filters ------------------------------------------------------ */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
textarea,
.input-text,
.input-select,
.input-textarea,
.form-control{
  min-height:40px;
  border-radius:var(--chrome-control-radius);
  border-color:rgba(148,163,184,.34);
  background:#fff;
  transition:border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

textarea{ min-height:108px; }

input:focus,
select:focus,
textarea:focus,
.input-text:focus,
.input-select:focus,
.input-textarea:focus,
.form-control:focus{
  outline:none;
  border-color:rgba(214,26,114,.45);
  box-shadow:var(--chrome-ring);
}

.admin-filter-row,
.reports-filters{
  padding:.85rem;
  border-radius:18px;
  background:rgba(255,255,255,.74);
  border:1px solid rgba(148,163,184,.18);
}

/* Dashboard panels and action cards ------------------------------------- */
.dashboard-panel,
.dashboard-action-card,
.dashboard-metric-card,
.dashboard-callout,
.dashboard-hero,
.dashboard-hero-card{
  box-shadow:var(--shadow-card-client);
}

.dashboard-panel:hover,
.dashboard-action-card:hover,
.dashboard-metric-card:hover{
  box-shadow:var(--shadow-card-client-hover);
}

.dashboard-panel__header{
  background:linear-gradient(180deg,#fff,#fbfcff);
  border-bottom:1px solid rgba(148,163,184,.14);
  padding:1rem 1.1rem;
}

.dashboard-table-wrap{ padding:0; }

.dashboard-table{ min-width:680px; }

/* Shared card polish ----------------------------------------------------- */
.card,
.admin-card{
  border-radius:var(--chrome-card-radius);
}

.card-head,
.admin-filter-row,
.admin-table-header{
  row-gap:.7rem;
}

.flash-success,
.flash-error,
.flash-warning,
.alert.alert--info,
.alert.alert--error,
.alert.alert--warning,
.alert--brand,
.flash-success--brand,
.flash-error--brand{
  border-radius:16px;
  box-shadow:0 8px 20px rgba(15,23,42,.045);
}

/* Footer/chrome finish --------------------------------------------------- */
footer{
  margin-top:auto;
}

.portal-language-switch__toggle{
  box-shadow:0 10px 24px rgba(15,23,42,.12);
}

@media (max-width: 640px){
  main{ padding-left:1rem; padding-right:1rem; }
  .page-header{ padding:1rem; border-radius:18px; }
  .btn,
  button.btn,
  a.btn{ width:100%; }
  .admin-table-actions .btn,
  .dashboard-section__actions .btn,
  .dashboard-hero__toolbar .btn,
  .dashboard-action-card__buttons .btn,
  .empty-state__actions .btn{ width:auto; }
}



/* =========================
   Assessment review + working page polish
   ========================= */
.review-shell .page-header,
.assessment-workspace .assessment-title {
    position: relative;
}

.review-shell .page-header {
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.4rem;
    border-radius: 1.5rem;
    background: linear-gradient(135deg, rgba(15,23,42,.98), rgba(17,24,39,.92));
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.16);
}
.review-shell .page-title,
.review-shell .page-lead { color: #fff; }
.review-shell .page-lead { max-width: 62ch; opacity: .86; }

.review-shell .admin-card,
.assessment-workspace .card--assessment,
.assessment-workspace .admin-card {
    border: 1px solid rgba(148,163,184,.16);
    box-shadow: 0 18px 48px rgba(15,23,42,.09);
}

.review-shell .admin-card__title,
.assessment-workspace .card--assessment h2 {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #0f172a;
}

.review-shell .admin-card__body,
.assessment-workspace .card--assessment {
    color: #334155;
}

.review-shell .admin-card-grid--detail-top .admin-card {
    min-height: 100%;
    background: linear-gradient(180deg, #fff, #fcfdff);
}

.review-summary-card .admin-card__body > div:first-child,
.review-workflow-card .admin-card__body > div:first-child {
    gap: .55rem !important;
}

.review-summary-card strong,
.review-checklist-card strong {
    color: #0f172a;
}

.review-workflow-card form,
.review-note-composer form,
.section-workflow-card form {
    background: linear-gradient(180deg, rgba(248,250,252,.9), #fff);
    border: 1px solid rgba(226,232,240,.9);
    border-radius: 1.1rem;
    padding: 1rem;
}

.review-summary-boxes .admin-card__body > p.muted:first-of-type,
.theme-review-thread > .muted,
.section-workflow-card > .muted {
    max-width: 70ch;
    line-height: 1.6;
}

.review-summary-boxes h3,
.review-summary-boxes h4 {
    color: #0f172a;
    letter-spacing: -.01em;
}

.review-summary-boxes section[style*="border:1px solid"] {
    border: 1px solid rgba(226,232,240,.9) !important;
    border-radius: 1.25rem !important;
    padding: 1rem 1rem 1.1rem !important;
    background: linear-gradient(180deg, rgba(248,250,252,.72), #fff);
}

.review-shell .admin-filter-row,
.questions-head,
.assessment-workspace .assessment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.review-shell .admin-table-wrapper,
.assessment-workspace .table-responsive {
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1.05rem;
    overflow: hidden;
    background: #fff;
}

.review-shell .admin-table thead tr,
.assessment-workspace .table thead tr {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.review-shell .admin-table th,
.assessment-workspace .table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}

.review-shell .admin-table tbody tr:nth-child(even),
.assessment-workspace .table tbody tr:nth-child(even) {
    background: rgba(248,250,252,.56);
}

.review-shell .admin-table tbody tr:hover,
.assessment-workspace .table tbody tr:hover {
    background: rgba(236,242,255,.65);
}

.review-shell .evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.review-shell .evidence-item {
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1rem;
    padding: .9rem;
    background: linear-gradient(180deg, #fff, #f8fafc);
    min-height: 100%;
}

.review-shell .evidence-thumb {
    border-radius: .85rem;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid rgba(226,232,240,.95);
}

.review-shell .note-edit-form,
.review-notes-log .admin-card__body > form {
    background: rgba(248,250,252,.7);
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1rem;
    padding: 1rem;
}

.review-shell .note-edit-grid {
    display: grid;
    grid-template-columns: minmax(180px, .9fr) 1fr;
    gap: .9rem;
    align-items: end;
}
@media (max-width: 820px) {
    .review-shell .note-edit-grid { grid-template-columns: 1fr; }
}

.review-shell .admin-card.js-section-block {
    border-radius: 1.35rem;
    overflow: hidden;
}

.review-shell .admin-card.js-section-block .admin-card__title {
    display: flex;
    align-items: center;
    gap: .65rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.assessment-workspace .assessment-stepper {
    margin: 1rem 0 1.2rem;
}

.assessment-workspace .section-workflow-card,
.assessment-workspace .theme-review-thread,
.assessment-workspace .questions-form,
.assessment-workspace .evidence-library-panel {
    border-radius: 1.35rem;
    overflow: hidden;
}

.assessment-workspace .section-workflow-card {
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.assessment-workspace .theme-review-thread table td,
.assessment-workspace .theme-review-thread table th {
    vertical-align: top;
}

.assessment-workspace .questions-form {
    box-shadow: 0 22px 54px rgba(15,23,42,.10);
}

.assessment-workspace .questions-head {
    padding-bottom: .9rem;
    border-bottom: 1px solid rgba(226,232,240,.95);
    margin-bottom: 1rem;
}

.assessment-workspace .q-card {
    border-radius: 1.15rem;
    box-shadow: 0 14px 34px rgba(15,23,42,.07);
}

.assessment-workspace .q-left > p,
.assessment-workspace .q-left .muted {
    line-height: 1.62;
}

.assessment-workspace .q-right > * {
    background: linear-gradient(180deg, rgba(248,250,252,.88), #fff);
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1rem;
    padding: .9rem .95rem;
    margin-bottom: .85rem;
}
.assessment-workspace .q-right > * > label:first-child,
.assessment-workspace .q-right > * strong:first-child {
    color: #0f172a;
}

.assessment-workspace .evidence-library-panel .evidence-library-grid,
.assessment-workspace .evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.assessment-workspace .assessment-title {
    font-size: clamp(1.8rem, 2vw, 2.35rem);
    letter-spacing: -.02em;
    margin-bottom: .2rem;
}

.assessment-runtime-card .admin-card__body {
    background: linear-gradient(180deg, rgba(248,250,252,.65), rgba(255,255,255,.94));
    border-radius: 1rem;
    padding: .95rem 1rem;
}

.review-shell .flash-error,
.review-shell .alert,
.assessment-workspace .flash-success,
.assessment-workspace .flash-error,
.assessment-workspace .alert {
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(15,23,42,.06);
}

.review-shell .btn,
.assessment-workspace .btn {
    border-radius: 999px;
}

@media (max-width: 900px) {
    .assessment-workspace .assessment-title { font-size: 1.55rem; }
    .review-shell .page-header { padding: 1rem 1.05rem; }
}


/* Admin assessment detail professional stacked layout */
.review-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}
.review-detail-grid > .admin-card {
    width: 100%;
    align-self: stretch;
}
.review-detail-grid .review-card--ops,
.review-detail-grid .review-card--summary-boxes,
.review-detail-grid .review-card--checklist,
.review-detail-grid .review-card--evidence,
.review-detail-grid .review-card--meta {
    grid-column: auto;
    grid-row: auto;
    position: static;
    top: auto;
}
.review-shell .admin-card-grid--detail-top .admin-card {
    min-height: 0;
}
.review-summary-card .admin-card__body > div:first-child {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem 1.15rem !important;
}
.review-card--meta .admin-card__body > div:first-child {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .65rem 1rem;
}
.review-workflow-card .admin-card__body {
    display: grid;
    gap: 1rem;
}
.review-workflow-card form {
    margin: 0;
}
.review-card--ops .admin-card__body > div:last-child {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 1rem !important;
}
.review-card--ops .admin-card__body > div:last-child > form {
    height: 100%;
}
.review-summary-boxes .admin-card__body,
.review-summary-boxes .admin-card__body > form {
    display: grid;
    gap: 1rem;
}
.review-checklist-card .admin-card__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem 1rem;
}
.review-checklist-card .admin-card__body > div {
    padding: .85rem .95rem;
    border: 1px solid rgba(226,232,240,.92);
    border-radius: .95rem;
    background: linear-gradient(180deg, rgba(248,250,252,.74), #fff);
}
.review-shell .evidence-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.review-theme-stack { display:grid; gap:.85rem; }
.review-theme-summary {
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 1.05rem;
    background: linear-gradient(180deg, rgba(248,250,252,.78), #fff);
    overflow: hidden;
}
.review-theme-summary[open] { box-shadow: 0 14px 32px rgba(15,23,42,.07); }
.review-theme-summary__toggle {
    list-style:none; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:.75rem;
    padding:.95rem 1rem; font-weight:700; color:#0f172a;
}
.review-theme-summary__toggle::-webkit-details-marker { display:none; }
.review-theme-summary__toggle::after { content:'+'; font-size:1.1rem; line-height:1; color:#64748b; }
.review-theme-summary[open] .review-theme-summary__toggle::after { content:'–'; }
.review-theme-summary__meta { margin-left:auto; font-size:.78rem; font-weight:600; color:#64748b; }
.review-theme-summary__panel { padding:0 1rem 1rem; display:grid; gap:1rem; }
.review-theme-summary__read-grid,
.review-theme-summary__edit-grid { display:grid; gap:.85rem; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)); }
.review-theme-summary__read-item {
    border: 1px solid rgba(226,232,240,.85); border-radius:.9rem; padding:.8rem .9rem; background:rgba(255,255,255,.78);
}
@media (max-width: 980px) {
    .review-summary-card .admin-card__body > div:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .review-card--ops .admin-card__body > div:last-child {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 820px) {
    .review-summary-card .admin-card__body > div:first-child,
    .review-checklist-card .admin-card__body {
        grid-template-columns: 1fr;
    }
    .review-theme-summary__toggle { flex-direction:column; align-items:flex-start; }
    .review-theme-summary__meta { margin-left:0; }
}

/* Fix Current Action dashboard buttons that render as plain .btn */
.dashboard-hero-card__actions .btn,
.dashboard-hero-card__actions a.btn,
.dashboard-hero-card__actions button.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    min-height: 40px !important;
    padding: 0.75rem 1.1rem !important;
    border-radius: 12px !important;

    background: #e72d83 !important;
    color: #ffffff !important;
    border: 1px solid #e72d83 !important;
    box-shadow: 0 14px 30px rgba(231, 45, 131, 0.22) !important;

    font-weight: 800 !important;
    text-decoration: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hover state */
.dashboard-hero-card__actions .btn:hover,
.dashboard-hero-card__actions a.btn:hover,
.dashboard-hero-card__actions button.btn:hover {
    background: #c91f6f !important;
    border-color: #c91f6f !important;
    color: #ffffff !important;
}

/* Make disabled workstream/card buttons readable */
.workstream-card .btn[disabled],
.workstream-card .btn.disabled,
.workstream-card button[disabled],
.workstream-card a.disabled,
.dashboard-action-card .btn[disabled],
.dashboard-action-card .btn.disabled,
.dashboard-section .btn[disabled],
.dashboard-section .btn.disabled {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #dbe4f0 !important;
    color: #334155 !important;
    border: 1px solid #94a3b8 !important;
    opacity: 1 !important;
    visibility: visible !important;

    font-weight: 800 !important;
    box-shadow: none !important;
    cursor: not-allowed !important;
}

/* Final fix: disabled assessment selector action must stay readable */
.dashboard-section .card .btn,
.dashboard-section .card button,
.dashboard-section .card a.btn,
.dashboard-section .card .btn[disabled],
.dashboard-section .card button[disabled],
.dashboard-section .card a[aria-disabled="true"],
.dashboard-section .card .disabled,
.dashboard-section .card .is-disabled,
.dashboard-section .card [disabled] {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Specifically fix the pale disabled "Open assessment" button under current assessment */
.dashboard-section .card button[disabled],
.dashboard-section .card .btn[disabled],
.dashboard-section .card button:disabled,
.dashboard-section .card .btn:disabled,
.dashboard-section .card .disabled.btn,
.dashboard-section .card .is-disabled.btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #dbe4f0 !important;
    background-image: none !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;

    border: 1px solid #94a3b8 !important;
    border-radius: 12px !important;
    box-shadow: none !important;

    font-weight: 800 !important;
    text-decoration: none !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}



/* ========================================================================
   SAWEI portal-wide HaloPSA-inspired UI layer
   Safe additive patch: append to the bottom of /src/public/css/main.css
   Scope: global portal shell, dashboards, reports, cards, tables, forms.
   No PHP, database, route, or workflow logic is changed.
   ======================================================================== */

:root {
    --halo-bg: #f3f5fb;
    --halo-bg-radial-a: rgba(236, 72, 153, 0.10);
    --halo-bg-radial-b: rgba(14, 165, 233, 0.10);
    --halo-ink: #071424;
    --halo-ink-2: #111827;
    --halo-muted: #607089;
    --halo-line: #dbe5f2;
    --halo-line-strong: #c7d4e6;
    --halo-card: rgba(255, 255, 255, 0.94);
    --halo-card-soft: rgba(248, 251, 255, 0.95);
    --halo-pink: #ec2f83;
    --halo-pink-dark: #c81f6a;
    --halo-blue: #2f5bff;
    --halo-purple: #5737d6;
    --halo-green: #10b981;
    --halo-orange: #f97316;
    --halo-radius: 18px;
    --halo-radius-lg: 24px;
    --halo-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    --halo-shadow-soft: 0 14px 34px rgba(15, 23, 42, 0.075);
    --halo-max: min(94vw, 1640px);
    --max-width-admin: min(94vw, 1640px);
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 10% 8%, var(--halo-bg-radial-a), transparent 30rem),
        radial-gradient(circle at 92% 18%, var(--halo-bg-radial-b), transparent 32rem),
        linear-gradient(180deg, #f7f8fd 0%, var(--halo-bg) 52%, #eef2f8 100%) !important;
    color: var(--halo-ink-2);
}

/* ------------------------------------------------------------------------
   Global top bar: denser, app-like, persistent
   ------------------------------------------------------------------------ */
header.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(90deg, #071424 0%, #080f22 56%, #10142a 100%) !important;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.18);
}

.site-header-inner {
    max-width: var(--halo-max) !important;
    min-height: 76px;
    padding: 0.85rem 1.5rem !important;
}

.site-brand__mark {
    width: 48px !important;
    height: 48px !important;
    border-radius: 15px !important;
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.08);
}

.site-brand__eyebrow {
    letter-spacing: .13em !important;
    color: #ec2f83 !important;
}

.site-brand h1,
.site-brand__copy h1 {
    font-size: clamp(1.12rem, 1.45vw, 1.55rem) !important;
    letter-spacing: -0.035em;
}

.main-nav {
    gap: .45rem !important;
    align-items: center;
}

.main-nav a,
.nav-user,
.nav-notifications > summary {
    border-radius: 999px;
    padding: .48rem .72rem;
}

.main-nav a:hover,
.nav-notifications > summary:hover {
    background: rgba(255, 255, 255, 0.075);
    text-decoration: none;
}

.role-badge {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 8px 22px rgba(15,23,42,.12);
}

/* ------------------------------------------------------------------------
   Page shell: wide, tighter, app cockpit spacing
   ------------------------------------------------------------------------ */
.admin-page,
.page-shell,
.page-shell.page-shell--admin,
.dashboard-shell,
.report-pack-page .page-shell {
    max-width: var(--halo-max) !important;
}

.admin-page,
.page-shell.page-shell--admin,
.dashboard-shell {
    padding-top: clamp(1.35rem, 2vw, 2.15rem) !important;
}

.admin-dashboard-tabs,
.admin-tabs,
.tabs,
.page-tabs,
.dashboard-tabs {
    max-width: var(--halo-max) !important;
    margin: 1.15rem auto 1.35rem !important;
    padding: .48rem !important;
    background: rgba(255,255,255,.86) !important;
    border: 1px solid rgba(203, 213, 225, .74) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 36px rgba(15,23,42,.055) !important;
    backdrop-filter: blur(12px);
}

.admin-tabs a,
.tabs a,
.page-tabs a,
.dashboard-tabs a {
    border-radius: 12px !important;
    padding: .62rem .9rem !important;
    color: #475569 !important;
    font-weight: 750 !important;
    text-decoration: none !important;
}

.admin-tabs a.active,
.admin-tabs a.is-active,
.admin-tabs__link--active,
.tabs a.active,
.page-tabs a.active,
.dashboard-tabs a.active {
    background: #fff !important;
    color: #071424 !important;
    box-shadow: 0 10px 24px rgba(15,23,42,.08) !important;
}

/* ------------------------------------------------------------------------
   Hero panels and ticket-style dashboard cards
   ------------------------------------------------------------------------ */
.dashboard-hero,
.dashboard-hero--admin,
.dashboard-hero--company,
.page-hero,
.admin-hero {
    border-radius: var(--halo-radius-lg) !important;
    border: 1px solid rgba(236, 72, 153, .22) !important;
    background:
        radial-gradient(circle at 88% 18%, rgba(236, 72, 153, .14), transparent 18rem),
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(255,255,255,.86)) !important;
    box-shadow: var(--halo-shadow) !important;
}

.dashboard-hero__title,
.page-title,
.admin-hero h1,
.admin-page h1 {
    letter-spacing: -0.055em;
}

.dashboard-hero__eyebrow,
.dashboard-section__eyebrow,
.admin-card__eyebrow,
.ticket-rail-kicker,
.review-workspace {
    color: var(--halo-pink) !important;
    letter-spacing: .11em;
    text-transform: uppercase;
    font-weight: 900;
}

.dashboard-hero-card,
.dashboard-metric-card,
.admin-card,
.card,
.workstream-card,
.report-card,
.client-report-score-card,
.client-report-action-card,
.client-report-card {
    border-radius: var(--halo-radius) !important;
    border: 1px solid rgba(203, 213, 225, .84) !important;
    background: var(--halo-card) !important;
    box-shadow: var(--halo-shadow-soft) !important;
}

.dashboard-metric-card,
.workstream-card {
    min-height: 132px;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.dashboard-metric-card:hover,
.workstream-card:hover,
a.dashboard-metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(236, 72, 153, .34) !important;
    box-shadow: 0 24px 54px rgba(15, 23, 42, .12) !important;
    text-decoration: none !important;
}

.dashboard-metric-card__label,
.dashboard-hero-card__label,
.dashboard-mini-stat em,
.admin-table th,
table th {
    letter-spacing: .075em;
    text-transform: uppercase;
    font-size: .72rem !important;
    color: #51627a !important;
    font-weight: 900 !important;
}

.dashboard-metric-card__value,
.dashboard-hero-card__value {
    color: #101827;
    letter-spacing: -0.055em;
}

.dashboard-metric-card__cta,
.dashboard-action-card a:not(.btn) {
    color: var(--halo-pink) !important;
    font-weight: 900;
}

.dashboard-chip,
.dashboard-meta-pill,
.status-pill,
.pill,
.badge {
    border-radius: 999px !important;
    border: 1px solid rgba(203, 213, 225, .9) !important;
    background: rgba(255,255,255,.86) !important;
    font-weight: 800 !important;
}

/* ------------------------------------------------------------------------
   Forms, buttons, controls
   ------------------------------------------------------------------------ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    border: 1px solid var(--halo-line-strong) !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(236, 47, 131, .58) !important;
    box-shadow: 0 0 0 4px rgba(236, 47, 131, .12) !important;
    outline: 0 !important;
}

.btn,
button,
input[type="submit"],
.btn-pink,
.btn-secondary {
    border-radius: 14px !important;
    font-weight: 900 !important;
}

.btn,
.btn-pink,
button[type="submit"],
input[type="submit"] {
    box-shadow: 0 12px 28px rgba(236, 47, 131, .18);
}

.btn:hover,
button:hover,
input[type="submit"]:hover {
    transform: translateY(-1px);
    text-decoration: none !important;
}

.btn-secondary,
.btn-dark,
.button-dark {
    background: #071424 !important;
    color: #fff !important;
    border-color: #071424 !important;
    box-shadow: 0 12px 28px rgba(7, 20, 36, .18) !important;
}

/* ------------------------------------------------------------------------
   Tables: cleaner support-ticket density
   ------------------------------------------------------------------------ */
.admin-table-wrapper,
.table-wrapper,
.client-report-table-wrapper {
    border-radius: 16px !important;
    border: 1px solid rgba(203, 213, 225, .84) !important;
    overflow: hidden;
    background: #fff;
}

.admin-table,
table.admin-table,
.dashboard-section table,
.client-report-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff;
}

.admin-table th,
.dashboard-section table th,
.client-report-table th {
    background: #f5f8fc !important;
    border-bottom: 1px solid var(--halo-line) !important;
}

.admin-table td,
.dashboard-section table td,
.client-report-table td {
    border-bottom: 1px solid #e8eef6 !important;
}

.admin-table tbody tr:hover,
.dashboard-section table tbody tr:hover,
.client-report-table tbody tr:hover {
    background: #fbfdff !important;
}

/* ------------------------------------------------------------------------
   Notifications dropdown: clean app-panel treatment
   ------------------------------------------------------------------------ */
.nav-notifications[open] .nav-notifications__panel,
.nav-notifications__panel {
    border-radius: 18px !important;
    border: 1px solid rgba(203, 213, 225, .88) !important;
    box-shadow: 0 26px 70px rgba(2, 6, 23, .2) !important;
}

.nav-notifications__panel-header {
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    gap: .6rem 1rem !important;
    align-items: start !important;
    padding: 1rem 1.15rem !important;
}

.nav-notifications__brand {
    grid-column: 1 / -1;
    justify-self: start;
}

.nav-notifications__title {
    grid-column: 1;
    margin: 0 !important;
    line-height: 1.15 !important;
}

.nav-notifications__view-all,
.nav-notifications__mark-read {
    white-space: nowrap;
    font-weight: 900 !important;
}

.nav-notifications__item {
    border-radius: 14px !important;
    border: 1px solid rgba(244, 114, 182, .34) !important;
    background: rgba(255, 247, 251, .82) !important;
}

/* ------------------------------------------------------------------------
   Assessment/review workspace safeguards
   ------------------------------------------------------------------------ */
.assessment-ticket-ui .assessment-ticket-shell,
.assessment-workspace,
.review-shell {
    max-width: min(96vw, 1760px) !important;
}

.assessment-ticket-ui .ticket-rail,
.review-workspace-panel,
.review-sidebar,
.assessment-control-panel {
    position: sticky;
    top: 104px;
    align-self: start;
}

.assessment-ticket-ui .assessment-answer-table {
    table-layout: fixed;
}

.assessment-ticket-ui .assessment-answer-table td,
.assessment-ticket-ui .assessment-answer-table th {
    vertical-align: middle;
}

/* Keep the scoring columns visible on review screens without crushing question text. */
.assessment-ticket-ui .assessment-answer-table th:nth-last-child(-n+4),
.assessment-ticket-ui .assessment-answer-table td:nth-last-child(-n+4) {
    white-space: nowrap;
    text-align: center;
}

/* ------------------------------------------------------------------------
   Responsive: preserve readability before forcing horizontal scroll
   ------------------------------------------------------------------------ */
@media (max-width: 1180px) {
    :root {
        --halo-max: min(96vw, 1120px);
        --max-width-admin: min(96vw, 1120px);
    }

    .site-header-inner {
        min-height: auto;
    }

    .dashboard-hero,
    .dashboard-hero--admin,
    .dashboard-hero--company {
        grid-template-columns: 1fr !important;
    }

    .assessment-ticket-ui .ticket-rail,
    .review-workspace-panel,
    .review-sidebar,
    .assessment-control-panel {
        position: static;
    }
}

@media (max-width: 760px) {
    .main-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: .25rem;
    }

    .admin-tabs,
    .tabs,
    .page-tabs,
    .dashboard-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
    }

    .dashboard-metric-card,
    .admin-card,
    .card {
        border-radius: 16px !important;
    }
}
/* ========================================================================== 
   SAWEI Portal - Global Cockpit Density Pass v1
   Safe additive CSS patch. Append to the bottom of: src/public/css/main.css
   Scope: layout density, cards, tables, tabs, buttons, empty states, rails.
   No PHP/controller/database logic required.
   ========================================================================== */

:root {
  --sawei-cockpit-max: 1480px;
  --sawei-cockpit-wide: 1580px;
  --sawei-cockpit-gap: 18px;
  --sawei-card-radius: 18px;
  --sawei-card-border: #d8e1ec;
  --sawei-card-shadow: 0 18px 46px rgba(15, 23, 42, .08);
  --sawei-soft-bg: #f5f7fb;
  --sawei-table-head: #f3f7fb;
  --sawei-row-hover: #f8fbff;
  --sawei-ink: #111827;
  --sawei-muted: #53637a;
  --sawei-pink: #e91e83;
  --sawei-navy: #061126;
}

html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   1) App workspace density
   -------------------------------------------------------------------------- */
.admin-page,
.company-page,
.company-dashboard,
.dashboard-page,
.reports-page,
.rebuild-page,
.maintenance-page,
.assessment-ticket-ui,
.portal-page {
  --page-max-width: var(--sawei-cockpit-max);
}

.page-shell,
.page-shell-admin,
.portal-shell,
.admin-shell,
.company-shell,
.dashboard-shell,
.report-shell,
.rebuild-shell {
  max-width: var(--sawei-cockpit-max) !important;
  width: min(var(--sawei-cockpit-max), calc(100vw - 72px)) !important;
  margin-inline: auto !important;
}

.admin-page .page-shell,
.company-page .page-shell,
.company-dashboard .page-shell,
.dashboard-page .page-shell,
.reports-page .page-shell,
.rebuild-page .page-shell,
.assessment-ticket-ui .page-shell {
  padding-top: 26px !important;
  padding-bottom: 44px !important;
}

.admin-page > .page-shell + .page-shell,
.company-page > .page-shell + .page-shell,
.dashboard-page > .page-shell + .page-shell,
.assessment-ticket-ui > .page-shell + .page-shell {
  margin-top: 16px !important;
}

/* Slightly wider workspace for pages that contain dense grids/tables. */
.assessment-ticket-ui .page-shell,
.admin-page .assessment-ticket-shell,
.admin-page .review-shell,
.reports-page .page-shell,
.rebuild-page .page-shell {
  max-width: var(--sawei-cockpit-wide) !important;
  width: min(var(--sawei-cockpit-wide), calc(100vw - 72px)) !important;
}

/* --------------------------------------------------------------------------
   2) Header and navigation density
   -------------------------------------------------------------------------- */
.portal-header,
.app-header,
.site-header,
.topbar,
.portal-topbar,
.app-topbar {
  min-height: 76px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.portal-header .brand,
.app-header .brand,
.site-header .brand,
.topbar .brand,
.portal-topbar .brand {
  gap: 10px !important;
}

.portal-header img,
.app-header img,
.site-header img,
.topbar img,
.portal-topbar img {
  max-height: 44px !important;
}

.portal-header nav,
.app-header nav,
.site-header nav,
.topbar nav,
.portal-topbar nav,
.primary-nav,
.main-nav {
  gap: 16px !important;
  align-items: center !important;
}

.portal-header nav a,
.app-header nav a,
.site-header nav a,
.topbar nav a,
.portal-topbar nav a,
.primary-nav a,
.main-nav a {
  line-height: 1.1 !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* --------------------------------------------------------------------------
   3) Floating tab bar / route tabs
   -------------------------------------------------------------------------- */
.admin-tabs,
.dashboard-tabs,
.role-tabs,
.portal-tabs,
.tab-bar,
.tabs,
.subnav,
.section-tabs {
  min-height: 46px !important;
  padding: 6px 8px !important;
  gap: 6px !important;
  border-radius: 14px !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .05) !important;
}

.admin-tabs a,
.dashboard-tabs a,
.role-tabs a,
.portal-tabs a,
.tab-bar a,
.tabs a,
.subnav a,
.section-tabs a,
.admin-tabs button,
.dashboard-tabs button,
.role-tabs button,
.portal-tabs button,
.tab-bar button,
.tabs button,
.subnav button,
.section-tabs button {
  padding: 8px 13px !important;
  border-radius: 11px !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}

/* --------------------------------------------------------------------------
   4) Hero / heading panels
   -------------------------------------------------------------------------- */
.page-hero,
.admin-hero,
.dashboard-hero,
.role-hero,
.report-hero,
.rebuild-hero,
.review-hero,
.assessment-ticket-ui .page-header,
.assessment-ticket-ui .ticket-header,
.assessment-ticket-ui .assessment-ticket-header {
  margin-bottom: 18px !important;
  padding: 28px 30px !important;
  border-radius: 18px !important;
}

.page-hero h1,
.admin-hero h1,
.dashboard-hero h1,
.role-hero h1,
.report-hero h1,
.rebuild-hero h1,
.review-hero h1,
.assessment-ticket-ui .page-header h1,
.assessment-ticket-ui .ticket-header h1 {
  margin-bottom: 8px !important;
  line-height: 1.05 !important;
}

.page-hero p,
.admin-hero p,
.dashboard-hero p,
.role-hero p,
.report-hero p,
.rebuild-hero p,
.review-hero p,
.assessment-ticket-ui .page-header p,
.assessment-ticket-ui .ticket-header p {
  max-width: 780px !important;
  line-height: 1.45 !important;
}

/* --------------------------------------------------------------------------
   5) Cards, panels and sections
   -------------------------------------------------------------------------- */
.admin-card,
.dashboard-card,
.metric-card,
.stat-card,
.role-card,
.action-card,
.report-card,
.rebuild-card,
.card,
.panel,
.surface,
.section-card,
.table-card,
.assessment-ticket-ui .review-card,
.assessment-ticket-ui .ticket-card,
.assessment-ticket-ui .section-panel {
  border-radius: var(--sawei-card-radius) !important;
  border-color: var(--sawei-card-border) !important;
  box-shadow: var(--sawei-card-shadow) !important;
}

.admin-card,
.dashboard-card,
.metric-card,
.stat-card,
.role-card,
.action-card,
.report-card,
.rebuild-card,
.card,
.panel,
.surface,
.section-card,
.table-card {
  padding: 18px !important;
}

.admin-card + .admin-card,
.dashboard-card + .dashboard-card,
.panel + .panel,
.card + .card,
.section-card + .section-card,
.table-card + .table-card,
.assessment-ticket-ui .review-card + .review-card,
.assessment-ticket-ui .ticket-card + .ticket-card {
  margin-top: 16px !important;
}

/* KPI cards should feel like compact operational tiles. */
.metric-card,
.stat-card,
.dashboard-card.metric,
.dashboard-card.stat,
.role-snapshot-card,
.snapshot-card {
  min-height: 150px !important;
  padding: 18px 18px 16px !important;
}

.metric-card h3,
.stat-card h3,
.role-snapshot-card h3,
.snapshot-card h3 {
  margin-bottom: 8px !important;
}

.metric-card .value,
.stat-card .value,
.kpi-value,
.snapshot-value {
  line-height: 1 !important;
  margin: 4px 0 10px !important;
}

/* --------------------------------------------------------------------------
   6) Dashboard grids and quick actions
   -------------------------------------------------------------------------- */
.dashboard-grid,
.metrics-grid,
.snapshot-grid,
.role-actions-grid,
.quick-actions-grid,
.cards-grid {
  gap: 18px !important;
}

.quick-actions,
.role-actions,
.action-grid,
.quick-actions-grid {
  margin-top: 22px !important;
}

.quick-actions .card,
.role-actions .card,
.action-card {
  min-height: 170px !important;
}

/* --------------------------------------------------------------------------
   7) Tables: compact, readable, operational
   -------------------------------------------------------------------------- */
.table-wrap,
.table-responsive,
.data-table-wrap,
.admin-table-wrap,
.assessment-ticket-ui .assessment-table-wrap,
.assessment-ticket-ui .answers-table-wrap {
  border-radius: 16px !important;
  overflow: auto !important;
  border: 1px solid var(--sawei-card-border) !important;
  background: #fff !important;
}

table.admin-table,
table.data-table,
table.dashboard-table,
table.report-table,
table.rebuild-table,
table.assessment-answer-table,
table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.admin-table th,
.admin-table td,
.data-table th,
.data-table td,
.dashboard-table th,
.dashboard-table td,
.report-table th,
.report-table td,
.rebuild-table th,
.rebuild-table td,
.assessment-answer-table th,
.assessment-answer-table td {
  padding: 10px 13px !important;
  line-height: 1.35 !important;
}

.admin-table th,
.data-table th,
.dashboard-table th,
.report-table th,
.rebuild-table th,
.assessment-answer-table th {
  background: var(--sawei-table-head) !important;
  font-size: 11px !important;
  letter-spacing: .075em !important;
  text-transform: uppercase !important;
  color: #40506a !important;
}

.admin-table td,
.data-table td,
.dashboard-table td,
.report-table td,
.rebuild-table td,
.assessment-answer-table td {
  font-size: 12.5px !important;
  color: var(--sawei-ink) !important;
}

.admin-table tbody tr,
.data-table tbody tr,
.dashboard-table tbody tr,
.report-table tbody tr,
.rebuild-table tbody tr,
.assessment-answer-table tbody tr {
  transition: background .15s ease, box-shadow .15s ease !important;
}

.admin-table tbody tr:hover,
.data-table tbody tr:hover,
.dashboard-table tbody tr:hover,
.report-table tbody tr:hover,
.rebuild-table tbody tr:hover,
.assessment-answer-table tbody tr:hover {
  background: var(--sawei-row-hover) !important;
}

/* Keep answer scoring columns visible without making question text tall again. */
.assessment-ticket-ui .assessment-answer-table,
.assessment-ticket-ui table.assessment-answer-table {
  table-layout: fixed !important;
  min-width: 1120px !important;
}

.assessment-ticket-ui .assessment-answer-table th,
.assessment-ticket-ui .assessment-answer-table td {
  vertical-align: top !important;
}

.assessment-ticket-ui .assessment-answer-table th:nth-child(1),
.assessment-ticket-ui .assessment-answer-table td:nth-child(1) { width: 52px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(2),
.assessment-ticket-ui .assessment-answer-table td:nth-child(2) { width: 285px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(3),
.assessment-ticket-ui .assessment-answer-table td:nth-child(3) { width: 175px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(4),
.assessment-ticket-ui .assessment-answer-table td:nth-child(4) { width: 145px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(5),
.assessment-ticket-ui .assessment-answer-table td:nth-child(5) { width: 150px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(6),
.assessment-ticket-ui .assessment-answer-table td:nth-child(6) { width: 220px !important; }
.assessment-ticket-ui .assessment-answer-table th:nth-child(7),
.assessment-ticket-ui .assessment-answer-table td:nth-child(7),
.assessment-ticket-ui .assessment-answer-table th:nth-child(8),
.assessment-ticket-ui .assessment-answer-table td:nth-child(8),
.assessment-ticket-ui .assessment-answer-table th:nth-child(9),
.assessment-ticket-ui .assessment-answer-table td:nth-child(9),
.assessment-ticket-ui .assessment-answer-table th:nth-child(10),
.assessment-ticket-ui .assessment-answer-table td:nth-child(10) {
  width: 78px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.assessment-ticket-ui .assessment-answer-table td:nth-child(2),
.assessment-ticket-ui .assessment-answer-table td:nth-child(3),
.assessment-ticket-ui .assessment-answer-table td:nth-child(4),
.assessment-ticket-ui .assessment-answer-table td:nth-child(5),
.assessment-ticket-ui .assessment-answer-table td:nth-child(6) {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

.assessment-ticket-ui .assessment-answer-table select {
  min-width: 64px !important;
  height: 34px !important;
  padding: 4px 10px !important;
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   8) Buttons, pills, badges
   -------------------------------------------------------------------------- */
.btn,
.button,
.button-primary,
.button-secondary,
.action-button,
.admin-action,
.primary-action,
.secondary-action,
a.btn,
a.button,
button.btn,
button.button {
  border-radius: 12px !important;
  min-height: 36px !important;
  padding: 9px 16px !important;
  line-height: 1.05 !important;
  font-weight: 800 !important;
  box-shadow: 0 12px 26px rgba(15, 23, 42, .08) !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
}

.btn:hover,
.button:hover,
.button-primary:hover,
.button-secondary:hover,
.action-button:hover,
.admin-action:hover,
.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 16px 34px rgba(15, 23, 42, .12) !important;
}

.pill,
.badge,
.status-pill,
.role-pill,
.count-pill,
.chip {
  border-radius: 999px !important;
  padding: 5px 10px !important;
  line-height: 1 !important;
  font-weight: 800 !important;
}

/* --------------------------------------------------------------------------
   9) Forms and filters
   -------------------------------------------------------------------------- */
input,
select,
textarea {
  border-radius: 11px !important;
}

.filter-card,
.filter-panel,
.report-filters,
.search-panel,
.form-card {
  padding: 18px !important;
  border-radius: 18px !important;
}

.filter-card .form-row,
.filter-panel .form-row,
.report-filters .form-row,
.search-panel .form-row {
  gap: 12px !important;
  margin-bottom: 12px !important;
}

/* --------------------------------------------------------------------------
   10) Empty states and no-record rows
   -------------------------------------------------------------------------- */
.empty-state,
.no-records,
.no-record,
.no-results,
.table-empty,
tr.no-records td,
tr.no-record td,
tr.empty td {
  background: linear-gradient(90deg, rgba(235, 248, 255, .75), rgba(255, 255, 255, .9)) !important;
  color: #31435d !important;
  font-weight: 800 !important;
}

.empty-state,
.no-results,
.table-empty {
  border: 1px dashed #bdd3e8 !important;
  border-radius: 16px !important;
  padding: 18px !important;
}

/* --------------------------------------------------------------------------
   11) Sticky right-side rail / review workspace
   -------------------------------------------------------------------------- */
.review-workspace,
.right-rail,
.ticket-rail,
.assessment-ticket-ui .ticket-rail,
.assessment-ticket-ui .review-workspace,
.assessment-ticket-ui .assessment-control-panel {
  position: sticky !important;
  top: 104px !important;
  align-self: start !important;
  max-height: calc(100vh - 126px) !important;
  overflow: auto !important;
  scrollbar-gutter: stable !important;
}

.review-workspace::-webkit-scrollbar,
.right-rail::-webkit-scrollbar,
.ticket-rail::-webkit-scrollbar,
.assessment-ticket-ui .ticket-rail::-webkit-scrollbar {
  width: 8px;
}

.review-workspace::-webkit-scrollbar-thumb,
.right-rail::-webkit-scrollbar-thumb,
.ticket-rail::-webkit-scrollbar-thumb,
.assessment-ticket-ui .ticket-rail::-webkit-scrollbar-thumb {
  background: #c9d4e2;
  border-radius: 999px;
}

/* Prevent side rails from creating large false page height. */
.review-workspace,
.right-rail,
.ticket-rail,
.assessment-ticket-ui .ticket-rail {
  grid-row: auto !important;
}

/* --------------------------------------------------------------------------
   12) Notifications dropdown density
   -------------------------------------------------------------------------- */
.notifications-menu,
.notification-menu,
.notifications-dropdown,
.notification-dropdown {
  border-radius: 16px !important;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .18) !important;
}

.notifications-menu .notification-item,
.notification-menu .notification-item,
.notifications-dropdown .notification-item,
.notification-dropdown .notification-item {
  padding: 13px 14px !important;
  border-radius: 12px !important;
  margin-bottom: 8px !important;
}

.notifications-menu h3,
.notification-menu h3,
.notifications-dropdown h3,
.notification-dropdown h3 {
  line-height: 1.1 !important;
  margin: 4px 0 10px !important;
}

/* --------------------------------------------------------------------------
   13) Responsive safeguards
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .page-shell,
  .page-shell-admin,
  .portal-shell,
  .admin-shell,
  .company-shell,
  .dashboard-shell,
  .report-shell,
  .rebuild-shell,
  .assessment-ticket-ui .page-shell {
    width: min(100% - 32px, var(--sawei-cockpit-max)) !important;
  }

  .review-workspace,
  .right-rail,
  .ticket-rail,
  .assessment-ticket-ui .ticket-rail,
  .assessment-ticket-ui .review-workspace,
  .assessment-ticket-ui .assessment-control-panel {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

@media (max-width: 760px) {
  .portal-header,
  .app-header,
  .site-header,
  .topbar,
  .portal-topbar,
  .app-topbar {
    min-height: auto !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .page-hero,
  .admin-hero,
  .dashboard-hero,
  .role-hero,
  .report-hero,
  .rebuild-hero,
  .review-hero,
  .assessment-ticket-ui .page-header,
  .assessment-ticket-ui .ticket-header {
    padding: 22px !important;
  }

  .admin-card,
  .dashboard-card,
  .metric-card,
  .stat-card,
  .role-card,
  .action-card,
  .report-card,
  .rebuild-card,
  .card,
  .panel,
  .surface,
  .section-card,
  .table-card {
    padding: 16px !important;
  }
}
/* ========================================================================== 
   SAWEI Portal - Global Cockpit Density Pass v1.1
   Safe additive CSS patch. Append AFTER v1 at the bottom of src/public/css/main.css
   Purpose: tighten the app chrome further, reduce dashboard card wrapping,
   improve scroll anchoring under sticky headers, and keep tables compact.
   ========================================================================== */

:root {
  --sawei-header-compact-height: 92px;
  --sawei-page-top-gap: 22px;
  --sawei-dashboard-card-min: 168px;
}

html {
  scroll-padding-top: 118px !important;
}

/* --------------------------------------------------------------------------
   1) Dark app header: make it feel more like a cockpit toolbar
   -------------------------------------------------------------------------- */
body > header,
.portal-header,
.app-header,
.site-header,
.topbar,
.portal-topbar,
.app-topbar,
.header-shell,
.main-header,
.portal-chrome,
.app-chrome-header {
  min-height: var(--sawei-header-compact-height) !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

body > header .container,
body > header .inner,
body > header .wrap,
.portal-header .container,
.portal-header .inner,
.portal-header .wrap,
.app-header .container,
.app-header .inner,
.app-header .wrap,
.site-header .container,
.site-header .inner,
.site-header .wrap,
.topbar .container,
.portal-topbar .container,
.main-header .container,
.header-shell .container {
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body > header img,
.portal-header img,
.app-header img,
.site-header img,
.topbar img,
.portal-topbar img,
.main-header img,
.header-shell img {
  max-height: 42px !important;
}

body > header nav,
.portal-header nav,
.app-header nav,
.site-header nav,
.topbar nav,
.portal-topbar nav,
.main-header nav,
.header-shell nav,
.primary-nav,
.main-nav {
  gap: 14px !important;
  margin-top: 8px !important;
}

body > header nav a,
.portal-header nav a,
.app-header nav a,
.site-header nav a,
.topbar nav a,
.portal-topbar nav a,
.main-header nav a,
.header-shell nav a,
.primary-nav a,
.main-nav a {
  padding: 5px 6px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
}

/* --------------------------------------------------------------------------
   2) Page start spacing: reduce top breathing room after the header
   -------------------------------------------------------------------------- */
.admin-page .page-shell,
.company-page .page-shell,
.company-dashboard .page-shell,
.dashboard-page .page-shell,
.reports-page .page-shell,
.rebuild-page .page-shell,
.maintenance-page .page-shell,
.assessment-ticket-ui .page-shell,
.portal-page .page-shell,
.page-shell,
.page-shell-admin,
.portal-shell,
.admin-shell,
.company-shell,
.dashboard-shell,
.report-shell,
.rebuild-shell {
  padding-top: var(--sawei-page-top-gap) !important;
}

.admin-tabs,
.dashboard-tabs,
.role-tabs,
.portal-tabs,
.tab-bar,
.tabs,
.subnav,
.section-tabs {
  margin-top: 0 !important;
  margin-bottom: 18px !important;
}

/* --------------------------------------------------------------------------
   3) Dashboard role snapshot: keep more cards on one row where space allows
   -------------------------------------------------------------------------- */
.dashboard-grid,
.metric-grid,
.stats-grid,
.snapshot-grid,
.role-snapshot-grid,
.summary-grid,
.kpi-grid,
.card-grid,
.admin-dashboard .dashboard-grid,
.admin-dashboard .metric-grid,
.admin-dashboard .snapshot-grid,
.company-dashboard .dashboard-grid,
.company-dashboard .metric-grid,
.company-dashboard .snapshot-grid {
  gap: 14px !important;
}

.dashboard-grid > .card,
.metric-grid > .card,
.stats-grid > .card,
.snapshot-grid > .card,
.role-snapshot-grid > .card,
.summary-grid > .card,
.kpi-grid > .card,
.dashboard-card,
.metric-card,
.stat-card {
  min-width: var(--sawei-dashboard-card-min) !important;
}

@supports (grid-template-columns: repeat(auto-fit, minmax(168px, 1fr))) {
  .dashboard-grid,
  .metric-grid,
  .stats-grid,
  .snapshot-grid,
  .role-snapshot-grid,
  .summary-grid,
  .kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(var(--sawei-dashboard-card-min), 1fr)) !important;
  }
}

/* Metric cards: compact but still readable */
.dashboard-card,
.metric-card,
.stat-card,
.role-card,
.action-card {
  padding: 18px 18px !important;
}

.dashboard-card h3,
.metric-card h3,
.stat-card h3,
.dashboard-card .label,
.metric-card .label,
.stat-card .label,
.dashboard-card .eyebrow,
.metric-card .eyebrow,
.stat-card .eyebrow {
  margin-bottom: 7px !important;
  line-height: 1.15 !important;
}

.dashboard-card .value,
.metric-card .value,
.stat-card .value,
.dashboard-card strong:first-child,
.metric-card strong:first-child,
.stat-card strong:first-child {
  line-height: .95 !important;
}

/* --------------------------------------------------------------------------
   4) Operational tables: slightly tighter row height without looking cramped
   -------------------------------------------------------------------------- */
.admin-table th,
.admin-table td,
.data-table th,
.data-table td,
.dashboard-table th,
.dashboard-table td,
.report-table th,
.report-table td,
.rebuild-table th,
.rebuild-table td,
table.admin-table th,
table.admin-table td,
table.data-table th,
table.data-table td,
table.dashboard-table th,
table.dashboard-table td {
  padding-top: 11px !important;
  padding-bottom: 11px !important;
}

.table-card,
.table-panel,
.dashboard-table-card,
.report-card,
.rebuild-card,
.panel.table-card {
  margin-bottom: 18px !important;
}

/* --------------------------------------------------------------------------
   5) Empty states: remove harsh table-row feel
   -------------------------------------------------------------------------- */
tr.no-records td,
tr.no-record td,
tr.empty td,
.no-records,
.no-record,
.no-results,
.table-empty,
.empty-state {
  letter-spacing: .01em !important;
}

tr.no-records td:first-child,
tr.no-record td:first-child,
tr.empty td:first-child {
  border-radius: 0 !important;
}

/* --------------------------------------------------------------------------
   6) Sticky rail and anchored sections: safer offset with compact header
   -------------------------------------------------------------------------- */
.review-workspace,
.right-rail,
.ticket-rail,
.assessment-ticket-ui .ticket-rail,
.assessment-ticket-ui .review-workspace,
.assessment-ticket-ui .assessment-control-panel {
  top: 96px !important;
  max-height: calc(100vh - 112px) !important;
}

#workflow,
#operational-support,
#summary-boxes,
#review-checklist,
#evidence-uploads,
#discussion,
#answers-by-section,
.section-card,
.table-card,
.panel,
.card {
  scroll-margin-top: 118px !important;
}

/* --------------------------------------------------------------------------
   7) Quick action cards: cleaner cockpit tile density
   -------------------------------------------------------------------------- */
.action-grid,
.quick-actions-grid,
.role-actions-grid {
  gap: 18px !important;
}

.action-card p,
.quick-action-card p,
.role-action-card p {
  line-height: 1.38 !important;
  margin-bottom: 14px !important;
}

.action-card .btn,
.quick-action-card .btn,
.role-action-card .btn,
.action-card a.btn,
.quick-action-card a.btn,
.role-action-card a.btn {
  width: 100% !important;
  justify-content: center !important;
}

@media (max-width: 1180px) {
  :root {
    --sawei-page-top-gap: 18px;
    --sawei-dashboard-card-min: 160px;
  }

  body > header,
  .portal-header,
  .app-header,
  .site-header,
  .topbar,
  .portal-topbar,
  .app-topbar,
  .header-shell,
  .main-header {
    min-height: auto !important;
  }
}
/* ==========================================================================
   SAWEI Portal - Cockpit Density Stabiliser v1.2
   Apply AFTER:
   - HaloPSA global UI patch
   - Cockpit Density Pass v1
   - Cockpit Density Pass v1.1

   Purpose:
   - Keep the cleaner cockpit density.
   - Prevent over-compression on complex pages.
   - Fix assessment detail workspace top alignment.
   - Stop rebuild cockpit cards from overlapping.
   - Keep dashboard cards wrapping cleanly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1) App chrome: keep compact, but stop over-compression
   -------------------------------------------------------------------------- */

body {
  min-height: 100vh;
  overflow-x: hidden;
}

header,
.portal-header,
.app-header,
.site-header,
.main-header,
.topbar {
  overflow: visible;
}

.portal-shell,
.admin-page,
.dashboard-page,
.page-shell,
.page-shell-admin,
.main-content,
.content,
.container,
.container-wide {
  box-sizing: border-box;
}

/* Let wide operational pages breathe without becoming stretched edge-to-edge. */
.admin-page,
.dashboard-page,
.rebuild-page,
.rebuild-cockpit,
.assessment-ticket-ui {
  width: min(100% - 48px, 1500px);
  margin-left: auto;
  margin-right: auto;
}

/* Avoid a giant blank area after the tab bar on pages with right rails. */
.assessment-ticket-ui,
.page-shell-admin.review-shell,
.assessment-ticket-shell {
  margin-top: 26px !important;
}

/* --------------------------------------------------------------------------
   2) Assessment review ticket workspace stabilisation
   -------------------------------------------------------------------------- */

.assessment-ticket-ui .assessment-ticket-shell,
.assessment-ticket-shell {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 292px !important;
  gap: 22px !important;
  align-items: start !important;
  width: 100% !important;
  max-width: 1500px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Main content must start at the top of the workspace, not below the rail. */
.assessment-ticket-ui .assessment-ticket-main,
.assessment-ticket-main,
.review-main,
.ticket-main {
  min-width: 0 !important;
  width: 100% !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Right workspace rail: sticky, readable, and not too tall. */
.assessment-ticket-ui .assessment-ticket-rail,
.assessment-ticket-rail,
.review-rail,
.ticket-rail {
  position: sticky !important;
  top: 92px !important;
  align-self: start !important;
  width: 292px !important;
  max-height: calc(100vh - 112px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding-right: 2px;
  scrollbar-width: thin;
}

/* Ticket hero should stay full-width inside the main column. */
.assessment-ticket-ui .page-header,
.assessment-ticket-ui .assessment-ticket-hero,
.assessment-ticket-ui .review-hero,
.assessment-ticket-ui .admin-card,
.assessment-ticket-main .admin-card,
.assessment-ticket-main .review-card {
  max-width: 100% !important;
}

/* Cleaner status strip without causing layout height spikes. */
.assessment-ticket-ui .status-strip,
.assessment-ticket-ui .workflow-strip,
.assessment-ticket-ui .ticket-status-strip {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: stretch !important;
  margin: 10px 0 16px !important;
}

.assessment-ticket-ui .status-strip > *,
.assessment-ticket-ui .workflow-strip > *,
.assessment-ticket-ui .ticket-status-strip > * {
  min-width: 0 !important;
  min-height: 42px !important;
}

/* Assessment answer tables: compact, readable, no chopped scoring columns. */
.assessment-ticket-ui .assessment-answer-table-wrap,
.assessment-ticket-ui .answers-table-wrap,
.assessment-ticket-ui .table-wrap {
  width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

.assessment-ticket-ui .assessment-answer-table {
  width: 100% !important;
  min-width: 1120px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.assessment-ticket-ui .assessment-answer-table th,
.assessment-ticket-ui .assessment-answer-table td {
  padding: 12px 12px !important;
  vertical-align: top !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

.assessment-ticket-ui .assessment-answer-table th {
  font-size: 10px !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

/* Column widths: question compact, scoring columns always visible. */
.assessment-ticket-ui .assessment-answer-table th:nth-child(1),
.assessment-ticket-ui .assessment-answer-table td:nth-child(1) { width: 54px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(2),
.assessment-ticket-ui .assessment-answer-table td:nth-child(2) { width: 270px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(3),
.assessment-ticket-ui .assessment-answer-table td:nth-child(3) { width: 160px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(4),
.assessment-ticket-ui .assessment-answer-table td:nth-child(4) { width: 145px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(5),
.assessment-ticket-ui .assessment-answer-table td:nth-child(5) { width: 145px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(6),
.assessment-ticket-ui .assessment-answer-table td:nth-child(6) { width: 250px !important; }

.assessment-ticket-ui .assessment-answer-table th:nth-child(7),
.assessment-ticket-ui .assessment-answer-table td:nth-child(7),
.assessment-ticket-ui .assessment-answer-table th:nth-child(8),
.assessment-ticket-ui .assessment-answer-table td:nth-child(8),
.assessment-ticket-ui .assessment-answer-table th:nth-child(9),
.assessment-ticket-ui .assessment-answer-table td:nth-child(9),
.assessment-ticket-ui .assessment-answer-table th:nth-child(10),
.assessment-ticket-ui .assessment-answer-table td:nth-child(10) {
  width: 72px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Avoid tall question columns caused by overly narrow forced wrapping. */
.assessment-ticket-ui .assessment-answer-table td:nth-child(2) {
  font-weight: 650;
  hyphens: none !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* --------------------------------------------------------------------------
   3) Rebuild cockpit stabilisation: prevent card overlap
   -------------------------------------------------------------------------- */

.rebuild-cockpit .card,
.rebuild-cockpit .admin-card,
.rebuild-cockpit .metric-card,
.rebuild-cockpit .summary-card,
.rebuild-cockpit .runtime-card,
.rebuild-cockpit .phase-card,
.rebuild-cockpit [class*="card"] {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  align-self: stretch;
}

.rebuild-cockpit .grid,
.rebuild-cockpit .cards-grid,
.rebuild-cockpit .dashboard-grid,
.rebuild-cockpit .runtime-grid,
.rebuild-cockpit .phase-grid,
.rebuild-cockpit .summary-grid {
  align-items: stretch !important;
  grid-auto-rows: auto !important;
}

/* Runtime summary cards often contain nested rows; allow content to set height. */
.rebuild-cockpit .phase-flags,
.rebuild-cockpit .phase-summary,
.rebuild-cockpit .runtime-summary,
.rebuild-cockpit .readiness-audit,
.rebuild-cockpit .quick-paths {
  overflow: visible !important;
}

.rebuild-cockpit .phase-flags *,
.rebuild-cockpit .runtime-summary *,
.rebuild-cockpit .phase-summary * {
  max-height: none !important;
}

/* Prevent the phase flag list from bleeding under neighbouring cards. */
.rebuild-cockpit .phase-flags,
.rebuild-cockpit [class*="phase"] {
  z-index: auto !important;
}

/* --------------------------------------------------------------------------
   4) Dashboard card wrapping and density
   -------------------------------------------------------------------------- */

.dashboard-page .snapshot-grid,
.dashboard-page .role-snapshot-grid,
.dashboard-page .metric-grid,
.dashboard-page .cards-grid,
.dashboard-page .dashboard-cards,
.admin-page .snapshot-grid,
.admin-page .role-snapshot-grid,
.admin-page .metric-grid,
.admin-page .cards-grid,
.admin-page .dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* Keep cards balanced but do not cut text. */
.dashboard-page .card,
.dashboard-page .admin-card,
.dashboard-page .metric-card,
.dashboard-page .snapshot-card,
.admin-page .card,
.admin-page .admin-card,
.admin-page .metric-card,
.admin-page .snapshot-card {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

/* Tables stay dense but readable. */
.admin-page table th,
.admin-page table td,
.dashboard-page table th,
.dashboard-page table td,
.rebuild-cockpit table th,
.rebuild-cockpit table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Softer empty-state rows. */
.no-records,
.empty-state,
tr.no-records td {
  background: #f5faff !important;
  color: #25516c !important;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   5) Responsive guardrails
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  .assessment-ticket-ui .assessment-ticket-shell,
  .assessment-ticket-shell {
    grid-template-columns: 1fr !important;
  }

  .assessment-ticket-ui .assessment-ticket-rail,
  .assessment-ticket-rail,
  .review-rail,
  .ticket-rail {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    order: -1;
  }

  .assessment-ticket-ui .status-strip,
  .assessment-ticket-ui .workflow-strip,
  .assessment-ticket-ui .ticket-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .admin-page,
  .dashboard-page,
  .rebuild-page,
  .rebuild-cockpit,
  .assessment-ticket-ui {
    width: min(100% - 24px, 1500px);
  }

  .assessment-ticket-ui .status-strip,
  .assessment-ticket-ui .workflow-strip,
  .assessment-ticket-ui .ticket-status-strip {
    grid-template-columns: 1fr !important;
  }

  .dashboard-page .snapshot-grid,
  .dashboard-page .role-snapshot-grid,
  .dashboard-page .metric-grid,
  .dashboard-page .cards-grid,
  .dashboard-page .dashboard-cards,
  .admin-page .snapshot-grid,
  .admin-page .role-snapshot-grid,
  .admin-page .metric-grid,
  .admin-page .cards-grid,
  .admin-page .dashboard-cards {
    grid-template-columns: 1fr;
  }
}



/* ========================================================================
   SAWEI FINAL LOCK v5 — Assessment Detail Stable Layout
   Apply at the absolute bottom of main.css.
   Purpose:
   - Stop the review rail from floating over the answer tables.
   - Give the page enough width at 100% browser zoom.
   - Keep the footer directly after the actual assessment content.
   - Neutralise older fixed/negative-margin rail experiments.
   ======================================================================== */

main:has(.assessment-ticket-ui) {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  padding: 1.15rem 0 1.25rem !important;
  overflow: visible !important;
}

.assessment-ticket-ui,
.admin-page.assessment-ticket-ui {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 clamp(18px, 2.4vw, 42px) !important;
  overflow: visible !important;
}

.assessment-ticket-ui .admin-nav-wrapper,
.assessment-ticket-ui .admin-shell--nav {
  width: min(1760px, 100%) !important;
  max-width: 1760px !important;
  margin: 0 auto 1rem !important;
  padding: 0 !important;
}

.assessment-ticket-ui .assessment-ticket-shell,
.assessment-ticket-ui .page-shell.page-shell--admin.review-shell.assessment-ticket-shell {
  width: min(1760px, 100%) !important;
  max-width: 1760px !important;
  margin: 0 auto !important;
  padding: 0 0 .75rem !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 310px !important;
  gap: 1.25rem !important;
  align-items: start !important;
  overflow: visible !important;
}

.assessment-ticket-ui .assessment-ticket-main {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: grid !important;
  gap: 1rem !important;
}

.assessment-ticket-ui .assessment-ticket-rail,
.assessment-ticket-ui .ticket-rail,
.assessment-ticket-ui .review-workspace-panel,
.assessment-ticket-ui .assessment-control-panel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  position: sticky !important;
  top: 92px !important;
  right: auto !important;
  margin-top: 0 !important;
  align-self: start !important;
  width: 310px !important;
  max-width: 310px !important;
  height: auto !important;
  max-height: calc(100vh - 110px) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: grid !important;
  flex-direction: initial !important;
  gap: .75rem !important;
  padding: 0 2px 4px 0 !important;
  z-index: 5 !important;
  scrollbar-width: thin !important;
}

.assessment-ticket-ui .page-header {
  margin: 0 !important;
}

.assessment-ticket-ui .ticket-rail-card {
  margin: 0 !important;
  border-radius: 18px !important;
  padding: .9rem !important;
  box-shadow: 0 16px 38px rgba(15, 23, 42, .09) !important;
}

.assessment-ticket-ui .ticket-rail-meta {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: .5rem !important;
}

.assessment-ticket-ui .ticket-rail-meta > div {
  min-width: 0 !important;
  padding: .58rem .62rem !important;
  border-radius: 12px !important;
}

.assessment-ticket-ui .ticket-rail-meta span {
  font-size: .55rem !important;
  line-height: 1.1 !important;
}

.assessment-ticket-ui .ticket-rail-meta strong {
  display: block !important;
  font-size: .75rem !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere !important;
}

.assessment-ticket-ui .ticket-rail-actions,
.assessment-ticket-ui .ticket-link-list {
  display: grid !important;
  gap: .38rem !important;
}

.assessment-ticket-ui .ticket-rail-actions a,
.assessment-ticket-ui .ticket-link-list a,
.assessment-ticket-ui .ticket-primary-link,
.assessment-ticket-ui .ticket-queue-link {
  min-height: 34px !important;
  padding: .48rem .62rem !important;
  border-radius: 11px !important;
  font-size: .77rem !important;
  line-height: 1.1 !important;
  text-decoration: none !important;
}

.assessment-ticket-ui .review-detail-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 1rem !important;
}

.assessment-ticket-ui .review-card--summary .admin-card__body > div {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: .8rem 1.1rem !important;
}

.assessment-ticket-ui .review-card--ops .admin-card__body > div {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 1rem !important;
}

.assessment-ticket-ui .review-checklist-card .admin-card__body {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: .75rem !important;
}

.assessment-ticket-ui .evidence-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  gap: 1rem !important;
}

.assessment-ticket-ui .js-section-block {
  padding: 1rem 1.1rem !important;
}

.assessment-ticket-ui .js-section-block .admin-card__title {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: .75rem !important;
  flex-wrap: wrap !important;
}

.assessment-ticket-ui .admin-table-wrapper,
.assessment-ticket-ui .js-section-block .admin-table-wrapper,
.assessment-ticket-ui .assessment-answer-table-wrap,
.assessment-ticket-ui .answers-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border-radius: 16px !important;
}

.assessment-ticket-ui .js-section-block .admin-table {
  width: 100% !important;
  min-width: 1320px !important;
  table-layout: fixed !important;
  border-collapse: collapse !important;
}

.assessment-ticket-ui .js-section-block .admin-table th,
.assessment-ticket-ui .js-section-block .admin-table td {
  padding: .68rem .72rem !important;
  vertical-align: top !important;
  line-height: 1.35 !important;
}

.assessment-ticket-ui .js-section-block .admin-table th {
  font-size: .64rem !important;
  letter-spacing: .075em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.assessment-ticket-ui .js-section-block .admin-table td {
  font-size: .78rem !important;
}

.assessment-ticket-ui .js-section-block .admin-table th:nth-child(1),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(1) { width: 50px !important; text-align: center !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(2),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(2) { width: 280px !important; font-weight: 700 !important; overflow-wrap: break-word !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(3),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(3) { width: 155px !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(4),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(4) { width: 135px !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(5),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(5) { width: 145px !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(6),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(6) { width: 235px !important; overflow-wrap: anywhere !important; }
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(7),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(7),
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(8),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(8),
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(9),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(9),
.assessment-ticket-ui .js-section-block .admin-table th:nth-child(10),
.assessment-ticket-ui .js-section-block .admin-table td:nth-child(10) {
  width: 80px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.assessment-ticket-ui .js-section-block .admin-table select {
  min-width: 62px !important;
  height: 34px !important;
  padding: 0 .55rem !important;
  text-align: center !important;
}

@media (max-width: 1399px) {
  .assessment-ticket-ui .assessment-ticket-shell,
  .assessment-ticket-ui .page-shell.page-shell--admin.review-shell.assessment-ticket-shell {
    grid-template-columns: 1fr !important;
    width: min(1280px, 100%) !important;
  }

  .assessment-ticket-ui .assessment-ticket-rail,
  .assessment-ticket-ui .ticket-rail,
  .assessment-ticket-ui .review-workspace-panel,
  .assessment-ticket-ui .assessment-control-panel {
    grid-column: 1 !important;
    grid-row: 1 !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin: 0 0 1rem !important;
  }

  .assessment-ticket-ui .assessment-ticket-main {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  .assessment-ticket-ui .ticket-rail-card--primary {
    grid-column: span 2 !important;
  }
}

@media (max-width: 820px) {
  .assessment-ticket-ui,
  .admin-page.assessment-ticket-ui {
    padding-inline: 12px !important;
  }

  .assessment-ticket-ui .assessment-ticket-rail,
  .assessment-ticket-ui .ticket-rail,
  .assessment-ticket-ui .review-workspace-panel,
  .assessment-ticket-ui .assessment-control-panel {
    grid-template-columns: 1fr !important;
  }

  .assessment-ticket-ui .ticket-rail-card--primary {
    grid-column: auto !important;
  }

  .assessment-ticket-ui .review-card--summary .admin-card__body > div,
  .assessment-ticket-ui .review-card--ops .admin-card__body > div {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================
   SAWEI PATCH 5.1 — Rebuild Cockpit Operational Detail Lock
   Fixes Phase flags / runtime summary cards bleeding into each other.
   Append at the VERY BOTTOM of main.css.
   ======================================================================== */

/* Target only the Rebuild Cockpit operational detail card group */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) {
  width: 100% !important;
  max-width: 100% !important;
  margin-top: 1.25rem !important;
}

/* Keep the section heading clean and aligned */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-section__header {
  margin-bottom: 0.85rem !important;
}

/* The operational detail cards need a controlled grid, not a squeezed row */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-metric-grid,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-action-grid,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .rebuild-detail-grid,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .cards-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
  width: 100% !important;
  overflow: visible !important;
}

/* On wide screens, keep the six-card cockpit row but give Phase Flags more room */
@media (min-width: 1360px) {
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-metric-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-action-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .rebuild-detail-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .cards-grid {
    grid-template-columns: minmax(260px, 1.25fr) repeat(5, minmax(185px, 1fr)) !important;
  }
}

/* Cards must clip their own content; old patches allowed them to bleed */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-metric-card,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-action-card,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .rebuild-detail-card,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .card,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .admin-card {
  min-width: 0 !important;
  width: 100% !important;
  overflow: hidden !important;
  padding: 16px !important;
}

/* Header inside each runtime card */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-metric-card__top,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .rebuild-detail-card__top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 10px !important;
  align-items: start !important;
}

/* Runtime list rows: label on the left, value locked on the right */
.rebuild-cockpit .rebuild-stat-list {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.rebuild-cockpit .rebuild-stat-list li {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) max-content !important;
  align-items: center !important;
  gap: 12px !important;

  min-width: 0 !important;
  min-height: 44px !important;
  padding: 10px 12px !important;

  border-radius: 13px !important;
  border: 1px solid rgba(219, 229, 242, 0.95) !important;
  background: rgba(255, 255, 255, 0.88) !important;

  overflow: hidden !important;
}

/* Long phase names must wrap inside the row, not underneath the next card */
.rebuild-cockpit .rebuild-stat-list li span {
  min-width: 0 !important;
  max-width: 100% !important;
  color: #53637a !important;
  line-height: 1.28 !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
}

/* Status/value stays visible and aligned */
.rebuild-cockpit .rebuild-stat-list li strong {
  justify-self: end !important;
  color: #071424 !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

/* Badge/chip inside card headers must not crush the title */
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .pill,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .badge,
.rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-chip {
  max-width: 100% !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.05 !important;
}

/* Smaller screens: stack cleanly instead of squeezing */
@media (max-width: 900px) {
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-metric-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .dashboard-action-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .rebuild-detail-grid,
  .rebuild-cockpit .dashboard-section:has(.rebuild-stat-list) .cards-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ========================================================================
   SAWEI PATCH 5.2 — Operational Detail Final Fix
   Fixes rebuild detail cards where long labels bleed into neighbouring cards.
   Uses the actual live HTML classes seen in DevTools:
   .rebuild-detail-card + .rebuild-stat-list
   ======================================================================== */

/* Make each rebuild detail card contain its own content */
.rebuild-detail-card {
  min-width: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Header: title left, chip right */
.rebuild-detail-card .dashboard-metric-card__top {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: start !important;
  gap: 10px !important;
}

/* Prevent title/chip from overflowing */
.rebuild-detail-card .dashboard-metric-card__top > * {
  min-width: 0 !important;
}

.rebuild-detail-card .dashboard-metric-card__top .status-pill,
.rebuild-detail-card .dashboard-metric-card__top .pill,
.rebuild-detail-card .dashboard-metric-card__top .badge,
.rebuild-detail-card .dashboard-metric-card__top .chip {
  max-width: 100% !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.05 !important;
}

/* Runtime list container */
.rebuild-detail-card .rebuild-stat-list {
  display: grid !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  width: 100% !important;
  min-width: 0 !important;
}

/* Runtime list rows */
.rebuild-detail-card .rebuild-stat-list li {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 12px !important;

  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;

  padding: 10px 12px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  background: rgba(255, 255, 255, 0.88) !important;

  overflow: hidden !important;
  box-sizing: border-box !important;
}

/* Left label: must wrap inside the row */
.rebuild-detail-card .rebuild-stat-list li span,
.rebuild-detail-card .rebuild-stat-list li > :first-child {
  min-width: 0 !important;
  max-width: 100% !important;

  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;

  color: #53637a !important;
  line-height: 1.25 !important;
}

/* Right value: stays compact and visible */
.rebuild-detail-card .rebuild-stat-list li strong,
.rebuild-detail-card .rebuild-stat-list li > :last-child {
  justify-self: end !important;
  white-space: nowrap !important;
  color: #071424 !important;
  font-weight: 900 !important;
}

/* Make the operational detail grid breathe better */
.rebuild-detail-card {
  padding: 16px !important;
}

/* On narrower widths, allow cards to stack instead of crushing */
@media (max-width: 1180px) {
  .rebuild-detail-card .rebuild-stat-list li {
    grid-template-columns: 1fr !important;
    align-items: start !important;
  }

  .rebuild-detail-card .rebuild-stat-list li strong,
  .rebuild-detail-card .rebuild-stat-list li > :last-child {
    justify-self: start !important;
  }
}

/* ==========================================================
   PATCH — Status pill colour system
   Gives status/severity pills distinct visual meaning
   ========================================================== */

.status-pill {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem !important;

  min-height: 24px !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;

  font-size: 0.78rem !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  letter-spacing: 0.01em !important;

  border: 1px solid transparent !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06) !important;
  white-space: nowrap !important;
}

/* Default / Neutral */
.status-pill,
.status-pill--neutral,
.status-pill--default {
  color: #334155 !important;
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

/* Good / Passed / Finalised / Complete */
.status-pill--good,
.status-pill--success,
.status-pill--passed,
.status-pill--pass,
.status-pill--complete,
.status-pill--completed,
.status-pill--finalised,
.status-pill--finalized,
.status-pill--released,
.status-pill--active,
.status-pill--submitted {
  color: #047857 !important;
  background: #ecfdf5 !important;
  border-color: #86efac !important;
}

/* Warning / In progress / Under review */
.status-pill--warning,
.status-pill--warn,
.status-pill--under-review,
.status-pill--under-audit,
.status-pill--review,
.status-pill--in-progress,
.status-pill--pending,
.status-pill--awaiting,
.status-pill--onboarding {
  color: #b45309 !important;
  background: #fffbeb !important;
  border-color: #fcd34d !important;
}

/* Danger / Risk / Failed / Blocked */
.status-pill--danger,
.status-pill--error,
.status-pill--failed,
.status-pill--fail,
.status-pill--blocked,
.status-pill--risk,
.status-pill--at-risk,
.status-pill--overdue,
.status-pill--expired,
.status-pill--needs-changes,
.status-pill--incomplete {
  color: #be123c !important;
  background: #fff1f2 !important;
  border-color: #fda4af !important;
}

/* Info / Administrative / Used / Read-only */
.status-pill--info,
.status-pill--administrative,
.status-pill--admin,
.status-pill--used,
.status-pill--readonly,
.status-pill--read-only {
  color: #0369a1 !important;
  background: #f0f9ff !important;
  border-color: #7dd3fc !important;
}

/* Optional dot inside status pill */
.status-pill::before {
  content: "";
  width: 7px !important;
  height: 7px !important;
  border-radius: 999px !important;
  background: currentColor !important;
  opacity: 0.75 !important;
  flex: 0 0 auto !important;
}

/* Do not show dot on tiny count pills accidentally using status style */
.status-pill.count-pill::before,
.count-pill.status-pill::before {
  display: none !important;
}

/* ==========================================================
   Company dashboard status pills
   Ensures assessment states do not all render grey
   ========================================================== */

.status-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.35rem !important;
    min-height: 24px !important;
    padding: 5px 12px !important;
    border-radius: 999px !important;
    font-size: 0.78rem !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    background: #ffffff !important;
    color: #334155 !important;
}

.status-pill::before {
    content: "" !important;
    width: 7px !important;
    height: 7px !important;
    border-radius: 999px !important;
    background: currentColor !important;
    opacity: 0.7 !important;
}

.status-pill--good,
.status-pill--success,
.status-pill--submitted,
.status-pill--finalised,
.status-pill--finalized,
.status-pill--complete,
.status-pill--completed {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border-color: #86efac !important;
}

.status-pill--warning,
.status-pill--returned,
.status-pill--returned-for-clarification,
.status-pill--needs-changes,
.status-pill--clarification,
.status-pill--under-review,
.status-pill--under-audit,
.status-pill--in-progress {
    color: #b45309 !important;
    background: #fff7ed !important;
    border-color: #fdba74 !important;
}

.status-pill--danger,
.status-pill--risk,
.status-pill--at-risk,
.status-pill--at-risk-of-delay,
.status-pill--incomplete,
.status-pill--overdue,
.status-pill--rejected {
    color: #b91c1c !important;
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
}

.status-pill--neutral,
.status-pill--default,
.status-pill--draft,
.status-pill--onboarding,
.status-pill--not-started {
    color: #475569 !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Company dashboard primary action visibility */
.company-dashboard .btn-primary,
.company-dashboard a.btn-primary,
.company-dashboard .dashboard-action-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 0 22px !important;
    border-radius: 14px !important;
    background: #e72578 !important;
    color: #ffffff !important;
    border: 1px solid #e72578 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    box-shadow: 0 16px 35px rgba(231, 37, 120, 0.24) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.company-dashboard .btn-disabled,
.company-dashboard button:disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
}

/* SAWEI Organisation Profile Reach controls */
.profile-context-section {
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(240, 249, 255, 0.92), rgba(253, 242, 248, 0.75));
}

.profile-context-section h2 {
    margin: 0 0 0.35rem 0;
    font-size: 1.1rem;
}

.profile-note {
    margin: 0.35rem 0 0.75rem 0;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.profile-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.75rem;
}

.profile-checkbox-grid--regions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-checkbox-card {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    min-height: 42px;
    padding: 0.7rem 0.75rem;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 14px;
    background: #fff;
    color: var(--color-text);
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.profile-checkbox-card:hover {
    border-color: rgba(219, 39, 119, 0.45);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.profile-checkbox-card input {
    margin-top: 0.2rem;
    accent-color: var(--color-pink);
}

.profile-checkbox-card:has(input:checked) {
    border-color: rgba(16, 137, 129, 0.65);
    background: rgba(236, 253, 245, 0.78);
}

.profile-checkbox-card:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.74;
    transform: none;
    box-shadow: none;
}

@media (max-width: 900px) {
    .profile-checkbox-grid,
    .profile-checkbox-grid--regions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .profile-checkbox-grid,
    .profile-checkbox-grid--regions {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   SAWEI Evidence Library Actions Polish v1
   Purpose: align Download / Save / Replace / Remove controls
   Scope: Company assessment Evidence Library only
   Paste at the END of main.css
   ========================================================= */

#evidence-library .evidence-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
    gap: 1rem !important;
    align-items: stretch !important;
}

#evidence-library .evidence-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.85rem !important;
    min-height: 100% !important;
    padding: 1rem !important;
}

#evidence-library .evidence-item > a:first-child {
    display: block !important;
    width: 100% !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    background: #f8fafc !important;
}

#evidence-library .evidence-item > a:first-child img,
#evidence-library .evidence-item > img {
    display: block !important;
    width: 100% !important;
    max-height: 320px !important;
    object-fit: contain !important;
    background: #f8fafc !important;
}

#evidence-library .evidence-meta {
    display: grid !important;
    gap: 0.28rem !important;
    min-height: 5.6rem !important;
}

#evidence-library .evidence-actions {
    margin-top: auto !important;
    padding-top: 0.85rem !important;
    border-top: 1px solid rgba(226, 232, 240, 0.95) !important;
    display: grid !important;
    grid-template-columns: 112px minmax(0, 1fr) 82px !important;
    grid-auto-rows: minmax(38px, auto) !important;
    gap: 0.55rem !important;
    align-items: center !important;
}

/* Row 1: Download | Purpose select | Save */
#evidence-library .evidence-actions > a.btn {
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
    text-align: center !important;
}

#evidence-library .evidence-actions .evidence-metadata-form {
    grid-column: 2 / 4 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 74px !important;
    gap: 0.55rem !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
}

#evidence-library .evidence-actions .evidence-metadata-form select {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
}

#evidence-library .evidence-actions .evidence-metadata-form button {
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
}

/* Row 2: File picker | Replace | Remove */
#evidence-library .evidence-actions .evidence-upload-form {
    grid-column: 1 / 3 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 86px !important;
    gap: 0.55rem !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
}

#evidence-library .evidence-actions .evidence-upload-form input[type="file"] {
    width: 100% !important;
    min-width: 0 !important;
    height: 38px !important;
    padding: 0.38rem !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    border-radius: 10px !important;
    background: #fff !important;
    font-size: 0.82rem !important;
}

#evidence-library .evidence-actions .evidence-upload-form input[type="file"]::file-selector-button {
    height: 26px !important;
    margin-right: 0.5rem !important;
    border: 0 !important;
    border-radius: 8px !important;
    padding: 0 0.65rem !important;
    background: #eef2f7 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}

#evidence-library .evidence-actions .evidence-upload-form button {
    width: 100% !important;
    min-height: 38px !important;
    justify-content: center !important;
}

#evidence-library .evidence-actions .evidence-action {
    grid-column: 3 !important;
    grid-row: 2 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    width: 100% !important;
}

#evidence-library .evidence-actions .evidence-action > button,
#evidence-library .evidence-actions .evidence-action .inline-confirm button {
    min-height: 38px !important;
    width: 100% !important;
    justify-content: center !important;
}

#evidence-library .evidence-actions .btn,
#evidence-library .evidence-actions button {
    white-space: nowrap !important;
}

@media (max-width: 720px) {
    #evidence-library .evidence-actions {
        grid-template-columns: 1fr !important;
    }

    #evidence-library .evidence-actions > a.btn,
    #evidence-library .evidence-actions .evidence-metadata-form,
    #evidence-library .evidence-actions .evidence-upload-form,
    #evidence-library .evidence-actions .evidence-action {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    #evidence-library .evidence-actions .evidence-metadata-form,
    #evidence-library .evidence-actions .evidence-upload-form {
        grid-template-columns: 1fr !important;
    }
}

/* =========================================================
   PATCH — Admin assessment evidence uploads final polish
   Keeps evidence clean without changing upload/download logic
   ========================================================= */

.assessment-ticket-ui .review-card--evidence {
    overflow: hidden;
}

.assessment-ticket-ui .review-card--evidence > div:first-child {
    padding: 18px 20px 14px !important;
    border-bottom: 1px solid rgba(203, 213, 225, 0.75);
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.assessment-ticket-ui .review-card--evidence .admin-card__title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
}

.assessment-ticket-ui .review-card--evidence .admin-card__body {
    padding: 20px !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-item {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding: 14px !important;
    border: 1px solid rgba(203, 213, 225, 0.95) !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%) !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06) !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-thumb {
    height: 190px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border: 1px solid rgba(203, 213, 225, 0.85) !important;
    border-radius: 14px !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255,255,255,0.95), rgba(248,250,252,0.96)),
        #f8fafc !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-thumb a {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-thumb img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-meta {
    display: grid !important;
    gap: 5px !important;
    padding: 0 4px 2px !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-name {
    color: #e11d72 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    line-height: 1.25 !important;
}

.assessment-ticket-ui .review-card--evidence .evidence-name:hover {
    text-decoration: underline !important;
}

.assessment-ticket-ui .review-card--evidence .muted {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
}

/* Mobile/tablet safety */
@media (max-width: 980px) {
    .assessment-ticket-ui .review-card--evidence .evidence-grid {
        grid-template-columns: 1fr !important;
    }

    .assessment-ticket-ui .review-card--evidence .evidence-thumb {
        height: 170px !important;
    }
}
/* ========================================================================
   SAWEI Portal Styling Cleanup v6.2
   Scope: visual-only polish for shared chrome, dashboards, tables, forms,
   assessment pages, evidence surfaces, and responsive guardrails.
   No routes, names, inputs, form actions, PHP logic, or JavaScript hooks changed.
   ======================================================================== */

:root {
    --sawei-clean-ink: #071225;
    --sawei-clean-muted: #526176;
    --sawei-clean-line: #dbe3ef;
    --sawei-clean-line-soft: rgba(203, 213, 225, 0.72);
    --sawei-clean-card: rgba(255, 255, 255, 0.96);
    --sawei-clean-soft: #f8fafc;
    --sawei-clean-page: #f4f7fb;
    --sawei-clean-pink: #e91e73;
    --sawei-clean-pink-dark: #be185d;
    --sawei-clean-navy: #071225;
    --sawei-clean-radius-sm: 10px;
    --sawei-clean-radius: 16px;
    --sawei-clean-radius-lg: 22px;
    --sawei-clean-shadow: 0 18px 42px rgba(15, 23, 42, 0.075);
    --sawei-clean-shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.055);
    --sawei-clean-max: 1760px;
}

html {
    scroll-behavior: smooth;
    background: var(--sawei-clean-page);
}

body {
    color: var(--sawei-clean-ink);
    background:
        radial-gradient(circle at 8% 0%, rgba(233, 30, 115, 0.055), transparent 30rem),
        radial-gradient(circle at 95% 6%, rgba(37, 99, 235, 0.055), transparent 28rem),
        var(--sawei-clean-page) !important;
}

main {
    width: 100%;
}

/* Shared page shell: wider, aligned, and less cramped across role pages. */
.page-shell,
.page-shell--admin,
.admin-shell,
.admin-page > .page-shell,
.dashboard-shell,
.company-shell,
.assessment-shell {
    width: min(var(--sawei-clean-max), calc(100vw - 48px)) !important;
    max-width: var(--sawei-clean-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.admin-page,
.dashboard-page,
.company-page,
.assessment-page {
    width: 100% !important;
    max-width: none !important;
}

/* Header / top navigation cleanup. */
.site-header {
    background: linear-gradient(90deg, #051020 0%, #081426 48%, #0b1020 100%) !important;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.18) !important;
}

.site-header-inner {
    width: min(var(--sawei-clean-max), calc(100vw - 48px)) !important;
    max-width: var(--sawei-clean-max) !important;
    padding: 1rem 0.25rem !important;
    gap: 1.25rem !important;
}

.site-brand {
    min-width: 0 !important;
}

.site-brand__mark {
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;
    border-radius: 15px !important;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25) !important;
}

.site-brand__copy h1 {
    line-height: 1.12 !important;
    letter-spacing: -0.025em !important;
}

.site-brand__eyebrow {
    letter-spacing: 0.14em !important;
}

.main-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.55rem !important;
    flex-wrap: wrap !important;
}

.main-nav > a,
.main-nav > span,
.main-nav > details > summary {
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.main-nav > a {
    padding: 0.45rem 0.65rem !important;
    border-radius: 999px !important;
    color: rgba(255, 255, 255, 0.88) !important;
    font-size: 0.82rem !important;
    font-weight: 750 !important;
}

.main-nav > a:hover,
.main-nav > a:focus-visible {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    text-decoration: none !important;
}

.nav-user {
    gap: 0.4rem !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 0.8rem !important;
}

.role-badge,
.env-badge,
.status-pill,
.pill {
    line-height: 1 !important;
    white-space: nowrap !important;
}

/* Admin subnav: cleaner tabs and better wrapping. */
.admin-shell--nav,
.admin-nav-wrapper {
    width: min(var(--sawei-clean-max), calc(100vw - 48px)) !important;
    max-width: var(--sawei-clean-max) !important;
    margin: 0 auto 1rem !important;
}

.admin-nav {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    flex-wrap: wrap !important;
    padding: 0.45rem !important;
    border: 1px solid var(--sawei-clean-line-soft) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.84) !important;
    box-shadow: var(--sawei-clean-shadow-soft) !important;
    backdrop-filter: blur(14px) !important;
}

.admin-nav__tab {
    min-height: 36px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.52rem 0.78rem !important;
    border-radius: 13px !important;
    border: 1px solid transparent !important;
    color: #334155 !important;
    font-size: 0.82rem !important;
    font-weight: 850 !important;
    text-decoration: none !important;
}

.admin-nav__tab:hover,
.admin-nav__tab:focus-visible {
    border-color: rgba(203, 213, 225, 0.95) !important;
    background: #fff !important;
    color: var(--sawei-clean-ink) !important;
    text-decoration: none !important;
}

.admin-nav__tab--active {
    border-color: rgba(233, 30, 115, 0.22) !important;
    background: #fdf2f8 !important;
    color: #9d174d !important;
    box-shadow: inset 0 0 0 1px rgba(233, 30, 115, 0.05) !important;
}

/* Consistent cards and section chrome. */
.admin-card,
.card,
.dashboard-panel,
.dashboard-metric-card,
.dashboard-hero-card,
.review-card,
.js-section-block,
.report-card,
.evidence-item,
.empty-state {
    border-color: rgba(203, 213, 225, 0.78) !important;
    border-radius: var(--sawei-clean-radius-lg) !important;
    background: var(--sawei-clean-card) !important;
    box-shadow: var(--sawei-clean-shadow) !important;
}

.admin-card,
.card,
.dashboard-panel,
.review-card {
    overflow: hidden !important;
}

.admin-card__title,
.card__title,
.dashboard-panel__title,
.dashboard-section__title {
    color: var(--sawei-clean-ink) !important;
    letter-spacing: -0.02em !important;
}

.admin-card__body,
.dashboard-panel__body,
.card__body {
    color: var(--sawei-clean-ink) !important;
}

.muted,
.helper-text,
.dashboard-section__subtitle,
.dashboard-panel__subtitle,
.dashboard-metric-card__help,
.dashboard-hero-card__text,
.lead-text {
    color: var(--sawei-clean-muted) !important;
}

/* Buttons: same visual language everywhere. */
.btn,
button.btn,
a.btn,
input[type="submit"].btn {
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.45rem !important;
    border-radius: 12px !important;
    padding: 0.55rem 0.9rem !important;
    font-weight: 850 !important;
    line-height: 1.12 !important;
    text-decoration: none !important;
    border-width: 1px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.btn:hover,
button.btn:hover,
a.btn:hover {
    transform: translateY(-1px) !important;
    text-decoration: none !important;
}

.btn-pink,
.btn-primary,
button.btn-pink,
a.btn-pink {
    color: #fff !important;
    background: linear-gradient(135deg, #e91e73 0%, #be185d 100%) !important;
    border-color: rgba(190, 24, 93, 0.72) !important;
    box-shadow: 0 12px 24px rgba(190, 24, 93, 0.18) !important;
}

.btn-secondary,
a.btn-secondary,
button.btn-secondary {
    color: var(--sawei-clean-ink) !important;
    background: #fff !important;
    border-color: rgba(203, 213, 225, 0.95) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.055) !important;
}

.btn-secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.95) !important;
    background: #f8fafc !important;
}

.btn[disabled],
button[disabled],
.is-disabled,
.disabled {
    cursor: not-allowed !important;
    opacity: 0.58 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Inputs and form controls. */
.input-text,
.input-select,
.input-textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    border-radius: 12px !important;
    border-color: rgba(203, 213, 225, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.94) !important;
    color: var(--sawei-clean-ink) !important;
    box-shadow: none !important;
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(233, 30, 115, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(233, 30, 115, 0.09) !important;
    outline: none !important;
}

.form-actions,
.admin-table-actions,
.dashboard-section__actions,
.dashboard-hero__toolbar {
    gap: 0.55rem !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Dashboards: stronger hierarchy and balanced cards. */
.dashboard-shell {
    display: grid !important;
    gap: 1rem !important;
}

.dashboard-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) !important;
    gap: 1rem !important;
    align-items: stretch !important;
    padding: 1.35rem !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 26px !important;
    background:
        radial-gradient(circle at 10% 0%, rgba(233, 30, 115, 0.18), transparent 28rem),
        linear-gradient(135deg, #071225 0%, #0f172a 58%, #1f1530 100%) !important;
    color: #fff !important;
    box-shadow: 0 26px 60px rgba(15, 23, 42, 0.18) !important;
}

.dashboard-hero__content {
    min-width: 0 !important;
}

.dashboard-hero__title {
    margin: 0.3rem 0 0.45rem !important;
    color: #fff !important;
    font-size: clamp(1.6rem, 2.2vw, 2.65rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.045em !important;
}

.dashboard-hero__subtitle {
    max-width: 74ch !important;
    color: rgba(255, 255, 255, 0.78) !important;
    font-size: 0.98rem !important;
}

.dashboard-hero__eyebrow,
.dashboard-section__eyebrow,
.dashboard-callout__eyebrow,
.ticket-rail-kicker {
    color: #ff4f9a !important;
    letter-spacing: 0.13em !important;
    font-weight: 950 !important;
}

.dashboard-meta-row,
.dashboard-chip-row {
    gap: 0.45rem !important;
    flex-wrap: wrap !important;
}

.dashboard-meta-pill,
.dashboard-chip {
    border-radius: 999px !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: rgba(255, 255, 255, 0.84) !important;
    font-weight: 800 !important;
}

.dashboard-hero-card {
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    background: rgba(255, 255, 255, 0.10) !important;
    color: #fff !important;
    box-shadow: none !important;
    backdrop-filter: blur(12px) !important;
}

.dashboard-hero-card__label,
.dashboard-hero-card__text,
.dashboard-mini-stat em {
    color: rgba(255, 255, 255, 0.72) !important;
}

.dashboard-hero-card__value,
.dashboard-mini-stat strong {
    color: #fff !important;
}

.dashboard-section {
    margin-top: 0 !important;
}

.dashboard-section__header,
.dashboard-panel__header,
.admin-table-header {
    gap: 0.9rem !important;
    align-items: flex-end !important;
    margin-bottom: 0.85rem !important;
}

.dashboard-section__title,
.dashboard-panel__title,
.admin-table-header h2 {
    font-size: clamp(1.05rem, 1.15vw, 1.35rem) !important;
    line-height: 1.16 !important;
}

.dashboard-metric-grid,
.dashboard-metric-grid--company,
.dashboard-card-grid,
.dashboard-summary-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)) !important;
    gap: 0.9rem !important;
    align-items: stretch !important;
}

.dashboard-metric-card {
    min-height: 150px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    padding: 1rem !important;
    position: relative !important;
    overflow: hidden !important;
}

.dashboard-metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: #cbd5e1;
}

.dashboard-metric-card--good::before { background: #16a34a; }
.dashboard-metric-card--warning::before { background: #f97316; }
.dashboard-metric-card--danger::before { background: #dc2626; }
.dashboard-metric-card--neutral::before { background: #64748b; }

.dashboard-metric-card__value {
    color: var(--sawei-clean-ink) !important;
    font-size: clamp(1.6rem, 2vw, 2.25rem) !important;
    letter-spacing: -0.045em !important;
}

.dashboard-metric-card--clickable:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.105) !important;
}

.dashboard-panel,
.dashboard-callout {
    padding: 1rem !important;
}

.dashboard-panel-stack {
    gap: 1rem !important;
}

/* Tables: compact, aligned and scroll-safe. */
.admin-table-wrapper,
.admin-table-wrapper--scroll,
.dashboard-table-wrap,
.table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    border: 1px solid rgba(203, 213, 225, 0.76) !important;
    border-radius: 16px !important;
    background: #fff !important;
}

.admin-table,
.dashboard-table,
table.admin-table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff !important;
}

.admin-table thead tr,
.dashboard-table thead tr {
    background: #f8fafc !important;
}

.admin-table th,
.dashboard-table th {
    padding: 0.75rem 0.85rem !important;
    color: #475569 !important;
    font-size: 0.68rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    border-bottom: 1px solid rgba(203, 213, 225, 0.9) !important;
    white-space: nowrap !important;
}

.admin-table td,
.dashboard-table td {
    padding: 0.78rem 0.85rem !important;
    color: #1e293b !important;
    font-size: 0.86rem !important;
    vertical-align: top !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.72) !important;
}

.admin-table tbody tr:hover,
.dashboard-table tbody tr:hover {
    background: #f8fbff !important;
}

.admin-table td:first-child,
.dashboard-table td:first-child {
    font-weight: 760 !important;
}

/* Assessment detail: a calmer workspace and cleaner rail. */
.assessment-ticket-ui .assessment-ticket-main {
    gap: 1rem !important;
}

.assessment-ticket-ui .page-header {
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 0% 0%, rgba(233, 30, 115, 0.18), transparent 25rem),
        linear-gradient(135deg, #071225 0%, #101827 65%, #241633 100%) !important;
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.16) !important;
}

.assessment-ticket-ui .ticket-rail-card {
    border-radius: 18px !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.085) !important;
}

.assessment-ticket-ui .ticket-rail-actions a,
.assessment-ticket-ui .ticket-primary-link {
    min-height: 36px !important;
    border-radius: 12px !important;
}

.assessment-ticket-ui .admin-card,
.assessment-ticket-ui .review-card,
.assessment-ticket-ui .js-section-block {
    border-radius: 22px !important;
}

.assessment-ticket-ui .review-card--workflow form,
.assessment-ticket-ui .review-card--ops form,
.assessment-ticket-ui .review-card--peer form {
    border-radius: 18px !important;
    background: #fbfdff !important;
}

.assessment-ticket-ui .review-checklist-card .admin-card__body > div,
.review-checklist-card .admin-card__body > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
    gap: 0.7rem !important;
}

.assessment-ticket-ui .review-checklist-card .admin-card__body > div > div,
.review-checklist-card .admin-card__body > div > div {
    padding: 0.75rem !important;
    border: 1px solid rgba(203, 213, 225, 0.82) !important;
    border-radius: 14px !important;
    background: #f8fafc !important;
}

/* Company assessment pages and evidence panels. */
.assessment-stepper {
    gap: 0.45rem !important;
    padding: 0.45rem !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.82) !important;
    border: 1px solid rgba(203, 213, 225, 0.78) !important;
    box-shadow: var(--sawei-clean-shadow-soft) !important;
}

.assessment-step {
    border-radius: 12px !important;
    min-height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.assessment-step.is-active,
.assessment-step.active {
    background: #fdf2f8 !important;
    border-color: rgba(233, 30, 115, 0.28) !important;
    color: #9d174d !important;
}

.card--assessment,
.theme-review-thread,
.evidence-library-panel,
#evidence-library {
    border-radius: 22px !important;
    border-color: rgba(203, 213, 225, 0.82) !important;
    box-shadow: var(--sawei-clean-shadow) !important;
}

.question-card,
.question-row,
.questions-card,
.theme-question-card {
    border-radius: 18px !important;
    border-color: rgba(203, 213, 225, 0.82) !important;
    background: #fff !important;
}

.evidence-library-toolbar,
.evidence-upload-panel {
    border-radius: 18px !important;
    border-color: rgba(203, 213, 225, 0.82) !important;
    background: #f8fafc !important;
}

.evidence-file-button,
.evidence-file-name,
.evidence-select,
.evidence-upload-btn,
.evidence-toolbar-btn {
    border-radius: 12px !important;
}

/* Empty/loading/success states. */
.empty-state,
.no-records,
tr.no-records td,
.alert,
.flash-success,
.flash-error,
.flash-warning,
.flash-info {
    border-radius: 16px !important;
}

.empty-state {
    padding: 1rem !important;
    border: 1px dashed rgba(148, 163, 184, 0.65) !important;
    background:
        radial-gradient(circle at 0% 0%, rgba(233, 30, 115, 0.06), transparent 18rem),
        #f8fafc !important;
    color: #334155 !important;
}

/* Page bottom: avoid accidental visual whitespace. */
main > .admin-page:last-child,
main > .dashboard-page:last-child,
main > .company-page:last-child {
    margin-bottom: 1rem !important;
}

footer,
.site-footer {
    margin-top: auto !important;
}

/* Responsive safety. */
@media (max-width: 1399px) {
    .dashboard-hero {
        grid-template-columns: 1fr !important;
    }

    .dashboard-hero__aside {
        max-width: none !important;
    }
}

@media (max-width: 900px) {
    .page-shell,
    .page-shell--admin,
    .admin-shell,
    .admin-page > .page-shell,
    .dashboard-shell,
    .company-shell,
    .assessment-shell,
    .site-header-inner,
    .admin-shell--nav,
    .admin-nav-wrapper {
        width: min(100% - 24px, var(--sawei-clean-max)) !important;
    }

    .site-header-inner {
        padding: 0.85rem 0 !important;
    }

    .main-nav {
        width: 100% !important;
        justify-content: flex-start !important;
    }

    .nav-spacer {
        display: none !important;
    }

    .dashboard-hero,
    .dashboard-panel,
    .dashboard-callout,
    .admin-card,
    .card {
        border-radius: 18px !important;
    }

    .dashboard-metric-grid,
    .dashboard-metric-grid--company,
    .dashboard-card-grid,
    .dashboard-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-section__header,
    .dashboard-panel__header,
    .admin-table-header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .btn,
    button.btn,
    a.btn {
        width: auto !important;
    }
}

@media (max-width: 620px) {
    .site-title,
    .site-brand {
        width: 100% !important;
    }

    .site-brand__copy h1 {
        font-size: 1.05rem !important;
    }

    .main-nav > a,
    .main-nav > details > summary {
        width: 100% !important;
        justify-content: flex-start !important;
        border-radius: 12px !important;
        background: rgba(255, 255, 255, 0.06) !important;
    }

    .admin-nav__tab {
        flex: 1 1 calc(50% - 0.45rem) !important;
    }

    .dashboard-hero {
        padding: 1rem !important;
    }

    .form-actions .btn,
    .dashboard-hero__toolbar .btn,
    .dashboard-section__actions .btn,
    .admin-table-actions .btn {
        width: 100% !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ========================================================================
   SAWEI Portal Styling Cleanup v6.3 spot polish
   Fixes from staging review: visible page subtitles, cleaner company theme
   narrative boxes, working auditor handoff quick-nav anchor, and centred
   finalised evidence review pages. Visual-only except anchor/id fix in view.
   ======================================================================== */

/* Page header subtitles must remain readable on pale hero cards. */
.page-subtitle,
.page-header .page-subtitle,
.page-header p.page-subtitle {
    max-width: 82ch !important;
    margin: 0.55rem 0 0 !important;
    color: #475569 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    opacity: 1 !important;
}

.page-header .page-subtitle::after {
    content: "";
    display: block;
    width: min(820px, 52vw);
    height: 3px;
    margin-top: 0.55rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #ef233c, #e91e73 65%, transparent);
}

/* Cleaner company theme narrative boxes on the assessment capture page. */
.summary-box-card {
    margin-bottom: 1.15rem !important;
    padding: 1rem !important;
    border: 1px solid rgba(203, 213, 225, 0.88) !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.065) !important;
    overflow: hidden !important;
}

.summary-box-card > h3 {
    margin: 0 !important;
    color: #071225 !important;
    font-size: 1.05rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
}

.summary-box-card > p.muted {
    max-width: 82ch !important;
    margin: 0.35rem 0 0.95rem !important;
    color: #526176 !important;
    line-height: 1.55 !important;
}

.summary-box-card > div {
    align-items: stretch !important;
    gap: 0.75rem !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.summary-box-card .form-group {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.45rem !important;
    margin: 0 !important;
    padding: 0.85rem !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #ffffff, #fbfdff) !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035) !important;
}

.summary-box-card .form-group label {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.5rem !important;
    color: #0f172a !important;
    line-height: 1.25 !important;
}

.summary-box-card .form-group label strong {
    font-size: 0.86rem !important;
    font-weight: 900 !important;
}

.summary-box-card .helper-text,
.summary-box-card .form-group .helper-text {
    min-height: 3.15em !important;
    margin: 0 !important;
    color: #64748b !important;
    font-size: 0.82rem !important;
    line-height: 1.45 !important;
}

.summary-box-card textarea,
.summary-box-card .input-textarea {
    flex: 1 1 auto !important;
    min-height: 92px !important;
    margin-top: 0.1rem !important;
    padding: 0.7rem 0.75rem !important;
    border: 1px solid rgba(203, 213, 225, 0.98) !important;
    border-bottom-color: rgba(203, 213, 225, 0.98) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #0f172a !important;
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
}

.summary-box-card textarea:hover,
.summary-box-card .input-textarea:hover {
    border-color: rgba(148, 163, 184, 0.98) !important;
}

.summary-box-card textarea:focus,
.summary-box-card .input-textarea:focus,
.summary-box-card textarea:focus-visible,
.summary-box-card .input-textarea:focus-visible {
    border-color: rgba(14, 165, 233, 0.62) !important;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.10) !important;
    outline: none !important;
}

.summary-box-card textarea:invalid,
.summary-box-card .input-textarea:invalid {
    border-color: rgba(203, 213, 225, 0.98) !important;
    box-shadow: none !important;
}

.form--submitted .summary-box-card textarea:invalid,
.form--submitted .summary-box-card .input-textarea:invalid {
    border-color: rgba(239, 68, 68, 0.50) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10) !important;
}

/* Quick navigation anchors should land below the sticky header. */
#operational-support,
#auditor-peer-review-handoff,
#workflow,
#summary-boxes,
#review-checklist,
#evidence-uploads,
#discussion,
#answers-by-section {
    scroll-margin-top: 130px !important;
}

/* Centre read-only finalised evidence pages instead of leaving them pinned left. */
.finalised-evidence-page {
    width: min(1120px, calc(100vw - 48px)) !important;
    max-width: 1120px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: clamp(1.6rem, 3vw, 3rem) 0 2rem !important;
}

.finalised-evidence-page .dashboard-hero,
.finalised-evidence-page .finalised-evidence-alert,
.finalised-evidence-page .dashboard-panel {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.finalised-evidence-page .dashboard-hero {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 340px) !important;
}

.finalised-evidence-page .dashboard-table-wrap {
    border-radius: 16px !important;
}

@media (max-width: 1180px) {
    .summary-box-card > div {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .finalised-evidence-page .dashboard-hero {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 720px) {
    .summary-box-card > div {
        grid-template-columns: 1fr !important;
    }

    .summary-box-card .helper-text,
    .summary-box-card .form-group .helper-text {
        min-height: 0 !important;
    }

    .finalised-evidence-page {
        width: min(100% - 24px, 1120px) !important;
        padding-top: 1rem !important;
    }
}


/* =========================================================
   v6.5 session hardening: secure POST logout
   ========================================================= */
.main-nav > .nav-logout-form {
    display: inline-flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-nav .nav-logout-button {
    appearance: none !important;
    -webkit-appearance: none !important;
    min-height: 34px !important;
    display: inline-flex !important;
    align-items: center !important;
    padding: 0.45rem 0.65rem !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: rgba(255, 255, 255, 0.88) !important;
    font: inherit !important;
    font-size: 0.82rem !important;
    font-weight: 750 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    box-shadow: none !important;
}

.main-nav .nav-logout-button:hover,
.main-nav .nav-logout-button:focus-visible {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    text-decoration: none !important;
    outline: none !important;
}

/* =========================================================
   v6.6 mobile header and navigation containment
   ========================================================= */
@media (max-width: 620px) {
    .site-header,
    header.site-header {
        width: 100% !important;
        max-width: 100vw !important;
        min-height: 0 !important;
        padding-block: 0 !important;
        overflow: visible !important;
    }

    .site-header-inner {
        box-sizing: border-box !important;
        width: calc(100% - 20px) !important;
        max-width: none !important;
        margin-inline: 10px !important;
        padding: 0.55rem 0 !important;
        gap: 0.55rem !important;
    }

    .site-title {
        width: 100% !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto !important;
        align-items: center !important;
        gap: 0.35rem !important;
    }

    .site-brand {
        width: auto !important;
        min-width: 0 !important;
    }

    .site-brand {
        gap: 0.6rem !important;
    }

    .site-brand__mark {
        flex: 0 0 38px !important;
        width: 38px !important;
        height: 38px !important;
    }

    .site-brand__copy,
    .site-brand__copy h1,
    .site-brand__eyebrow {
        min-width: 0 !important;
        overflow-wrap: anywhere !important;
    }

    .site-brand__eyebrow {
        font-size: 0.58rem !important;
        line-height: 1.25 !important;
    }

    .site-brand__copy h1 {
        font-size: 0.98rem !important;
        line-height: 1.15 !important;
    }

    .main-nav {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        align-items: stretch !important;
        gap: 0.35rem !important;
        margin-top: 0 !important;
        padding-bottom: 0 !important;
        overflow: visible !important;
    }

    .main-nav > a,
    .main-nav > details,
    .main-nav > .nav-logout-form {
        box-sizing: border-box !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    .main-nav > a,
    .main-nav > details > summary,
    .main-nav .nav-logout-button {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 36px !important;
        justify-content: center !important;
        padding: 0.45rem 0.55rem !important;
        text-align: center !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .main-nav > .nav-user {
        box-sizing: border-box !important;
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.35rem !important;
        padding: 0.25rem 0.4rem !important;
        white-space: normal !important;
        text-align: center !important;
        overflow: visible !important;
        font-size: 0 !important;
    }

    .nav-user > strong,
    .nav-user .role-badge,
    .nav-user .role-badge__label {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
    }

    .nav-user > strong {
        display: none !important;
    }

    .nav-user .role-badge {
        justify-self: stretch !important;
        padding: 0.25rem 0.35rem !important;
        font-size: 0.68rem !important;
        line-height: 1.05 !important;
    }

    .main-nav > .nav-spacer {
        display: none !important;
    }

    .nav-notifications {
        position: static !important;
    }

    .nav-notifications__panel {
        box-sizing: border-box !important;
        position: fixed !important;
        z-index: 1000 !important;
        left: 10px !important;
        right: 10px !important;
        top: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 20px) !important;
        overflow: auto !important;
    }

    .nav-notifications__header {
        align-items: flex-start !important;
        flex-direction: column !important;
    }

    .nav-notifications__actions {
        width: 100% !important;
        justify-content: flex-start !important;
    }
}
