:root {
    --bg: #f3f7f6;
    --panel: #ffffff;
    --ink: #16211f;
    --muted: #61716d;
    --line: #d8e2df;
    --brand: #116a63;
    --brand-dark: #102b2a;
    --blue: #254b7a;
    --soft: #e8f3f1;
    --shadow: 0 16px 38px rgba(21, 45, 43, .10);
}

[hidden] {
    display: none !important;
}

/* SS2 v28 - auditoria recente com data organizada e mais respiro */
.activity-card {
    min-width: min(100%, 520px);
}

.activity-list {
    gap: 14px !important;
}

.activity-item {
    grid-template-columns: 92px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: center !important;
    min-height: 86px;
    padding: 14px 16px !important;
}

.activity-date {
    display: grid !important;
    grid-template-columns: 22px 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: center !important;
    justify-items: start !important;
    column-gap: 9px !important;
    row-gap: 2px !important;
    width: 78px !important;
    height: 58px !important;
    min-height: 58px !important;
    padding: 9px 10px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #e6fbf5 0%, #f7fffd 100%) !important;
    border: 1px solid rgba(17, 106, 99, .18) !important;
    color: #066b63 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.72) !important;
}

.activity-date i {
    grid-row: 1 / span 2 !important;
    width: 18px !important;
    height: 16px !important;
    margin: 0 !important;
    border: 2px solid currentColor !important;
    border-top-width: 5px !important;
    border-radius: 5px !important;
    opacity: .9 !important;
}

.activity-date em,
.activity-date strong {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.activity-date em {
    align-self: end !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-weight: 800 !important;
}

.activity-date strong {
    align-self: start !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
}

.activity-item > div {
    min-width: 0;
}

.activity-item > div > strong {
    display: block;
    line-height: 1.2;
}

@media (max-width: 760px) {
    .activity-item {
        grid-template-columns: 86px minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .activity-date {
        width: 74px !important;
    }
}

.status-signal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 20px;
}

.status-signal {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(13, 40, 38, .08);
}

.status-signal strong {
    display: block;
    font-size: 1.35rem;
    color: #042d2a;
}

.status-signal span:not(.status-dot) {
    display: block;
    font-weight: 800;
}

.status-signal small {
    color: var(--muted);
}

.status-dot {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    display: inline-flex;
    flex: 0 0 14px;
    box-shadow: 0 0 0 6px rgba(20, 165, 150, .1);
}

.status-green { background: #12a66d; }
.status-yellow { background: #f5b942; }
.status-red { background: #df4b4b; }

.status-signal.status-green { border-color: rgba(18, 166, 109, .28); background: #f1fff8; }
.status-signal.status-yellow { border-color: rgba(245, 185, 66, .36); background: #fffaf0; }
.status-signal.status-red { border-color: rgba(223, 75, 75, .28); background: #fff5f5; }

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #062b28;
    font-size: .75rem;
    font-weight: 900;
}

.status-pill.status-green { background: #dff8ec; color: #08704a; }
.status-pill.status-yellow { background: #fff0c8; color: #8a5b00; }
.status-pill.status-red { background: #ffe1e1; color: #a22d2d; }

.patient-guidance {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(20, 165, 150, .24);
    border-radius: 16px;
    background: linear-gradient(135deg, #f5fffd, #ffffff);
}

.patient-guidance strong,
.evidence-gate strong {
    display: block;
    margin-bottom: 4px;
}

.patient-guidance p {
    margin: 0;
    color: #314946;
    line-height: 1.5;
}

.field-help {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: .78rem;
    text-align: right;
}

.evidence-gate {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 8px 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgba(223, 75, 75, .28);
    border-radius: 14px;
    background: #fff7f7;
    color: #442222;
}

.evidence-gate small {
    grid-column: 2;
    color: #7a5656;
}

.evidence-gate.is-ok {
    border-color: rgba(18, 166, 109, .28);
    background: #f1fff8;
    color: #0b5139;
}

.evidence-gate.is-ok .status-dot {
    background: #12a66d;
}

.button:disabled {
    cursor: not-allowed;
    opacity: .48;
    filter: grayscale(.3);
}

.doc-explanation {
    min-height: 76px;
    color: #36514d;
    font-size: .86rem;
    line-height: 1.45;
}

@media (max-width: 980px) {
    .status-signal-grid {
        grid-template-columns: 1fr;
    }
}

/* SS2 polish pass v23 */
.activity-date {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    width: 82px;
    min-height: 38px;
    padding: 7px 8px;
}

.activity-date i {
    width: 14px;
    height: 13px;
}

.activity-date strong {
    font-size: 11px;
    line-height: 1.12;
}

.score-ring {
    align-content: center;
    gap: 3px;
}

.score-ring strong {
    line-height: 1;
}

.score-ring span {
    margin-top: 0 !important;
    line-height: 1;
}

.score-widget small {
    display: block;
    margin-top: 7px;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    color: #eafffc;
    background: linear-gradient(135deg, #0f766e 0%, #20bdad 100%);
    flex: 0 0 auto;
}

/* SS2 v27 - auditoria recente mais legivel */
.activity-item {
    grid-template-columns: 74px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.activity-date {
    display: grid !important;
    grid-template-columns: 18px 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 8px;
    row-gap: 1px;
    width: 66px !important;
    min-height: 58px !important;
    padding: 9px 10px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #e8fbf6 0%, #f7fffd 100%) !important;
    color: #066b63 !important;
    border: 1px solid rgba(17, 106, 99, .12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.activity-date i {
    grid-row: 1 / span 2;
    width: 16px !important;
    height: 14px !important;
    border: 2px solid currentColor;
    border-top-width: 4px;
    border-radius: 4px;
    opacity: .85;
}

.activity-date em {
    display: block;
    min-width: 0;
    font-size: 10px;
    line-height: 1;
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0;
}

.activity-date strong {
    display: block;
    min-width: 0;
    font-size: 12px !important;
    line-height: 1.05 !important;
    font-weight: 900;
    letter-spacing: 0;
}

.section-icon::before {
    content: "";
    width: 15px;
    height: 15px;
    background: currentColor;
}

.patients-kpis span,
.back-chip {
    min-width: 132px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 106, 99, .16);
    border-radius: 18px;
    background: #fff;
    color: #40566c;
}

.back-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    width: auto;
    padding: 12px 18px;
    color: #eafffc;
    background: #116a63;
    border-color: #116a63;
    text-decoration: none;
    font-weight: 750;
    transition: .18s ease;
}

.back-chip:hover {
    background: #0b5751;
    transform: translateY(-1px);
}

.document-module {
    margin: 24px 18px 0;
}

.document-library-grid {
    padding: 0 6px 20px;
}

.filter-chips button {
    padding: 8px 11px;
    border: 1px solid #dce8e5;
    border-radius: 999px;
    background: #f8fcfb;
    color: #055955;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.filter-chips button:hover,
.filter-chips button.active {
    color: #eafffc;
    background: #061b1a;
    border-color: #061b1a;
    transform: translateY(-1px);
}

.document-tile {
    transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.document-tile.is-selected {
    transform: translateY(-6px);
    border-color: rgba(32, 189, 173, .72);
    box-shadow: 0 26px 80px rgba(17, 106, 99, .18);
}

.document-tile.is-dimmed {
    opacity: .35;
    transform: scale(.985);
}

.lgpd-page-modal {
    z-index: 88;
}

.lgpd-modal-card {
    width: min(1080px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
}

.lgpd-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 18px;
}

.lgpd-card {
    box-shadow: none;
}

.lgpd-card h3 {
    margin-top: 0;
}

@media (max-width: 760px) {
    .document-module {
        margin: 22px 18px 0;
    }

    .document-library-grid {
        padding-left: 0;
        padding-right: 0;
    }

    .filter-chips button,
    .back-chip {
        flex: 1 1 auto;
    }

    .lgpd-modal-card {
        width: min(390px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
    }

    .lgpd-modal-grid {
        grid-template-columns: 1fr;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Inter", "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
    letter-spacing: 0;
    font-size: 14px;
    font-weight: 450;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

button, input, textarea, select { font: inherit; }

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--brand-dark);
    color: #f5fbfa;
    padding: 22px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px 20px;
    border-bottom: 1px solid rgba(255,255,255,.14);
    margin-bottom: 16px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.mobile-logo-link {
    display: inline-flex;
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand strong { font-size: 20px; }
.brand small { color: #b8d2ce; font-size: 12px; }

.brand-mark,
.mobile-logo {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #e8f3f1;
    color: var(--brand-dark);
    font-weight: 800;
    letter-spacing: 0;
    flex: 0 0 auto;
}

.brand-mark.large {
    width: 62px;
    height: 62px;
    font-size: 22px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #eaf4f2;
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 7px;
}

.nav a.active,
.nav a:hover {
    background: rgba(255,255,255,.12);
}

.nav-icon,
.metric-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: rgba(255,255,255,.12);
    position: relative;
    flex: 0 0 auto;
}

.metric-icon {
    width: 42px;
    height: 42px;
    background: var(--soft);
}

.nav-icon::before,
.metric-icon::before {
    content: "";
    width: 14px;
    height: 14px;
    display: block;
    background: currentColor;
    color: inherit;
}

.icon-panel::before { clip-path: polygon(0 0, 44% 0, 44% 44%, 0 44%, 0 0, 56% 0, 100% 0, 100% 44%, 56% 44%, 56% 0, 0 56%, 44% 56%, 44% 100%, 0 100%, 0 56%, 56% 56%, 100% 56%, 100% 100%, 56% 100%, 56% 56%); }
.icon-patient::before { clip-path: polygon(50% 0, 70% 8%, 80% 28%, 73% 48%, 60% 58%, 82% 68%, 100% 100%, 0 100%, 18% 68%, 40% 58%, 27% 48%, 20% 28%, 30% 8%); }
.icon-document::before { clip-path: polygon(0 0, 68% 0, 100% 30%, 100% 100%, 0 100%); }
.icon-signature::before { clip-path: polygon(0 76%, 14% 64%, 24% 75%, 38% 44%, 48% 65%, 68% 18%, 78% 48%, 100% 36%, 100% 56%, 72% 78%, 64% 55%, 51% 87%, 39% 66%, 28% 100%, 15% 82%, 0 96%); }
.icon-shield::before { clip-path: polygon(50% 0, 95% 16%, 88% 66%, 50% 100%, 12% 66%, 5% 16%); }
.icon-alert::before { clip-path: polygon(50% 0, 100% 88%, 0 88%); }

.main {
    padding: 24px;
    min-width: 0;
}

.mobile-bar {
    display: none;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.topbar h1 {
    margin: 0;
    font-size: 26px;
}

.topbar p {
    margin: 6px 0 0;
    color: var(--muted);
}

.tenant-chip {
    display: grid;
    gap: 3px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 13px;
    min-width: 180px;
}

.tenant-chip span {
    color: var(--muted);
    font-size: 12px;
}

.metric-grid,
.content-grid {
    display: grid;
    gap: 16px;
}

.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 16px;
    min-width: 0;
}

.card h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.metric strong {
    display: block;
    font-size: 30px;
    margin-bottom: 4px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 14px;
}

.metric span,
.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 12px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    background: var(--soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
}

.timeline,
.check-list {
    display: grid;
    gap: 10px;
    padding-left: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.wide { grid-column: 1 / -1; }

input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px 11px;
    color: var(--ink);
}

textarea {
    min-height: 96px;
    resize: vertical;
}

.button {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    border-radius: 7px;
    padding: 10px 13px;
    cursor: pointer;
}

.button.primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.button.full {
    width: 100%;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.document-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.document-card h3 {
    font-size: 15px;
    line-height: 1.3;
}

.signature-pad {
    width: 100%;
    height: 230px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    touch-action: none;
}

.actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.codebox {
    overflow: auto;
    background: #122826;
    color: #e9fffb;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
}

@media (max-width: 980px) {
    .app-shell,
    .metric-grid,
    .content-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(310px, 86vw);
        transform: translateX(-104%);
        transition: transform .2s ease;
        z-index: 20;
        box-shadow: 20px 0 50px rgba(0,0,0,.22);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    body.menu-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.32);
        z-index: 10;
    }

    .mobile-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 18px;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        border: 1px solid var(--line);
        background: #fff;
        border-radius: 8px;
        padding: 10px 12px;
        color: var(--ink);
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--ink);
        border-radius: 99px;
    }

    .menu-toggle {
        flex-wrap: wrap;
        width: 92px;
    }

    .menu-toggle strong {
        font-size: 13px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, #102b2a 0%, #116a63 48%, #f3f7f6 48%, #f3f7f6 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: center;
}

.login-brand {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 16px;
}

.login-brand h1 {
    margin: 0;
    font-size: 34px;
}

.login-brand p {
    max-width: 430px;
    color: #d2e7e4;
    line-height: 1.5;
}

.login-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
    display: grid;
    gap: 13px;
}

.login-card h2 {
    margin: 0 0 4px;
}

@media (max-width: 760px) {
    .login-body {
        background: #f3f7f6;
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-brand {
        color: var(--ink);
    }

    .login-brand p {
        color: var(--muted);
    }
}

/* Functional signature flow v15 */
.signature-flow {
    margin: 28px 36px 36px;
    display: grid;
    gap: 18px;
}

.signature-workbench,
.signed-list {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.signature-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f6fbfc;
    border: 1px solid #dce7e8;
}

.step span {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 12px;
    background: #20bdad;
    color: #fff;
    font-weight: 900;
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.stack {
    display: grid;
    gap: 12px;
}

.document-preview {
    min-height: 260px;
    border: 1px solid #dce7e8;
    border-radius: 16px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #f8fcfc);
    line-height: 1.55;
}

.evidence-list {
    display: grid;
    gap: 10px;
}

.evidence-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid #dce7e8;
    border-radius: 14px;
    background: #f8fcfc;
}

.evidence-list span {
    color: #64748b;
    text-align: right;
}

.signed-list code {
    color: #087d73;
    font-weight: 800;
}

.signed-archive {
    display: grid;
    gap: 18px;
    margin: 28px 36px 36px;
}

.signed-archive-hero {
    align-items: center;
}

.signed-archive-card {
    padding: 18px;
    overflow-x: auto;
}

.list-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.list-heading h2 {
    margin: 0;
}

.signed-list td strong,
.signed-list td small {
    display: block;
}

.signed-list td small {
    color: #64748b;
    margin-top: 3px;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

@media (max-width: 980px) {
    .signature-flow {
        margin-left: 18px;
        margin-right: 18px;
    }

    .signature-grid,
    .signature-steps {
        grid-template-columns: 1fr;
    }

    .evidence-list div {
        display: grid;
    }

    .evidence-list span {
        text-align: left;
    }

    .signed-archive {
        margin: 18px;
    }

    .list-heading,
    .table-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Occurrences module */
.occurrence-module {
    display: grid;
    gap: 18px;
    margin: 28px 36px 36px;
}

.occurrence-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px;
    border: 1px solid #c8eeee;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #e9fbf9 100%);
    box-shadow: 0 22px 50px rgba(15, 38, 71, .08);
}

.occurrence-hero h2 {
    max-width: 780px;
    margin: 4px 0 8px;
    font-size: 28px;
    line-height: 1.08;
}

.occurrence-hero p {
    max-width: 780px;
    margin: 0;
    color: #314b69;
}

.occurrence-actions,
.occurrence-stats,
.form-row,
.occurrence-grid {
    display: grid;
    gap: 12px;
}

.occurrence-actions {
    min-width: 210px;
}

.occurrence-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.occurrence-stat {
    display: grid;
    gap: 4px;
    padding: 18px;
    text-align: left;
    border: 1px solid #d7e5e6;
    border-radius: 18px;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(15, 38, 71, .06);
}

.occurrence-stat span {
    color: #005f5b;
    font-size: 28px;
    font-weight: 800;
}

.occurrence-stat strong {
    color: #334155;
    font-size: 13px;
}

.stat-red { border-color: #fecaca; background: #fff7f7; }
.stat-yellow { border-color: #fde68a; background: #fffbeb; }
.stat-green { border-color: #b7f3dd; background: #f0fdf7; }
.stat-blue { border-color: #bfdbfe; background: #f3f8ff; }

.occurrence-grid {
    grid-template-columns: minmax(320px, .85fr) minmax(0, 1.35fr);
    align-items: start;
}

.occurrence-grid.secondary {
    grid-template-columns: minmax(0, 1fr) minmax(320px, .72fr);
}

.occurrence-form {
    display: grid;
    gap: 12px;
}

.occurrence-form textarea {
    min-height: 124px;
}

.form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.occurrence-board,
.occurrence-form-card,
.occurrence-timeline,
.occurrence-guardrails {
    padding: 18px;
}

.occurrence-list {
    display: grid;
    gap: 10px;
}

.occurrence-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 130px 120px;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #d9e8e8;
    border-radius: 16px;
    background: #fbfefe;
}

.occurrence-row h3 {
    margin: 3px 0;
    font-size: 16px;
}

.occurrence-row p,
.occurrence-meta small,
.timeline-item p,
.guardrail-list span {
    margin: 0;
    color: #536b7f;
}

.status-pin {
    width: 10px;
    height: 48px;
    border-radius: 999px;
    background: #20bdad;
}

.row-red .status-pin { background: #ef4444; }
.row-yellow .status-pin { background: #f59e0b; }
.row-green .status-pin { background: #10b981; }

.occurrence-meta {
    display: grid;
    gap: 4px;
    font-weight: 800;
}

.management-page {
    gap: 22px;
}

.management-hero {
    background: linear-gradient(120deg, rgba(17, 106, 99, .08), rgba(37, 75, 122, .08)), #fff;
}

.management-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.management-metric {
    position: relative;
    overflow: hidden;
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow);
}

.management-metric::after {
    content: "";
    position: absolute;
    right: -26px;
    top: -26px;
    width: 92px;
    height: 92px;
    border-radius: 999px;
    background: rgba(98, 232, 217, .20);
}

.management-metric span,
.management-metric small {
    display: block;
    color: #415a57;
    font-weight: 700;
}

.management-metric strong {
    display: block;
    margin: 8px 0 2px;
    color: #035b55;
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1;
}

.management-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 18px;
}

.management-card.wide {
    grid-row: span 2;
}

.priority-list {
    display: grid;
    gap: 12px;
}

.priority-row {
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr) 180px;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fcfb;
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.priority-row:hover {
    transform: translateY(-2px);
    border-color: #8ce6dd;
    box-shadow: 0 14px 30px rgba(17, 106, 99, .12);
}

.priority-row small,
.breakdown-row span {
    display: block;
    color: #52706c;
    font-weight: 600;
}

.breakdown-row {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.breakdown-row:last-child {
    border-bottom: 0;
}

.mini-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eaf2f0;
}

.mini-bar span {
    display: block;
    height: 100%;
    min-width: 8px;
    border-radius: inherit;
    background: linear-gradient(90deg, #20bdad, #3769ff);
}

.access-page {
    gap: 20px;
}

.access-hero {
    background: linear-gradient(120deg, rgba(37, 75, 122, .08), rgba(17, 106, 99, .08)), #fff;
}

.access-profile-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.access-profile-card {
    display: grid;
    align-content: start;
    gap: 10px;
    min-height: 190px;
}

.access-profile-card p {
    margin: 0;
    color: #526a66;
    font-weight: 600;
}

.permission-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.permission-tags span {
    padding: 6px 8px;
    border-radius: 999px;
    background: #e9fbf9;
    color: #006f68;
    font-size: 11px;
    font-weight: 800;
}

.access-board {
    padding: 18px;
}

.access-user-list {
    display: grid;
    gap: 12px;
}

.access-user-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.25fr) repeat(4, minmax(120px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfefe;
}

.access-user-main {
    display: flex;
    align-items: center;
    gap: 12px;
    align-self: center;
}

.access-user-main small {
    display: block;
    color: #607673;
    font-weight: 600;
}

.access-user-row label {
    display: grid;
    gap: 6px;
    color: #5e6f6c;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.access-user-row input,
.access-user-row select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 10px;
    font: inherit;
}

@media (max-width: 1120px) {
    .management-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .management-grid {
        grid-template-columns: 1fr;
    }

    .access-profile-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .access-user-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .management-metrics {
        grid-template-columns: 1fr;
    }

    .priority-row {
        grid-template-columns: 8px minmax(0, 1fr);
    }

    .priority-row > div:last-child {
        grid-column: 2;
    }

    .access-profile-grid,
    .access-user-row {
        grid-template-columns: 1fr;
    }
}

.timeline-item {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid #d9e8e8;
}

.timeline-item time {
    display: inline-grid;
    place-items: center;
    min-height: 42px;
    border-radius: 14px;
    background: #e9fbf9;
    color: #00766f;
    font-weight: 800;
    font-size: 12px;
}

.guardrail-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.guardrail-list div {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #d9e8e8;
}

.guardrail-list .allowed { background: #f0fdf7; border-color: #b7f3dd; }
.guardrail-list .blocked { background: #fff7f7; border-color: #fecaca; }
.guardrail-list .neutral { background: #f3f8ff; border-color: #bfdbfe; }

.public-voice-body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top left, #ddfbf6, transparent 34%), #eef7f7;
    font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
}

.public-voice-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.public-voice-card {
    width: min(560px, 100%);
    display: grid;
    gap: 14px;
    padding: 28px;
    border: 1px solid #cde3e2;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(15, 38, 71, .14);
}

.public-voice-card img {
    width: 86px;
    border-radius: 18px;
}

.public-voice-card h1 {
    margin: 0;
    font-size: 34px;
}

.public-voice-card p {
    margin: 0;
    color: #314b69;
}

.public-voice-form {
    display: grid;
    gap: 12px;
}

.public-voice-form textarea {
    min-height: 150px;
}

.public-protocol {
    display: grid;
    gap: 5px;
    padding: 14px;
    border-radius: 16px;
    background: #e9fbf9;
    border: 1px solid #9ee8de;
}

.public-protocol span {
    color: #006a63;
    font-size: 22px;
    font-weight: 900;
}

@media (max-width: 980px) {
    .occurrence-module {
        margin: 18px;
    }

    .occurrence-hero,
    .occurrence-grid,
    .occurrence-grid.secondary {
        grid-template-columns: 1fr;
    }

    .occurrence-hero {
        display: grid;
    }

    .occurrence-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .occurrence-row {
        grid-template-columns: 10px minmax(0, 1fr);
    }

    .occurrence-meta {
        grid-column: 2;
    }
}

@media (max-width: 560px) {
    .occurrence-stats,
    .form-row {
        grid-template-columns: 1fr;
    }

    .occurrence-hero h2 {
        font-size: 22px;
    }
}

/* Product UI refinements */
body {
    background: #f6f9fb;
}

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    background: #050a1a;
    color: #f7fbff;
    padding: 24px 20px;
    border-right: 1px solid rgba(255,255,255,.08);
    transition: width .2s ease, padding .2s ease;
}

.brand {
    border-bottom: 1px solid rgba(255,255,255,.10);
    padding: 0 0 22px;
    margin-bottom: 22px;
    gap: 12px;
}

.brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 14px;
    filter: drop-shadow(0 10px 22px rgba(20, 219, 205, .18));
}

.brand-copy strong {
    color: #fff;
    font-size: 23px;
    line-height: 1;
}

.brand-copy small {
    color: #9aa8bd;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.collapse-button {
    width: 100%;
    border: 1px solid rgba(255,255,255,.10);
    background: rgba(255,255,255,.035);
    color: #c8d2e1;
    border-radius: 14px;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    margin-bottom: 22px;
    font-weight: 800;
}

.collapse-button:hover {
    border-color: rgba(43, 223, 207, .46);
    color: #fff;
}

.collapse-button span {
    color: #9dece4;
    font-size: 25px;
    line-height: 1;
}

.nav {
    gap: 10px;
}

.nav a {
    min-height: 58px;
    padding: 12px 14px;
    color: #c8d2e1;
    border-radius: 16px;
    font-weight: 800;
}

.nav a:hover {
    background: rgba(255,255,255,.07);
    color: #fff;
}

.nav a.active {
    background: #20bdad;
    color: #fff;
    box-shadow: 0 14px 28px rgba(32, 189, 173, .26);
}

.nav-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255,255,255,.10);
}

.nav a.active .nav-icon {
    background: rgba(255,255,255,.18);
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 92px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed .sidebar {
    padding-left: 16px;
    padding-right: 16px;
}

.app-shell.sidebar-collapsed .brand {
    justify-content: center;
}

.app-shell.sidebar-collapsed .brand img {
    width: 48px;
    height: 48px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav a span:last-child,
.app-shell.sidebar-collapsed .collapse-button strong {
    display: none;
}

.app-shell.sidebar-collapsed .collapse-button span {
    transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .nav a {
    justify-content: center;
    padding: 10px;
}

.main {
    padding: 0;
}

.topbar {
    min-height: 86px;
    margin: 0;
    padding: 0 36px;
    background: #fff;
    border-bottom: 1px solid #dfe7ed;
    gap: 24px;
}

.topbar h1 {
    color: #050a1a;
    font-size: 27px;
    line-height: 1.05;
}

.topbar p {
    color: #50617a;
}

.eyebrow {
    display: block;
    color: #087d73;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .24em;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.global-search {
    flex: 1 1 380px;
    max-width: 680px;
}

.global-search input {
    height: 54px;
    border-radius: 16px;
    background: #f8fafc;
    font-weight: 700;
}

.tenant-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 230px;
    border-radius: 16px;
    padding: 10px 14px;
}

.tenant-chip .avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #050a1a;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
}

.tenant-chip small {
    display: block;
    color: #050a1a;
    font-size: 15px;
    font-weight: 900;
}

.tenant-chip strong {
    display: block;
    max-width: 150px;
    color: #64748b;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-actions {
    display: flex;
    gap: 10px;
}

.button {
    text-decoration: none;
    font-weight: 800;
}

.button.dark {
    background: #050a1a;
    color: #fff;
    border-color: #050a1a;
}

.metric-grid,
.content-grid,
.card {
    margin-left: 36px;
    margin-right: 36px;
}

.metric-grid {
    padding-top: 28px;
}

.card {
    border-color: #dce7e8;
    border-radius: 18px;
}

.metric {
    background: #ecfbf8;
    border-color: #8cf4e8;
    min-height: 136px;
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: #fff;
    color: #07655e;
}

.metric strong {
    color: #055955;
    font-size: 36px;
}

.document-card {
    border-color: #dce7e8;
    border-radius: 14px;
}

.login-body {
    background:
        radial-gradient(circle at 78% 28%, rgba(31, 188, 218, .26), transparent 24%),
        radial-gradient(circle at 22% 20%, rgba(44, 224, 211, .22), transparent 28%),
        linear-gradient(135deg, #069a9b 0%, #043861 48%, #061021 100%);
    overflow: hidden;
}

.login-body::before {
    content: "+";
    position: fixed;
    left: 4vw;
    top: 8vh;
    color: rgba(154, 255, 245, .16);
    font-size: 250px;
    font-weight: 200;
    line-height: 1;
}

.login-body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(118deg, transparent 0 44%, rgba(83, 241, 229, .12) 45%, transparent 46%),
        radial-gradient(circle at 93% 10%, rgba(48, 207, 236, .18) 0 2px, transparent 3px);
    background-size: auto, 52px 52px;
    pointer-events: none;
}

.login-shell {
    position: relative;
    z-index: 1;
}

.login-panel {
    grid-template-columns: 1fr 560px 1fr;
    width: min(1180px, 100%);
}

.login-brand {
    grid-column: 2;
    color: #fff;
    flex-direction: column;
    text-align: center;
    gap: 14px;
    background: #061b31;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 36px;
    padding: 34px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
}

.login-brand img {
    width: 188px;
    height: 188px;
    object-fit: contain;
    border-radius: 28px;
}

.login-brand span {
    color: #67f4e5;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .28em;
    text-transform: uppercase;
}

.login-brand h1 {
    font-size: 34px;
}

.login-brand p {
    margin: 0;
    color: #d7e5f2;
}

.login-card {
    grid-column: 2;
    margin-top: -4px;
    background: #061b31;
    border: 1px solid rgba(255,255,255,.08);
    border-top: 0;
    border-radius: 0 0 36px 36px;
    box-shadow: 0 30px 80px rgba(0,0,0,.28);
    padding: 0 42px 42px;
}

.login-card h2 {
    color: #fff;
    text-align: center;
    font-size: 28px;
}

.login-card > p {
    margin: 0;
    color: #d7e5f2;
    text-align: center;
}

.login-card label {
    color: #cfd9e8;
    letter-spacing: .14em;
}

.login-card input,
.login-card select {
    height: 58px;
    border: 0;
    border-radius: 18px;
    background: #fff;
}

.login-card .button.primary {
    height: 64px;
    border-radius: 18px;
    background: #20bdad;
    border-color: #20bdad;
    font-size: 18px;
}

.login-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.login-row a {
    color: #9ef6ed;
    font-weight: 800;
    text-decoration: none;
}

.remember {
    display: inline-flex;
    align-items: center;
    grid-template-columns: auto 1fr;
    gap: 8px;
    text-transform: none;
    letter-spacing: 0;
}

.remember input {
    width: 20px;
    height: 20px;
}

.login-card .hint {
    color: #93a4ba;
    text-align: center;
}

.metric-grid,
.content-grid.single,
.content-grid {
    margin-top: 28px;
}

@media (max-width: 1120px) {
    .topbar {
        flex-wrap: wrap;
        height: auto;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .global-search {
        order: 3;
        max-width: none;
        flex-basis: 100%;
    }
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .topbar,
    .metric-grid,
    .content-grid,
    .card {
        margin-left: 18px;
        margin-right: 18px;
    }

    .topbar {
        padding: 18px;
        margin: 0;
        border-radius: 0 0 18px 18px;
    }

    .mobile-logo-img {
        display: block;
        width: 54px;
        height: 54px;
        object-fit: contain;
        border-radius: 14px;
    }

    .collapse-button {
        display: none;
    }
}

@media (max-width: 760px) {
    .login-body {
        overflow: auto;
        background: linear-gradient(135deg, #043861 0%, #061021 100%);
    }

    .login-panel {
        grid-template-columns: 1fr;
    }

    .login-brand,
    .login-card {
        grid-column: 1;
        border-radius: 24px;
        padding-left: 22px;
        padding-right: 22px;
    }

    .login-card {
        padding-top: 22px;
    }

    .login-brand img {
        width: 136px;
        height: 136px;
    }

    .login-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions,
    .tenant-chip {
        width: 100%;
    }

    .top-actions .button {
        flex: 1;
        text-align: center;
    }
}

/* SS2 mobile/navigation fix v6 */
.icon-help::before {
    clip-path: none !important;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    content: "?" !important;
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
}

.menu-overlay {
    display: none;
}

.content-grid.single {
    grid-template-columns: minmax(0, 1fr);
}

.about-card {
    max-width: 1120px;
}

.about-icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: #ecfbf8;
    color: #087d73;
    margin-bottom: 12px;
}

.about-hero {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    margin-bottom: 22px;
}

.about-hero img {
    width: 170px;
    height: 170px;
    object-fit: contain;
    border-radius: 26px;
    filter: drop-shadow(0 18px 34px rgba(5, 89, 85, .18));
}

.about-card .lead {
    margin: 0 0 20px;
    max-width: 860px;
    color: #0f2a2b;
    font-size: 22px;
    line-height: 1.42;
    font-weight: 800;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.about-grid div {
    border: 1px solid #dce7e8;
    border-radius: 14px;
    padding: 16px;
    background: #fff;
}

.about-grid h3 {
    margin: 0 0 8px;
}

.about-grid p {
    margin: 0;
    color: #50617a;
    line-height: 1.5;
}

@media (max-width: 980px) {
    .mobile-bar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 10px 18px !important;
        background: #fff;
        border-bottom: 1px solid #dfe7ed;
        position: sticky;
        top: 0;
        z-index: 9;
    }

    .mobile-logo-img {
        display: block !important;
        width: 50px !important;
        height: 50px !important;
        object-fit: contain !important;
        border-radius: 14px;
        order: 0;
    }

    .menu-toggle {
        order: 1;
        display: inline-flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
        width: 48px !important;
        height: 44px !important;
        padding: 0 !important;
        border: 1px solid #d8e2df;
        background: #fff;
        border-radius: 10px;
        cursor: pointer;
        flex-wrap: nowrap !important;
    }

    .menu-toggle span {
        display: block !important;
        width: 28px !important;
        height: 6px !important;
        margin: 0 !important;
        background: #050a1a !important;
        border-radius: 99px;
    }

    .menu-toggle strong {
        display: none !important;
    }

    .sidebar {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        width: min(310px, 86vw) !important;
        transform: translateX(-104%) !important;
        transition: transform .22s ease !important;
        z-index: 20 !important;
    }

    body.menu-open .sidebar {
        transform: translateX(0) !important;
    }

    body.menu-open::after {
        display: none !important;
        content: none !important;
    }

    .menu-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.34);
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        z-index: 10;
    }

    body.menu-open .menu-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 760px) {
    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-hero {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .about-hero img {
        width: 112px;
        height: 112px;
    }

    .about-card .lead {
        font-size: 18px;
    }
}

/* SS2 product polish v8 */
body {
    background:
        radial-gradient(circle at 82% 8%, rgba(32, 189, 173, .10), transparent 24%),
        linear-gradient(180deg, #f7fbfc 0%, #eef5f7 100%);
}

.sidebar {
    background:
        radial-gradient(circle at 20% 0%, rgba(32, 189, 173, .18), transparent 26%),
        linear-gradient(180deg, #071128 0%, #050817 100%);
}

.nav-icon {
    color: #77f2e7;
    background: linear-gradient(135deg, rgba(119, 242, 231, .16), rgba(110, 129, 255, .11));
    border: 1px solid rgba(119, 242, 231, .08);
}

.nav a {
    border: 1px solid transparent;
}

.nav a:hover {
    background: rgba(255,255,255,.075);
    border-color: rgba(119, 242, 231, .16);
    transform: translateX(3px);
}

.nav a:hover .nav-icon {
    color: #050817;
    background: #77f2e7;
}

.nav a.active {
    background: linear-gradient(135deg, #20bdad 0%, #3769ff 120%);
}

.hero-console,
.dashboard-grid {
    margin-left: 36px;
    margin-right: 36px;
}

.hero-console {
    display: grid;
    grid-template-columns: minmax(0, 1.75fr) minmax(280px, .75fr);
    gap: 18px;
    margin-top: 28px;
}

.console-card,
.quick-panel {
    border: 1px solid #dce7e8;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(20, 51, 67, .08);
}

.console-card {
    min-height: 230px;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 26px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(5, 10, 26, .82), rgba(5, 89, 85, .84)),
        url('/assets/safetycare-logo.png') right -80px center / 330px auto no-repeat;
    overflow: hidden;
}

.console-card .eyebrow {
    color: #77f2e7;
}

.console-card h2 {
    max-width: 720px;
    margin: 0;
    font-size: 34px;
    line-height: 1.12;
}

.console-card p {
    max-width: 680px;
    margin: 14px 0 0;
    color: #d7e5f2;
    line-height: 1.55;
}

.score-widget {
    display: grid;
    gap: 10px;
    justify-items: center;
    flex: 0 0 174px;
}

.score-ring {
    width: 154px;
    height: 154px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #071128 0 57%, transparent 58%),
        conic-gradient(#77f2e7 0 82%, rgba(255,255,255,.16) 82% 100%);
}

.score-ring strong {
    font-size: 32px;
}

.score-ring span {
    margin-top: -42px;
    color: #a7c4d6;
    font-size: 12px;
    font-weight: 800;
}

.score-widget small {
    color: #d7e5f2;
    font-weight: 800;
}

.quick-panel {
    background: #fff;
    padding: 18px;
}

.quick-panel h2 {
    margin: 0 0 14px;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.quick-actions a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 12px;
    border: 1px solid #dce7e8;
    border-radius: 16px;
    color: #071128;
    text-decoration: none;
    font-weight: 900;
    background: linear-gradient(135deg, #fff, #f5fbfb);
}

.quick-actions a:hover {
    border-color: #77f2e7;
    box-shadow: 0 14px 30px rgba(32, 189, 173, .13);
}

.dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-metrics .metric {
    position: relative;
    overflow: hidden;
    background: #fff;
    border: 0;
    box-shadow: 0 18px 38px rgba(20, 51, 67, .08);
}

.dashboard-metrics .metric::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    opacity: .14;
}

.metric-mint::after { background: #20bdad; }
.metric-blue::after { background: #3769ff; }
.metric-violet::after { background: #7d5cff; }
.metric-amber::after { background: #f0a226; }

.dashboard-metrics .metric small {
    display: block;
    margin-top: 6px;
    color: #64748b;
    font-weight: 800;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, .65fr);
    gap: 18px;
    margin-top: 18px;
}

.dashboard-grid .risk-card {
    grid-column: 1 / -1;
}

.card-head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    margin-bottom: 14px;
}

.card-head h2 {
    margin: 0;
}

.text-link {
    color: #087d73;
    font-weight: 900;
    text-decoration: none;
}

.pipeline-bars {
    display: grid;
    gap: 17px;
}

.pipeline-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
}

.pipeline-row strong,
.pipeline-row span {
    display: block;
}

.pipeline-row span {
    color: #64748b;
    font-size: 13px;
}

.bar {
    height: 14px;
    border-radius: 999px;
    background: #edf3f5;
    overflow: hidden;
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #20bdad, #3769ff);
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-item {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid #dce7e8;
    border-radius: 16px;
    background: #f9fcfd;
}

.activity-item > span {
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 42px;
    border-radius: 14px;
    background: #ecfbf8;
    color: #087d73;
    font-weight: 900;
}

.activity-item p {
    margin: 4px 0 0;
    color: #64748b;
}

.password-card {
    max-width: 760px;
}

.password-intro {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.password-icon {
    display: inline-grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: #ecfbf8;
    color: #087d73;
}

.password-intro p {
    margin: 6px 0 0;
    color: #64748b;
}

.secure-form {
    display: grid;
    gap: 14px;
}

.password-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.success-banner {
    display: grid;
    gap: 4px;
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 16px;
    background: #ecfbf8;
    color: #055955;
}

@media (max-width: 1180px) {
    .hero-console,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .hero-console,
    .dashboard-grid {
        margin-left: 18px;
        margin-right: 18px;
    }

    .console-card {
        flex-direction: column;
        align-items: flex-start;
        background:
            linear-gradient(120deg, rgba(5, 10, 26, .88), rgba(5, 89, 85, .86)),
            url('/assets/safetycare-logo.png') right -70px bottom -60px / 240px auto no-repeat;
    }

    .console-card h2 {
        font-size: 25px;
    }

    .dashboard-metrics {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .score-widget {
        display: none;
    }

    .pipeline-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .password-intro {
        align-items: flex-start;
    }
}

/* SS2 mobile settings and icon contrast v9 */
.top-tools {
    display: flex;
    align-items: center;
    gap: 24px;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.settings-toggle {
    display: none;
}

.settings-toggle span,
.settings-toggle span::before,
.settings-toggle span::after {
    display: block;
    border-radius: 50%;
    background: #071128;
}

.settings-toggle span {
    position: relative;
    width: 6px;
    height: 6px;
}

.settings-toggle span::before,
.settings-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 6px;
    height: 6px;
}

.settings-toggle span::before { top: -10px; }
.settings-toggle span::after { top: 10px; }

.quick-actions .nav-icon,
.dashboard-metrics .metric-icon {
    color: #eafffc;
    background: linear-gradient(135deg, #0f766e 0%, #20bdad 100%);
    border-color: rgba(255,255,255,.26);
}

.quick-actions a:hover .nav-icon {
    background: linear-gradient(135deg, #20bdad 0%, #77f2e7 100%);
    color: #031b1a;
}

.password-icon::before {
    clip-path: polygon(50% 0, 95% 16%, 88% 66%, 50% 100%, 12% 66%, 5% 16%) !important;
    width: 18px !important;
    height: 18px !important;
    background: currentColor !important;
    content: "" !important;
}

.password-icon {
    flex: 0 0 auto;
    color: #eafffc;
    background: linear-gradient(135deg, #0f766e 0%, #20bdad 100%);
}

@media (max-width: 1120px) {
    .top-tools {
        flex: 1 1 100%;
        width: 100%;
        justify-content: stretch;
        align-items: stretch;
        gap: 12px;
    }

    .top-tools .global-search {
        flex: 1 1 auto;
        order: 0;
    }
}

@media (max-width: 760px) {
    .topbar {
        gap: 12px;
        position: relative;
    }

    .settings-toggle {
        display: inline-grid;
        place-items: center;
        position: absolute;
        right: 18px;
        top: 18px;
        width: 44px;
        height: 44px;
        border: 1px solid #d8e2df;
        border-radius: 14px;
        background: #fff;
        cursor: pointer;
    }

    .topbar > div:first-child {
        padding-right: 58px;
    }

    .top-tools {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 12px;
        padding-top: 8px;
    }

    .top-tools.open {
        display: flex;
    }

    .top-tools .global-search,
    .top-tools .tenant-chip,
    .top-tools .top-actions {
        width: 100%;
    }

    .top-tools .global-search input {
        height: 50px;
    }

    .password-card {
        overflow: visible;
    }

    .password-intro {
        display: grid;
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 14px;
    }

    .password-icon {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    table {
        min-width: 640px;
    }

    .card:has(table) {
        overflow-x: auto;
    }
}

/* SS2 operational system layer v16 */
.operation-layout {
    display: grid;
    grid-template-columns: minmax(320px, .82fr) minmax(420px, 1.18fr);
    gap: 24px;
    align-items: start;
}

.work-card,
.patient-list-card,
.library-intro,
.system-document-card {
    border-color: rgba(12, 118, 108, .18);
    box-shadow: 0 24px 70px rgba(7, 17, 40, .08);
}

.work-card {
    background:
        radial-gradient(circle at right top, rgba(119, 242, 231, .22), transparent 34%),
        #fff;
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll table {
    min-width: 720px;
}

td strong {
    display: block;
}

td small {
    display: block;
    color: #52686d;
    margin-top: 3px;
}

.document-studio {
    display: grid;
    gap: 22px;
}

.library-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background:
        linear-gradient(120deg, rgba(255,255,255,.96), rgba(235, 252, 249, .94)),
        url('/assets/safetycare-logo.png') right 28px center / 130px auto no-repeat;
}

.library-intro p {
    max-width: 760px;
    margin: 6px 0 0;
    color: #30496d;
}

.system-document-card {
    display: flex;
    flex-direction: column;
    min-height: 238px;
    background: #fff;
}

.system-document-card:hover {
    transform: translateY(-4px);
    border-color: rgba(21, 197, 180, .65);
    box-shadow: 0 28px 80px rgba(17, 106, 99, .14);
}

.doc-card-top,
.doc-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.doc-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: auto 0 18px;
}

.doc-meta div {
    padding: 10px;
    border-radius: 14px;
    background: #f3fbfa;
}

.doc-meta dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #607579;
}

.doc-meta dd {
    margin: 4px 0 0;
    font-weight: 800;
    color: #055955;
}

.risk-pill {
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.risk-alto {
    color: #7a1d1d;
    background: #ffe8e8;
}

.risk-medio {
    color: #7a4b05;
    background: #fff3d7;
}

.risk-baixo {
    color: #055955;
    background: #e7fbf7;
}

.signature-workbench {
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(247, 254, 252, .98));
}

.step {
    border: 1px solid rgba(21, 197, 180, .22);
    background: #f4fffd;
}

.step span {
    background: #116a63;
    color: #fff;
}

.document-preview {
    border-left: 5px solid #20bdad;
    background:
        linear-gradient(90deg, rgba(235, 252, 249, .95), rgba(255,255,255,.98));
}

@media (max-width: 1180px) {
    .operation-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .operation-layout,
    .document-studio {
        margin-left: 18px;
        margin-right: 18px;
    }

    .library-intro {
        display: grid;
        background:
            linear-gradient(120deg, rgba(255,255,255,.96), rgba(235, 252, 249, .94)),
            url('/assets/safetycare-logo.png') right 16px top 16px / 82px auto no-repeat;
        padding-right: 96px;
    }

    .doc-meta {
        grid-template-columns: 1fr;
    }

    .table-scroll table {
        min-width: 680px;
    }
}

/* SS2 refinement v17: smaller typography, modal and toasts */
body {
    font-size: 14px;
}

.topbar h1 {
    font-size: 23px;
    line-height: 1.08;
    font-weight: 750;
}

.topbar p,
.console-card p,
.library-intro p,
.hint,
td,
th,
label,
input,
select,
textarea {
    font-size: 14px;
}

.eyebrow {
    font-size: 10px;
    letter-spacing: .28em;
    font-weight: 800;
}

.brand-copy strong {
    font-size: 20px;
}

.brand-copy small,
.tenant-chip strong,
.tenant-chip small {
    font-size: 12px;
}

.nav a {
    font-size: 14px;
    font-weight: 700;
}

.button,
button,
.quick-actions a strong {
    font-size: 14px;
    font-weight: 700;
}

.console-card {
    min-height: 276px;
    border-radius: 22px;
}

.console-card h2 {
    font-size: 28px;
    line-height: 1.13;
    max-width: 680px;
    font-weight: 760;
}

.quick-panel h2,
.card h2,
.pipeline-card h2,
.activity-card h2,
.risk-card h2 {
    font-size: 21px;
    font-weight: 740;
}

.metric strong {
    font-size: 30px;
    font-weight: 760;
}

.metric span {
    font-size: 13px;
}

.metric small,
.pipeline-row span,
.activity-item p {
    font-size: 13px;
}

.quick-actions a {
    min-height: 58px;
}

.card,
.quick-panel,
.metric {
    border-radius: 22px;
}

.activity-item {
    align-items: center;
}

.activity-date {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 92px;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 15px;
    background: #e9fbf8;
    color: #03736a;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.activity-date i {
    display: inline-block;
    width: 17px;
    height: 15px;
    border: 2px solid currentColor;
    border-top-width: 4px;
    border-radius: 4px;
    opacity: .78;
    flex: 0 0 auto;
}

.activity-date strong {
    display: block;
    white-space: pre-line;
    font-size: 12px;
    font-weight: 750;
}

.system-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 22px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.system-modal[aria-hidden="false"] {
    opacity: 1;
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(4, 10, 24, .42);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    border: 1px solid rgba(190, 214, 210, .8);
    border-radius: 24px;
    background:
        radial-gradient(circle at right top, rgba(119, 242, 231, .16), transparent 36%),
        #fff;
    box-shadow: 0 30px 90px rgba(4, 10, 24, .24);
    padding: 22px;
    transform: translateY(12px) scale(.98);
    transition: transform .2s ease;
}

.about-page-modal {
    z-index: 88;
}

.about-modal-card {
    width: min(940px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    padding: 24px;
}

.about-modal-hero {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    padding: 18px;
    border: 1px solid #dce8e5;
    border-radius: 20px;
    background:
        linear-gradient(120deg, rgba(235, 252, 249, .9), rgba(255,255,255,.96));
    margin-bottom: 16px;
}

.about-modal-hero img {
    width: 118px;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(17, 106, 99, .18);
}

.about-modal-hero .lead {
    margin: 0;
    color: #0f2e36;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 700;
}

.about-modal-card .about-grid {
    gap: 14px;
}

.about-modal-card .about-grid > div {
    border-radius: 16px;
    background: #fff;
}

.patients-module {
    display: grid;
    gap: 22px;
    margin-top: 28px;
}

.patients-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border-color: rgba(32, 189, 173, .22);
    background:
        linear-gradient(120deg, rgba(255,255,255,.96), rgba(232, 250, 247, .92)),
        radial-gradient(circle at right top, rgba(47, 124, 246, .12), transparent 32%);
}

.patients-hero h2 {
    max-width: 780px;
    margin: 6px 0 8px;
    font-size: 24px;
    line-height: 1.18;
}

.patients-hero p {
    max-width: 820px;
    margin: 0;
    color: #40566c;
}

.patients-kpis {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.patients-kpis span {
    min-width: 132px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 106, 99, .16);
    border-radius: 18px;
    background: #fff;
    color: #40566c;
}

.patients-kpis strong {
    display: block;
    color: #055955;
    font-size: 25px;
    line-height: 1;
}

.patient-workspace {
    align-items: stretch;
}

.patient-form-card,
.patient-board {
    border-radius: 24px;
}

.patient-form-card {
    background:
        linear-gradient(160deg, rgba(255,255,255,.98), rgba(239, 253, 250, .94));
}

.patient-form-card input,
.patient-form-card textarea,
.patient-form-card select {
    border-radius: 12px;
    background: #fff;
}

.patient-board table {
    border-collapse: separate;
    border-spacing: 0 8px;
}

.patient-board thead th {
    border-bottom: 0;
    color: #607579;
}

.patient-board tbody tr {
    background: #f8fcfb;
}

.patient-board tbody td {
    border-top: 1px solid #dce8e5;
    border-bottom: 1px solid #dce8e5;
    padding-top: 13px;
    padding-bottom: 13px;
}

.patient-board tbody td:first-child {
    border-left: 1px solid #dce8e5;
    border-radius: 14px 0 0 14px;
}

.patient-board tbody td:last-child {
    border-right: 1px solid #dce8e5;
    border-radius: 0 14px 14px 0;
}

.document-module {
    margin-top: 24px;
}

.document-hero {
    padding: 22px 24px;
}

.document-command {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.document-command span {
    min-width: 116px;
    padding: 12px 14px;
    border: 1px solid rgba(17, 106, 99, .14);
    border-radius: 16px;
    background: rgba(255,255,255,.9);
    color: #40566c;
    font-size: 13px;
}

.document-command strong {
    display: block;
    color: #055955;
    font-size: 22px;
    line-height: 1;
}

.document-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-radius: 18px;
    box-shadow: 0 14px 36px rgba(7, 17, 40, .05);
}

.document-toolbar strong {
    display: block;
    margin-top: 3px;
    font-size: 15px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.filter-chips span {
    padding: 8px 11px;
    border: 1px solid #dce8e5;
    border-radius: 999px;
    background: #f8fcfb;
    color: #055955;
    font-size: 12px;
    font-weight: 700;
}

.document-library-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
}

.document-tile {
    min-height: 255px;
    padding: 18px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
}

.document-tile::after {
    content: "";
    position: absolute;
    right: -34px;
    top: -34px;
    width: 94px;
    height: 94px;
    border-radius: 50%;
    background: rgba(32, 189, 173, .08);
}

.doc-code {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: #061b1a;
    color: #eafffc;
    font-size: 13px;
    font-weight: 800;
}

.document-tile h3 {
    min-height: 48px;
    margin: 16px 0 6px;
    font-size: 16px;
    line-height: 1.25;
}

.doc-module {
    margin: 0 0 16px;
    color: #607579;
    font-size: 13px;
    font-weight: 650;
}

.document-tile .doc-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: auto 0 16px;
}

.document-tile .doc-meta div {
    padding: 9px;
}

.document-tile .doc-meta dt {
    font-size: 10px;
    letter-spacing: .06em;
}

.document-tile .doc-meta dd {
    font-size: 14px;
}

.system-modal[aria-hidden="false"] .modal-card {
    transform: translateY(0) scale(1);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.modal-head h2 {
    margin: 4px 0;
    font-size: 24px;
}

.modal-head p {
    margin: 0;
    color: #40566c;
    font-size: 14px;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid #d9e5e2;
    border-radius: 13px;
    background: #fff;
    color: #071128;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.modal-form {
    display: grid;
    gap: 13px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.modal-open .app-shell {
    filter: blur(3px);
}

.toast-stack {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 44px));
}

.system-toast {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border: 1px solid rgba(32, 189, 173, .28);
    border-radius: 18px;
    background: #061b1a;
    color: #eafffc;
    box-shadow: 0 18px 50px rgba(4, 10, 24, .22);
    animation: toast-in .22s ease both;
}

.system-toast span {
    color: #bdeee8;
    font-size: 13px;
}

.system-toast.leaving {
    animation: toast-out .22s ease both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 760px) {
    body {
        font-size: 14px;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .console-card h2 {
        font-size: 22px;
    }

    .quick-panel h2,
    .card h2 {
        font-size: 20px;
    }

    .metric strong {
        font-size: 31px;
    }

    .modal-card {
        padding: 18px;
        border-radius: 20px;
    }

    .about-modal-card {
        width: min(390px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
    }

    .about-modal-hero {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 14px;
        padding: 14px;
    }

    .about-modal-hero img {
        width: 72px;
        border-radius: 16px;
    }

    .about-modal-hero .lead {
        font-size: 15px;
    }

    .patients-module {
        margin: 22px 18px 0;
    }

    .patients-hero {
        display: grid;
        padding: 18px;
    }

    .patients-hero h2 {
        font-size: 20px;
    }

    .patients-kpis {
        justify-content: stretch;
    }

    .patients-kpis span {
        flex: 1 1 130px;
    }

    .document-module {
        margin: 22px 18px 0;
    }

    .document-hero,
    .document-toolbar {
        display: grid;
    }

    .document-command,
    .filter-chips {
        justify-content: stretch;
    }

    .document-command span,
    .document-command .button,
    .filter-chips span {
        flex: 1 1 auto;
    }
}

/* SS2 polish pass v23 - final precedence */
.activity-date {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    width: 82px;
    min-height: 38px;
    padding: 7px 8px;
}

.activity-date i {
    width: 14px;
    height: 13px;
}

.activity-date strong {
    font-size: 11px;
    line-height: 1.12;
}

.score-ring {
    align-content: center;
    gap: 3px;
}

.score-ring span {
    margin-top: 0 !important;
    line-height: 1;
}

.score-widget small {
    display: block;
    margin-top: 7px;
}

.title-with-icon {
    display: flex;
    align-items: center;
    gap: 9px;
}

.section-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 12px;
    color: #eafffc;
    background: linear-gradient(135deg, #0f766e 0%, #20bdad 100%);
    flex: 0 0 auto;
}

.section-icon::before {
    content: "";
    width: 15px;
    height: 15px;
    background: currentColor;
}

.patients-kpis span,
.back-chip {
    min-width: 132px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 106, 99, .16);
    border-radius: 18px;
    background: #fff;
    color: #40566c;
}

.back-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    color: #055955;
    text-decoration: none;
    font-weight: 750;
    transition: .18s ease;
}

.document-module {
    margin: 24px 18px 0;
}

.document-library-grid {
    padding: 0 6px 20px;
}

.filter-chips button {
    padding: 8px 11px;
    border: 1px solid #dce8e5;
    border-radius: 999px;
    background: #f8fcfb;
    color: #055955;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease, border-color .18s ease;
}

.filter-chips button:hover,
.filter-chips button.active {
    color: #eafffc;
    background: #061b1a;
    border-color: #061b1a;
    transform: translateY(-1px);
}

.document-tile {
    transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.document-tile.is-selected {
    transform: translateY(-6px);
    border-color: rgba(32, 189, 173, .72);
    box-shadow: 0 26px 80px rgba(17, 106, 99, .18);
}

.document-tile.is-dimmed {
    opacity: .35;
    transform: scale(.985);
}

.lgpd-page-modal {
    z-index: 88;
}

.lgpd-modal-card {
    width: min(1080px, calc(100vw - 48px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
}

.lgpd-modal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr);
    gap: 18px;
}

.lgpd-card {
    box-shadow: none;
}

.lgpd-card h3 {
    margin-top: 0;
}

@media (max-width: 760px) {
    .document-module {
        margin: 22px 18px 0;
    }

    .document-library-grid {
        padding-left: 0;
        padding-right: 0;
    }

    .filter-chips button,
    .back-chip {
        flex: 1 1 auto;
    }

    .lgpd-modal-card {
        width: min(390px, calc(100vw - 32px));
        max-height: calc(100vh - 32px);
    }

    .lgpd-modal-grid {
        grid-template-columns: 1fr;
    }
}

/* SS2 v28 final - auditoria recente com data organizada e mais respiro */
.activity-card {
    min-width: min(100%, 540px);
}

.activity-list {
    gap: 14px !important;
}

.activity-item {
    grid-template-columns: 96px minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: center !important;
    min-height: 86px !important;
    padding: 14px 16px !important;
}

.activity-date {
    display: grid !important;
    grid-template-columns: 22px 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    align-items: center !important;
    justify-items: start !important;
    column-gap: 9px !important;
    row-gap: 2px !important;
    width: 82px !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 9px 10px !important;
    border-radius: 18px !important;
    background: linear-gradient(135deg, #e6fbf5 0%, #f7fffd 100%) !important;
    border: 1px solid rgba(17, 106, 99, .18) !important;
    color: #066b63 !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.72) !important;
}

.activity-date i {
    grid-row: 1 / span 2 !important;
    width: 18px !important;
    height: 16px !important;
    margin: 0 !important;
    border: 2px solid currentColor !important;
    border-top-width: 5px !important;
    border-radius: 5px !important;
    opacity: .9 !important;
}

.activity-date em,
.activity-date strong {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
}

.activity-date em {
    align-self: end !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-style: normal !important;
    font-weight: 800 !important;
}

.activity-date strong {
    align-self: start !important;
    font-size: 13px !important;
    line-height: 1.05 !important;
    font-weight: 900 !important;
}

.activity-item > div {
    min-width: 0;
}

.activity-item > div > strong {
    display: block;
    line-height: 1.2;
}

@media (max-width: 760px) {
    .activity-item {
        grid-template-columns: 88px minmax(0, 1fr) !important;
        gap: 12px !important;
        padding: 12px !important;
    }

    .activity-date {
        width: 78px !important;
    }
}

/* SS2 v29 - comprovante para salvar em PDF */
.print-document-body {
    min-height: 100vh;
    background: #eef5f3;
    color: #17211f;
}

/* SafetyCare v2 - PWA icon and header polish */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

.app-shell {
    min-height: 100vh;
    margin: 0 !important;
}

.main {
    padding-top: 0 !important;
}

.sidebar {
    padding-top: 18px !important;
}

.brand {
    padding-bottom: 24px !important;
    margin-bottom: 22px !important;
}

.brand-link {
    align-items: center !important;
    gap: 12px !important;
}

.brand img {
    width: 70px !important;
    height: 70px !important;
    border-radius: 16px !important;
    background: #fff;
    padding: 5px;
    object-fit: contain !important;
}

.brand-copy strong {
    font-size: 21px !important;
    line-height: 1 !important;
}

.brand-copy small {
    max-width: 160px;
    display: block;
    line-height: 1.22 !important;
    letter-spacing: .075em !important;
}

.topbar {
    min-height: 84px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-radius: 0 !important;
}

@media (max-width: 980px) {
    body {
        background: #eef8f7 !important;
    }

    .mobile-bar {
        height: 86px !important;
        padding: 12px 18px !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    .mobile-logo-img {
        width: 64px !important;
        height: 64px !important;
        border-radius: 16px !important;
        background: #fff;
        padding: 4px;
        box-shadow: 0 8px 22px rgba(5, 10, 26, .08);
    }

    .topbar {
        margin: 0 !important;
        padding: 18px !important;
        border-radius: 0 0 18px 18px !important;
    }

    .topbar h1 {
        font-size: 24px !important;
    }

    .topbar p {
        max-width: 300px;
    }
}

@media (max-width: 520px) {
    .mobile-bar {
        height: 82px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .mobile-logo-img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* Release safetycare-32: hospital background and approved establishment field. */
body.login-body {
    background:
        linear-gradient(100deg, rgba(3, 19, 30, .52) 0%, rgba(3, 38, 51, .25) 49%, rgba(3, 20, 31, .48) 100%),
        url("../assets/safetycare-login-hospital.jpg") center / cover no-repeat fixed !important;
}

/* Release safetycare-40: keep the desktop application grid aligned and scroll only its content. */
@media (min-width: 981px) {
    body:not(.login-body):not(.print-document-body) .app-shell {
        overflow: hidden !important;
    }

    body:not(.login-body):not(.print-document-body) .sidebar {
        height: 100vh !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    body:not(.login-body):not(.print-document-body) .sidebar-scroll {
        height: 100%;
        overflow-y: auto;
        padding: 18px 16px 36px;
    }

    body:not(.login-body):not(.print-document-body) .main {
        height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body:not(.login-body):not(.print-document-body) .dashboard-metrics {
        margin: 18px 36px !important;
    }

    body:not(.login-body):not(.print-document-body) .status-signal-grid {
        margin: 18px 36px 20px !important;
    }
}

/* Release safetycare-38: compact patient workspace and proportional signed-document mark. */
.patient-workspace > .card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.signed-document-header {
    grid-template-columns: 132px minmax(0, 1fr);
}

.signed-document-header img {
    display: block;
    width: 112px;
    height: auto;
    max-height: 82px;
    object-fit: contain;
    border-radius: 0;
}

/* Release safetycare-37: clean brand mark in About modal. */
.about-modal-hero .about-system-mark {
    display: grid;
    width: 118px;
    height: 118px;
    place-items: center;
    border: 1px solid rgba(33, 190, 178, .28);
    border-radius: 24px;
    background:
        radial-gradient(circle at 28% 22%, rgba(119, 242, 231, .62), transparent 34%),
        linear-gradient(145deg, #083b4b, #087d73);
    box-shadow: 0 18px 45px rgba(17, 106, 99, .18);
}
.about-modal-hero .about-system-mark span {
    color: #fff;
    font-size: 31px;
    font-weight: 900;
    letter-spacing: -.08em;
}
@media (max-width: 760px) {
    .about-modal-hero .about-system-mark { width: 72px; height: 72px; border-radius: 16px; }
    .about-modal-hero .about-system-mark span { font-size: 21px; }
}

/* Release safetycare-36: readable patient queue below wide-desktop layout. */
@media (min-width: 761px) and (max-width: 1700px) {
    .patient-board .table-scroll {
        overflow: visible;
    }

    .patient-board table,
    .patient-board tbody,
    .patient-board tr,
    .patient-board td {
        display: block;
        width: auto !important;
    }

    .patient-board table { table-layout: auto; }
    .patient-board thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .patient-board tbody { display: grid; gap: 10px; }
    .patient-board tbody tr {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
        gap: 0 16px;
        padding: 13px 15px;
        border: 1px solid #dce8e5;
        border-radius: 14px;
    }

    .patient-board tbody td {
        min-width: 0;
        padding: 7px 0;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .patient-board tbody td::before {
        display: block;
        margin-bottom: 3px;
        color: #607579;
        content: attr(data-label);
        font-size: 10px;
        font-weight: 800;
        letter-spacing: .09em;
        text-transform: uppercase;
    }

    .patient-board tbody td:nth-child(5) {
        grid-column: 1 / -1;
        padding-top: 9px;
        border-top: 1px solid #e3eceb !important;
    }

    .patient-board tbody td:nth-child(5)::before { display: none; }
    .patient-board tbody td:nth-child(5) .text-link { display: inline-flex; }
}

/* SafetyCare operational header and patient workspace refinement. */
.top-tools {
    min-width: 0;
}

.global-search {
    flex: 1 1 300px;
    max-width: 440px;
}

.global-search input {
    height: 46px;
    padding-inline: 16px;
    font-size: 13px;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: 270px;
    padding: 6px 8px 6px 6px;
    border: 1px solid #d7e2e4;
    border-radius: 14px;
    background: #fff;
    color: #08182e;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
    border-color: rgba(15, 170, 159, .55);
    background: #f7fffd;
    box-shadow: 0 8px 22px rgba(8, 49, 61, .09);
}

.user-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #0d7d75, #22beb4);
    color: #fff;
}

.user-avatar svg { width: 21px; height: 21px; }

.user-menu-copy,
.user-menu-summary > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.user-menu-copy strong,
.user-menu-summary strong {
    overflow: hidden;
    color: #08182e;
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-copy small,
.user-menu-summary small {
    overflow: hidden;
    color: #687a8b;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-chevron {
    width: 7px;
    height: 7px;
    margin: 0 3px 4px 2px;
    border-right: 2px solid #4e6374;
    border-bottom: 2px solid #4e6374;
    transform: rotate(45deg);
    transition: transform .18s ease;
}

.user-menu.open .user-menu-chevron { transform: rotate(225deg); margin-bottom: -3px; }

.user-menu-popover {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    z-index: 120;
    display: grid;
    width: min(278px, calc(100vw - 36px));
    padding: 8px;
    border: 1px solid #d6e4e5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(5, 20, 38, .18);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-5px);
    transition: opacity .16s ease, transform .16s ease;
}

.user-menu.open .user-menu-popover { opacity: 1; pointer-events: auto; transform: translateY(0); }

.user-menu-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 9px 12px;
    border-bottom: 1px solid #e4eeef;
}

.user-menu-actions { display: grid; gap: 2px; padding-top: 6px; }
.user-menu-actions form { margin: 0; }
.user-menu-actions button {
    width: 100%;
    padding: 10px 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #15253a;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    text-align: left;
}
.user-menu-actions button:hover,
.user-menu-actions button:focus-visible { background: #eafaf8; color: #087d73; outline: none; }
.user-menu-actions form button { color: #9e2e2e; }
.user-menu-actions form button:hover,
.user-menu-actions form button:focus-visible { background: #fff2f2; color: #9e2e2e; }

.patient-workspace {
    grid-template-columns: minmax(350px, .74fr) minmax(0, 1.26fr);
    gap: 18px;
}

.patient-board { min-width: 0; overflow: hidden; }
.patient-board .table-scroll { overflow-x: hidden; }
.patient-board table { width: 100%; min-width: 0; table-layout: fixed; }
.patient-board th,
.patient-board td { overflow-wrap: anywhere; }
.patient-board th:nth-child(1), .patient-board td:nth-child(1) { width: 23%; }
.patient-board th:nth-child(2), .patient-board td:nth-child(2) { width: 14%; }
.patient-board th:nth-child(3), .patient-board td:nth-child(3) { width: 23%; }
.patient-board th:nth-child(4), .patient-board td:nth-child(4) { width: 26%; }
.patient-board th:nth-child(5), .patient-board td:nth-child(5) { width: 14%; }

.about-modal-card {
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 28px 72px rgba(5, 20, 38, .28);
}
.about-modal-card .modal-head { padding: 2px 2px 18px; border-bottom: 1px solid #e4edef; }
.about-modal-card .about-modal-hero { border-radius: 18px; }

@media (max-width: 1180px) {
    .patient-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .global-search { max-width: none; }
    .user-menu { width: 100%; }
    .user-menu-trigger { width: 100%; max-width: none; }
    .user-menu-popover { left: 0; right: auto; width: 100%; box-sizing: border-box; }
    .patient-board .table-scroll { overflow-x: auto; }
    .patient-board table { min-width: 680px; table-layout: auto; }
}

.login-card select {
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    direction: ltr;
    text-indent: 0 !important;
}

.login-card select {
    box-sizing: border-box;
    width: 100%;
    height: 46px !important;
    padding: 0 40px 0 14px;
    border: 1px solid rgba(225, 244, 246, .24) !important;
    border-radius: 11px !important;
    background: rgba(249, 253, 253, .98) !important;
    color: #10262c;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.login-card select:focus {
    outline: 3px solid rgba(70, 218, 203, .27);
    outline-offset: 1px;
}

.signed-document-page {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 18px 48px;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.signed-document-sheet {
    padding: 34px;
    border: 1px solid #d8e2df;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(17, 42, 40, .12);
}

.signed-document-header {
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 18px;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #d8e2df;
}

.signed-document-header img {
    width: 76px;
    height: 76px;
    border-radius: 18px;
}

.signed-document-header span,
.signed-document-section h2 {
    color: #087d73;
    text-transform: uppercase;
    font-size: .72rem;
    letter-spacing: .22em;
    font-weight: 900;
}

.signed-document-header h1 {
    margin: 6px 0;
    font-size: 1.45rem;
}

.signed-document-header p,
.signed-document-section p,
.signed-document-footer span {
    color: #40566c;
    line-height: 1.55;
}

.signed-document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.signed-document-grid > div,
.signed-document-section {
    padding: 16px;
    border: 1px solid #dce8e5;
    border-radius: 16px;
    background: #f9fcfb;
}

.signed-document-grid strong {
    display: block;
    margin-bottom: 5px;
    color: #5c6c68;
    font-size: .78rem;
    text-transform: uppercase;
}

.signed-document-grid span,
.signed-document-grid code {
    word-break: break-word;
}

.signed-document-section {
    margin-top: 14px;
}

.signature-image {
    display: block;
    width: 100%;
    max-height: 190px;
    object-fit: contain;
    border: 1px dashed #b9cbc7;
    border-radius: 12px;
    background: #fff;
}

.evidence-print-grid {
    grid-template-columns: 1fr;
}

.signed-document-footer {
    display: grid;
    gap: 5px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #d8e2df;
}

@media print {
    body {
        background: #fff !important;
    }

    .print-actions {
        display: none !important;
    }

    .signed-document-page {
        max-width: none;
        padding: 0;
    }

    .signed-document-sheet {
        border: 0;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
}

/* Offline signature queue */
.offline-queue-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    margin-top: 22px;
}

/* Brand sizing */
.brand-link {
    gap: 16px !important;
}

.brand img {
    width: 88px !important;
    height: 88px !important;
    border-radius: 20px !important;
    padding: 3px !important;
}

.brand-copy strong {
    font-size: 25px !important;
}

.brand-copy small {
    font-size: 12px !important;
    max-width: 180px !important;
}

.app-shell.sidebar-collapsed .brand img {
    width: 68px !important;
    height: 68px !important;
    padding: 5px !important;
}

@media (max-width: 980px) {
    .mobile-logo-img {
        width: 72px !important;
        height: 72px !important;
        border-radius: 18px !important;
        padding: 5px !important;
    }
}

.offline-queue-card p {
    max-width: 860px;
    color: #354f59;
}

.offline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.offline-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: #e9fbf7;
    color: #00796f;
    font-size: .78rem;
    font-weight: 800;
}

.offline-status.is-offline {
    background: #fff3d8;
    color: #936100;
}

.offline-log {
    grid-column: 1 / -1;
    display: grid;
    gap: 10px;
}

.offline-empty {
    border: 1px dashed #c4d8d4;
    border-radius: 14px;
    padding: 14px;
    color: #49626b;
    font-weight: 700;
}

.offline-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #cfdfdc;
    border-radius: 16px;
    padding: 12px;
    background: #f8fcfb;
}

.offline-item strong,
.offline-item small {
    display: block;
}

.offline-item small {
    margin-top: 2px;
    color: #47616b;
    font-size: .74rem;
}

.offline-item .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f2bd35;
}

.offline-item.is-syncing .status-dot {
    background: #3687ff;
    animation: pulseSync 1s ease-in-out infinite;
}

.offline-item.is-synced .status-dot {
    background: #1fbf92;
}

.offline-item.is-error .status-dot {
    background: #e65353;
}

.offline-error {
    color: #a53a3a !important;
}

.button.compact {
    min-height: 34px;
    padding: 8px 12px;
    font-size: .78rem;
}

@keyframes pulseSync {
    0%, 100% {
        transform: scale(1);
        opacity: .7;
    }
    50% {
        transform: scale(1.25);
        opacity: 1;
    }
}

@media (max-width: 980px) {
    .offline-queue-card {
        grid-template-columns: 1fr;
    }

    .offline-actions {
        justify-content: stretch;
    }

    .offline-actions .button,
    .offline-status {
        width: 100%;
        justify-content: center;
    }

    .offline-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .offline-item .button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Global app layout */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

body:not(.login-body):not(.print-document-body) {
    background: #eef7f6 !important;
    overflow: hidden !important;
}

body:not(.login-body):not(.print-document-body) .app-shell {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: auto !important;
    border-radius: 0 !important;
}

body:not(.login-body):not(.print-document-body) .brand {
    overflow: visible !important;
}

body:not(.login-body):not(.print-document-body) .brand img {
    object-fit: cover !important;
    transform: scale(1.12);
}

body:not(.login-body):not(.print-document-body) .sidebar {
    top: 0 !important;
    margin-top: 0 !important;
    padding-top: 18px !important;
    min-height: 100vh !important;
}

body:not(.login-body):not(.print-document-body) .main {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

body:not(.login-body):not(.print-document-body) .topbar {
    position: relative !important;
    top: 0 !important;
    margin: 0 !important;
    min-height: 72px !important;
    height: 72px !important;
    padding: 0 34px !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
}

body:not(.login-body):not(.print-document-body) .topbar > div:first-child {
    margin: 0 !important;
    padding: 0 !important;
}

body:not(.login-body):not(.print-document-body) .topbar .eyebrow,
body:not(.login-body):not(.print-document-body) .topbar h1,
body:not(.login-body):not(.print-document-body) .topbar p {
    margin-top: 0 !important;
}

body:not(.login-body):not(.print-document-body) .document-module,
body:not(.login-body):not(.print-document-body) .signature-flow,
body:not(.login-body):not(.print-document-body) .patient-module,
body:not(.login-body):not(.print-document-body) .dashboard-grid,
body:not(.login-body):not(.print-document-body) .content-grid,
body:not(.login-body):not(.print-document-body) .privacy-grid {
    margin-top: 24px !important;
}

@media (max-width: 980px) {
    body:not(.login-body):not(.print-document-body) .mobile-bar {
        position: sticky !important;
        top: 0 !important;
        height: 82px !important;
        min-height: 82px !important;
        margin: 0 !important;
        padding: 8px 18px !important;
        border-radius: 0 !important;
    }

    body:not(.login-body):not(.print-document-body) .topbar {
        height: auto !important;
        min-height: 114px !important;
        padding: 14px 18px !important;
        align-items: flex-start !important;
    }
}

.public-protocol.warning {
    border-color: #ffd6d6;
    background: #fff7f7;
}

.public-status p {
    margin: 10px 0 0;
    color: var(--ink-soft);
}

.public-lookup-form {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.detail-hero {
    margin-bottom: 22px;
}

.occurrence-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.detail-list div {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(241, 252, 250, 0.72);
    padding: 12px;
}

.detail-list span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.detail-list strong {
    display: block;
    margin-top: 4px;
    color: var(--ink);
}

.muted {
    color: var(--muted);
}

@media (max-width: 980px) {
    .occurrence-detail-grid,
    .detail-list {
        grid-template-columns: 1fr;
    }
}

/* Release safetycare-24: login scroll and mobile drawer usability. */
html,
body.login-body {
    min-height: 100%;
}

body.login-body {
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.login-shell {
    min-height: 100dvh !important;
    height: auto !important;
    overflow: visible !important;
    padding-top: clamp(16px, 3vh, 34px) !important;
    padding-bottom: clamp(16px, 3vh, 34px) !important;
    box-sizing: border-box !important;
}

@media (max-height: 760px), (max-width: 760px) {
    .login-shell {
        align-items: start !important;
        place-items: start center !important;
    }

    .login-panel {
        margin-top: 0 !important;
        margin-bottom: 18px !important;
    }
}

/* Release safetycare-31: compact institutional access. */
body.login-body {
    background:
        radial-gradient(circle at 15% 82%, rgba(22, 180, 169, .20), transparent 27%),
        radial-gradient(circle at 83% 16%, rgba(28, 129, 158, .22), transparent 28%),
        linear-gradient(120deg, #06161e 0%, #082b38 48%, #041823 100%) !important;
}

body.login-body::before {
    content: "";
    inset: 0;
    left: auto;
    top: auto;
    position: fixed;
    background:
        linear-gradient(90deg, rgba(3, 14, 19, .58), rgba(3, 14, 19, .08) 46%, rgba(3, 14, 19, .50)),
        repeating-linear-gradient(90deg, transparent 0 54px, rgba(90, 232, 215, .035) 55px 56px),
        repeating-linear-gradient(0deg, transparent 0 54px, rgba(90, 232, 215, .025) 55px 56px);
    color: transparent;
    pointer-events: none;
}

body.login-body::after {
    opacity: .45;
}

.login-shell {
    min-height: 100dvh !important;
    padding: 24px !important;
    place-items: center !important;
}

.login-panel {
    width: min(100%, 420px) !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    text-align: center;
}

.login-brand {
    grid-column: 1 !important;
    display: inline-flex !important;
    justify-self: center;
    align-items: center;
    flex-direction: row !important;
    gap: 10px !important;
    padding: 0 0 18px !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #f4fbfc !important;
    font-weight: 800;
    font-size: 20px;
    letter-spacing: -.03em;
}

.login-brand img {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
    object-fit: contain;
}

.login-brand span {
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    letter-spacing: inherit !important;
    text-transform: none !important;
}

.login-card {
    grid-column: 1 !important;
    margin: 0 !important;
    padding: 30px !important;
    display: grid;
    gap: 15px !important;
    background: rgba(4, 13, 18, .86) !important;
    border: 1px solid rgba(163, 246, 235, .15) !important;
    border-radius: 22px !important;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .38) !important;
    backdrop-filter: blur(14px);
}

.login-card-heading h1 {
    margin: 0;
    color: #fff;
    font-size: 26px;
    line-height: 1.15;
}

.login-card-heading p,
.login-card > p {
    margin: 7px 0 0 !important;
    color: #b8cbd0 !important;
    font-size: 14px;
    line-height: 1.45;
}

.login-card label {
    display: grid;
    gap: 7px;
    color: #dce7e9 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em !important;
    text-align: left;
    text-transform: uppercase;
}

.login-card input {
    box-sizing: border-box;
    width: 100%;
    height: 46px !important;
    padding: 0 14px;
    border: 1px solid rgba(225, 244, 246, .24) !important;
    border-radius: 11px !important;
    background: rgba(249, 253, 253, .98) !important;
    color: #10262c;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.login-card input:focus {
    outline: 3px solid rgba(70, 218, 203, .27);
    outline-offset: 1px;
}

.login-card .button.primary {
    height: 48px !important;
    margin-top: 3px;
    border-radius: 11px !important;
    background: #49bc9d !important;
    border-color: #49bc9d !important;
    color: #06231f;
    font-size: 16px !important;
    font-weight: 800;
}

.login-row {
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.login-row .remember {
    display: inline-flex;
    grid-template-columns: none;
    gap: 7px;
    align-items: center;
    color: #dce7e9 !important;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0 !important;
    text-transform: none;
}

.login-row .remember input {
    width: 15px;
    height: 15px !important;
    accent-color: #49bc9d;
}

.login-help {
    color: #8ee5d2;
    font-weight: 700;
}

.login-card .hint {
    margin-top: -4px !important;
    color: #8fa6ac !important;
    font-size: 12px;
}

.login-version {
    margin: 16px 0 0;
    color: rgba(228, 247, 245, .74);
    font-size: 12px;
}

.login-version span {
    color: #78d8c4;
}

@media (max-width: 520px) {
    .login-shell {
        padding: 20px !important;
    }

    .login-card {
        padding: 25px 20px !important;
    }
}

@media (max-width: 980px) {
    body.menu-open {
        overflow: hidden !important;
    }

    .sidebar {
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        z-index: 1200 !important;
        padding-bottom: 28px !important;
    }

    .sidebar .nav {
        overflow: visible !important;
        padding-bottom: 110px !important;
    }

    .menu-overlay {
        z-index: 1100 !important;
    }
}

/* Release safetycare-26: iOS drawer scroll and tap navigation stability. */
@media (max-width: 980px) {
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        height: 100svh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        transform: translateX(-105%) !important;
    }

    body.menu-open .sidebar {
        transform: translateX(0) !important;
    }

    .sidebar .brand,
    .sidebar .collapse-button {
        flex: 0 0 auto !important;
    }

    .sidebar .nav {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        padding-bottom: 150px !important;
    }

    .sidebar .nav a {
        flex: 0 0 auto !important;
    }
}

/* Release safetycare-27: native mobile links, visible brand and whole drawer scroll. */
.brand img,
.mobile-logo-img {
    object-fit: contain !important;
    transform: none !important;
    background: #ffffff !important;
}

/* Release safetycare-28: real iOS scroll container inside mobile drawer. */
.sidebar-scroll {
    min-height: 100%;
}

@media (max-width: 980px) {
    .sidebar {
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        padding: 0 !important;
        z-index: 5000 !important;
        touch-action: auto !important;
    }

    .sidebar-scroll {
        height: 100% !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 18px 18px 180px !important;
        box-sizing: border-box !important;
        touch-action: pan-y !important;
    }

    .sidebar-scroll .brand,
    .sidebar-scroll .collapse-button,
    .sidebar-scroll .nav,
    .sidebar-scroll .nav a {
        pointer-events: auto !important;
    }

    .sidebar-scroll .nav {
        padding-bottom: 180px !important;
    }

    .menu-overlay {
        z-index: 4000 !important;
    }
}

.brand img {
    padding: 8px !important;
}

@media (max-width: 980px) {
    .sidebar {
        display: block !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        padding-bottom: 170px !important;
    }

    .sidebar .nav {
        display: grid !important;
        overflow: visible !important;
        padding-bottom: 170px !important;
    }
}

/* Release safetycare-31: final mobile drawer scroll and tap fix. */
@media (max-width: 980px) {
    body.menu-open {
        position: static !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    body.menu-open .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: auto !important;
        width: min(300px, 82vw) !important;
        height: calc(var(--sc-mobile-vh, 1vh) * 100) !important;
        max-height: calc(var(--sc-mobile-vh, 1vh) * 100) !important;
        display: block !important;
        transform: translateX(0) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
        padding: 0 !important;
        z-index: 5000 !important;
    }

    body.menu-open .sidebar-scroll {
        min-height: calc(var(--sc-mobile-vh, 1vh) * 100) !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
        padding: 18px 18px 360px !important;
    }

    body.menu-open .sidebar .nav {
        display: grid !important;
        overflow: visible !important;
        padding-bottom: 360px !important;
        gap: 12px !important;
    }

    body.menu-open .sidebar .nav a {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: rgba(105, 240, 225, 0.22) !important;
    }
}

/* Release safetycare-32: mobile drawer uses page scroll, not a frozen fixed body. */
@media (max-width: 980px) {
    body.menu-open {
        position: static !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: calc(var(--sc-mobile-vh, 1vh) * 170) !important;
    }

    body.menu-open .sidebar {
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        width: min(300px, 82vw) !important;
        min-height: calc(var(--sc-mobile-vh, 1vh) * 100) !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        -webkit-overflow-scrolling: auto !important;
        transform: translateX(0) !important;
        z-index: 5000 !important;
    }

    body.menu-open .sidebar-scroll {
        min-height: calc(var(--sc-mobile-vh, 1vh) * 100) !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding-bottom: 440px !important;
    }

    body.menu-open .sidebar .nav {
        overflow: visible !important;
        padding-bottom: 440px !important;
    }

    body.menu-open .main {
        pointer-events: none !important;
    }

    body.menu-open .sidebar,
    body.menu-open .sidebar * {
        pointer-events: auto !important;
    }
}

/* Release safetycare-33: independent mobile drawer, isolated from desktop sidebar. */
.mobile-drawer {
    display: none;
}

@media (max-width: 980px) {
    body.mobile-drawer-open {
        overflow: hidden !important;
    }

    body.mobile-drawer-open .app-shell {
        pointer-events: none !important;
    }

    .mobile-drawer {
        position: fixed !important;
        inset: 0 !important;
        display: block !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        z-index: 9000 !important;
        transition: opacity 180ms ease;
    }

    body.mobile-drawer-open .mobile-drawer {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-drawer-backdrop {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(5, 12, 28, 0.58);
    }

    .mobile-drawer-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: min(330px, 86vw);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior: contain;
        padding: 24px 18px 120px;
        box-sizing: border-box;
        background: linear-gradient(180deg, #062c38 0%, #030815 58%, #030612 100%);
        box-shadow: 24px 0 54px rgba(0, 0, 0, 0.35);
        transform: translateX(-104%);
        transition: transform 220ms ease;
    }

    body.mobile-drawer-open .mobile-drawer-panel {
        transform: translateX(0);
    }

    .mobile-drawer-panel .brand {
        margin-bottom: 22px;
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .mobile-drawer-panel .brand-link img {
        width: 74px !important;
        height: 74px !important;
        flex: 0 0 74px !important;
    }

    .mobile-drawer-panel .icon-button {
        margin-left: auto;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .mobile-drawer-nav {
        display: grid !important;
        gap: 12px !important;
        padding: 0 0 160px !important;
    }

    .mobile-drawer-nav a {
        min-height: 58px !important;
        pointer-events: auto !important;
        touch-action: manipulation !important;
    }
}

.related-party-fields {
    border: 1px solid rgba(17, 106, 99, 0.22);
    background: rgba(232, 251, 247, 0.58);
    border-radius: 18px;
    padding: 16px;
}

.field-card-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.field-card-heading small {
    display: block;
    color: #506a75;
    font-weight: 700;
    margin-top: 2px;
}

.related-party-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.checkbox-line {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    color: #173f49;
}

.checkbox-line input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 2px;
    flex: 0 0 18px;
}

@media (max-width: 720px) {
    .related-party-grid {
        grid-template-columns: 1fr;
    }
}

/* Release safetycare-32b: must follow legacy login skin overrides. */
body.login-body {
    background:
        linear-gradient(100deg, rgba(3, 19, 30, .52) 0%, rgba(3, 38, 51, .25) 49%, rgba(3, 20, 31, .48) 100%),
        url("../assets/safetycare-login-hospital.jpg") center / cover no-repeat fixed !important;
}

/* Release safetycare-38b: final precedence over legacy signed-document sizing. */
.patient-workspace {
    margin-left: 36px;
    margin-right: 36px;
}

.patient-workspace > .card {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.signed-document-header {
    grid-template-columns: 132px minmax(0, 1fr) !important;
}

.signed-document-header img {
    display: block !important;
    width: 112px !important;
    height: auto !important;
    max-height: 82px !important;
    object-fit: contain !important;
    border-radius: 0 !important;
}

@media (max-width: 760px) {
    .patient-workspace {
        margin-left: 18px;
        margin-right: 18px;
    }
}
