:root{
    --bg:#f4f6f8;
    --card:#ffffff;
    --text:#1f2937;
    --muted:#667085;
    --border:#d5dce5;
    --primary:#0b4d7a;
    --primary-dark:#083857;
    --danger:#b42318;
    --success:#137333;
    --internal:#fff7d6;
    --header:#0b2740;
    --radius:12px;
    --shadow:0 2px 8px rgba(15,23,42,.05);
}

*{
    box-sizing:border-box;
}

html{
    -webkit-text-size-adjust:100%;
}

body{
    margin:0;
    min-width:0;
    background:var(--bg);
    color:var(--text);
    font-family:Arial,Helvetica,sans-serif;
    font-size:16px;
    line-height:1.5;
    overflow-x:hidden;
}

img,
video,
canvas,
svg{
    max-width:100%;
    height:auto;
}

a{
    color:var(--primary);
    overflow-wrap:anywhere;
}

header{
    position:relative;
    z-index:10;
    background:var(--header);
    color:#fff;
    padding:14px 0;
}

header .wrap{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
}

.wrap{
    width:min(1180px,calc(100% - 32px));
    margin:0 auto;
}

.site-brand{
    display:flex;
    flex-direction:column;
    min-width:0;
}

.site-brand strong{
    font-size:1rem;
}

.site-brand span{
    color:#dce8f2;
    font-size:.86rem;
}

nav{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:18px;
    flex-wrap:wrap;
}

nav a{
    color:#fff;
    text-decoration:none;
    font-weight:700;
    margin:0;
}

nav a:hover,
nav a:focus{
    text-decoration:underline;
}

.nav-toggle{
    display:none;
    width:auto;
    padding:8px 12px;
    background:transparent;
    border:1px solid rgba(255,255,255,.55);
}

main{
    padding:24px 0 52px;
}

h1,
h2,
h3{
    line-height:1.2;
    overflow-wrap:anywhere;
}

h1{
    font-size:clamp(1.65rem,3vw,2.15rem);
    margin-top:0;
}

h2{
    font-size:clamp(1.3rem,2.4vw,1.65rem);
    margin-top:0;
}

.card{
    width:100%;
    min-width:0;
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:20px;
    margin-bottom:18px;
    box-shadow:var(--shadow);
    overflow-wrap:anywhere;
}

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

.grid-3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
}

label{
    display:block;
    margin-bottom:6px;
    font-weight:700;
}

input,
select,
textarea{
    display:block;
    width:100%;
    min-width:0;
    max-width:100%;
    padding:11px 12px;
    border:1px solid #b8c0ca;
    border-radius:8px;
    background:#fff;
    color:var(--text);
    font:inherit;
}

select[multiple]{
    min-height:160px;
}

textarea{
    min-height:130px;
    resize:vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus,
.button:focus{
    outline:3px solid rgba(11,77,122,.2);
    outline-offset:1px;
    border-color:var(--primary);
}

button,
.button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:auto;
    max-width:100%;
    border:0;
    border-radius:8px;
    background:var(--primary);
    color:#fff;
    padding:11px 16px;
    text-decoration:none;
    cursor:pointer;
    font:inherit;
    font-weight:700;
    line-height:1.2;
    white-space:normal;
    text-align:center;
}

button:hover,
.button:hover{
    background:var(--primary-dark);
}

.button.secondary{
    background:#56616d;
}

.button.danger{
    background:var(--danger);
}

button:disabled,
.button:disabled{
    cursor:not-allowed;
    opacity:.5;
}

.actions{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    flex-wrap:wrap;
    min-width:0;
}

.table-scroll,
.users-table-wrap{
    width:100%;
    max-width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
}

table{
    width:100%;
    border-collapse:collapse;
}

th,
td{
    padding:11px;
    border-bottom:1px solid var(--border);
    text-align:left;
    vertical-align:top;
    overflow-wrap:anywhere;
}

th{
    font-weight:700;
}

.badge{
    display:inline-block;
    max-width:100%;
    padding:4px 9px;
    border-radius:999px;
    background:#e8eef4;
    font-size:.85rem;
    white-space:normal;
}

.message{
    border-left:4px solid var(--primary);
    padding:14px 16px;
    background:#f8fafc;
    margin:14px 0;
    border-radius:7px;
    overflow-wrap:anywhere;
}

.message.internal{
    background:var(--internal);
    border-left-color:#a56a00;
}

.message.admin_only{
    background:#feecec;
    border-left-color:var(--danger);
}

.message.system{
    background:#eef2f7;
    border-left-color:#6b7280;
}

.meta{
    margin-bottom:7px;
    color:var(--muted);
    font-size:.88rem;
}

.flash{
    padding:12px 14px;
    border-radius:8px;
    margin-bottom:14px;
}

.flash.success{
    background:#e8f5e9;
    color:var(--success);
}

.flash.error{
    background:#fdecec;
    color:var(--danger);
}

.small{
    color:var(--muted);
    font-size:.9rem;
}

.users-page-layout{
    display:block;
}

.users-form-column,
.users-list-card{
    width:100%;
    min-width:0;
}

.user-action-stack{
    display:grid;
    grid-template-columns:repeat(2,minmax(130px,1fr));
    gap:8px;
    min-width:290px;
}

.user-action-stack form{
    margin:0;
}

.user-action-stack .button,
.user-action-stack button{
    width:100%;
    min-height:40px;
}

.small-button{
    padding:8px 10px;
    font-size:.84rem;
}

/* Tablet */
@media(max-width:900px){
    .wrap{
        width:min(100% - 24px,1180px);
    }

    .grid-3{
        grid-template-columns:1fr 1fr;
    }

    .card{
        padding:17px;
    }

    .user-action-stack{
        grid-template-columns:1fr;
        min-width:145px;
    }
}

/* Phone */
@media(max-width:700px){
    body{
        font-size:15px;
    }

    header{
        padding:11px 0;
    }

    header .wrap{
        align-items:flex-start;
        gap:10px;
        flex-wrap:wrap;
    }

    .site-brand{
        flex:1 1 auto;
        padding-right:8px;
    }

    .nav-toggle{
        display:inline-flex;
        flex:0 0 auto;
    }

    nav{
        display:none;
        width:100%;
        flex-direction:column;
        align-items:stretch;
        gap:0;
        padding-top:8px;
    }

    nav.is-open{
        display:flex;
    }

    nav a{
        display:block;
        width:100%;
        padding:11px 4px;
        border-top:1px solid rgba(255,255,255,.16);
    }

    main{
        padding:14px 0 36px;
    }

    .wrap{
        width:calc(100% - 20px);
    }

    .card{
        padding:14px;
        border-radius:10px;
        margin-bottom:12px;
    }

    .grid,
    .grid-3{
        grid-template-columns:1fr;
        gap:10px;
    }

    .actions{
        align-items:stretch;
    }

    .actions > *{
        max-width:100%;
    }

    .actions .button,
    .actions button{
        width:100%;
    }

    button,
    .button{
        width:100%;
        min-height:44px;
    }

    input,
    select,
    textarea{
        font-size:16px;
    }

    /*
     * Data tables become stacked cards on phones.
     */
    .table-scroll{
        overflow:visible;
    }

    table.responsive-data-table,
    table.responsive-data-table thead,
    table.responsive-data-table tbody,
    table.responsive-data-table tr,
    table.responsive-data-table th,
    table.responsive-data-table td{
        display:block;
        width:100%;
    }

    table.responsive-data-table{
        min-width:0 !important;
        border:0;
    }

    table.responsive-data-table thead{
        position:absolute;
        width:1px;
        height:1px;
        padding:0;
        margin:-1px;
        overflow:hidden;
        clip:rect(0,0,0,0);
        white-space:nowrap;
        border:0;
    }

    table.responsive-data-table tbody tr{
        margin:0 0 14px;
        padding:8px 12px;
        border:1px solid var(--border);
        border-radius:10px;
        background:#fff;
        box-shadow:0 1px 4px rgba(15,23,42,.04);
    }

    table.responsive-data-table tbody td{
        display:grid;
        grid-template-columns:minmax(105px,38%) minmax(0,1fr);
        gap:10px;
        padding:9px 0;
        border-bottom:1px solid #e8edf2;
    }

    table.responsive-data-table tbody td:last-child{
        border-bottom:0;
    }

    table.responsive-data-table tbody td::before{
        content:attr(data-label);
        color:#344054;
        font-weight:700;
        overflow-wrap:anywhere;
    }

    .user-action-stack{
        display:grid;
        grid-template-columns:1fr;
        width:100%;
        min-width:0;
    }

    .user-action-stack .button,
    .user-action-stack button{
        width:100%;
    }

    .message{
        padding:12px;
    }
}

/* Very narrow phones */
@media(max-width:390px){
    .wrap{
        width:calc(100% - 14px);
    }

    .card{
        padding:12px;
    }

    table.responsive-data-table tbody td{
        grid-template-columns:1fr;
        gap:3px;
    }

    table.responsive-data-table tbody td::before{
        font-size:.82rem;
    }
}

.narrow-card{max-width:680px;margin-left:auto;margin-right:auto}.motion-tally-card{width:100%;margin-bottom:18px;padding:18px;border:2px solid #0b4d7a;border-radius:12px;background:#fff;box-shadow:0 5px 16px rgba(15,23,42,.10)}.vote-tally-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0}.vote-tally{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:84px;padding:10px;border-radius:10px;background:#eef2f6}.vote-tally strong{font-size:1.75rem}.vote-tally.yes{background:#e8f5e9}.vote-tally.no{background:#fdecec}.vote-tally.abstain{background:#fff6db}.vote-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.vote-choice{display:flex;align-items:center;justify-content:center;gap:8px;padding:10px;border:1px solid #cbd5df;border-radius:9px}.vote-choice input{width:auto}


.position-list-heading{
    justify-content:space-between;
}

.position-sort-list{
    display:grid;
    gap:10px;
}

.position-sort-item{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:14px;
    align-items:center;
    padding:14px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#fff;
    box-shadow:0 1px 4px rgba(15,23,42,.04);
    cursor:grab;
    transition:
        opacity .15s ease,
        transform .15s ease,
        box-shadow .15s ease,
        background .15s ease;
}

.position-sort-item:active{
    cursor:grabbing;
}

.position-sort-item.is-dragging{
    opacity:.48;
    transform:scale(.99);
    box-shadow:0 10px 24px rgba(15,23,42,.14);
}

.position-sort-item.is-selected-for-move{
    outline:3px solid rgba(11,77,122,.28);
    background:#eef6fb;
}

.drag-handle{
    width:46px;
    min-width:46px;
    min-height:46px;
    padding:8px;
    background:#eef2f6;
    color:#344054;
    font-size:1.35rem;
    cursor:grab;
}

.drag-handle:hover{
    background:#dfe8ef;
}

.position-sort-content{
    min-width:0;
}

.position-sort-title{
    margin-bottom:4px;
    font-size:1.05rem;
    font-weight:700;
}

.position-sort-meta{
    display:flex;
    gap:7px;
    flex-wrap:wrap;
    margin-top:8px;
}

.position-sort-actions{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

.position-order-actions{
    display:flex;
    justify-content:flex-end;
    margin-top:14px;
}

@media(max-width:700px){
    .position-sort-item{
        grid-template-columns:auto minmax(0,1fr);
        align-items:start;
        padding:12px;
    }

    .position-sort-actions{
        grid-column:1 / -1;
        display:grid;
        grid-template-columns:1fr 1fr;
        width:100%;
    }

    .position-sort-actions button,
    .position-sort-actions .button{
        width:100%;
    }

    .position-order-actions button{
        width:100%;
    }
}


.preference-option{
    display:flex;
    align-items:flex-start;
    gap:10px;
    padding:12px 0;
    border-bottom:1px solid var(--border);
    cursor:pointer;
}

.preference-option input{
    width:auto;
    margin-top:3px;
}


.preference-list{display:grid;gap:12px;margin:22px 0}.preference-option{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:start;margin:0;padding:16px;border:1px solid var(--border);border-radius:10px;background:#fff;cursor:pointer;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.preference-option:hover{border-color:#9fb4c7;background:#f8fbfd}.preference-option:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(11,77,122,.14)}.preference-master{border:2px solid var(--primary);background:#f2f8fc}.preference-checkbox{display:flex;align-items:flex-start;justify-content:center;padding-top:2px}.preference-checkbox input{width:22px;height:22px;margin:0;accent-color:var(--primary);cursor:pointer}.preference-copy{display:flex;flex-direction:column;gap:4px;min-width:0}.preference-title{color:var(--text);font-size:1rem;font-weight:700;line-height:1.3}.preference-description{color:var(--muted);font-size:.92rem;line-height:1.45}@media(max-width:700px){.preference-option{grid-template-columns:28px minmax(0,1fr);gap:10px;padding:14px}.preference-checkbox input{width:24px;height:24px}.preference-title{font-size:1rem}.preference-description{font-size:.9rem}}


/* Version 3.9 - Toggle switch notification preferences */
.preference-list{
    display:grid;
    gap:14px;
    margin:24px 0;
}

.preference-option{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:18px;
    align-items:center;
    margin:0;
    padding:18px 18px;
    border:1px solid #dde3ea;
    border-radius:16px;
    background:linear-gradient(180deg,#ffffff 0%,#fbfcfe 100%);
    box-shadow:0 10px 28px rgba(15,23,42,.05);
    cursor:pointer;
    transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.preference-option:hover{
    border-color:#c7d3df;
    box-shadow:0 12px 30px rgba(15,23,42,.08);
    transform:translateY(-1px);
}

.preference-option:focus-within{
    border-color:var(--primary);
    box-shadow:0 0 0 3px rgba(11,77,122,.14), 0 12px 30px rgba(15,23,42,.08);
}

.preference-master{
    border:2px solid rgba(11,77,122,.22);
    background:linear-gradient(180deg,#f7fbff 0%,#f3f8fd 100%);
}

.preference-copy{
    display:flex;
    flex-direction:column;
    gap:6px;
    min-width:0;
}

.preference-title{
    color:var(--text);
    font-size:1.02rem;
    font-weight:800;
    line-height:1.25;
}

.preference-description{
    color:var(--muted);
    font-size:.94rem;
    line-height:1.45;
}

.preference-switch-wrap{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.preference-switch-input{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    margin:0;
    opacity:0;
    cursor:pointer;
    z-index:2;
}

.preference-switch-input:focus{
    outline:none;
}

.preference-switch{
    position:relative;
    display:flex;
    align-items:center;
    justify-content:space-between;
    width:114px;
    height:48px;
    padding:0 14px;
    border-radius:999px;
    background:#d3d9e1;
    color:#1f2937;
    box-shadow:inset 0 0 0 1px rgba(15,23,42,.06);
    overflow:hidden;
    transition:background .2s ease, box-shadow .2s ease;
}

.preference-switch-thumb{
    position:absolute;
    top:4px;
    left:4px;
    width:40px;
    height:40px;
    border-radius:999px;
    background:#ffffff;
    box-shadow:0 3px 10px rgba(15,23,42,.18);
    transition:left .2s ease, transform .2s ease;
}

.preference-switch-state{
    position:relative;
    z-index:1;
    font-size:.95rem;
    font-weight:800;
    letter-spacing:.03em;
    user-select:none;
}

.preference-switch-state-on{
    color:#ffffff;
    opacity:0;
    transition:opacity .2s ease;
}

.preference-switch-state-off{
    margin-left:auto;
    color:#243244;
    opacity:1;
    transition:opacity .2s ease;
}

.preference-switch-input:checked + .preference-switch{
    background:linear-gradient(180deg,#1672ff 0%,#0f60dc 100%);
}

.preference-switch-input:checked + .preference-switch .preference-switch-thumb{
    left:70px;
}

.preference-switch-input:checked + .preference-switch .preference-switch-state-on{
    opacity:1;
}

.preference-switch-input:checked + .preference-switch .preference-switch-state-off{
    opacity:0;
}

.preference-actions{
    display:flex;
    justify-content:center;
    margin-top:20px;
}

.preference-actions button{
    min-width:230px;
    padding:14px 22px;
    border-radius:14px;
    box-shadow:0 12px 28px rgba(11,77,122,.2);
}

@media (max-width: 700px){
    .preference-option{
        grid-template-columns:1fr;
        gap:14px;
        padding:16px;
    }

    .preference-switch-wrap{
        justify-content:flex-start;
    }

    .preference-actions{
        justify-content:stretch;
    }

    .preference-actions button{
        width:100%;
        min-width:0;
    }
}


/* Version 4.0 Active work dashboard, search, filters, archive */
.dashboard-heading,
.section-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
    margin-bottom:18px;
}

.dashboard-stat-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:14px;
    margin-bottom:20px;
}

.dashboard-stat{
    display:flex;
    flex-direction:column;
    gap:5px;
    min-height:112px;
    padding:18px;
    border:1px solid var(--border);
    border-radius:14px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    box-shadow:var(--shadow);
    transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.dashboard-stat:hover{
    transform:translateY(-2px);
    border-color:#9fb4c7;
    box-shadow:0 10px 24px rgba(15,23,42,.09);
}

.dashboard-stat-alert{
    border-color:#efb0aa;
    background:#fff8f7;
}

.dashboard-stat-value{
    font-size:2rem;
    font-weight:800;
    line-height:1;
}

.dashboard-stat-label{
    color:var(--muted);
    font-weight:700;
}

.case-card-list{
    display:grid;
    gap:11px;
}

.case-summary-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:20px;
    align-items:center;
    padding:16px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    transition:border-color .15s ease, background .15s ease, transform .15s ease;
}

.case-summary-card:hover{
    border-color:#9fb4c7;
    background:#f9fbfd;
    transform:translateY(-1px);
}

.case-summary-number{
    color:var(--primary);
    font-size:.85rem;
    font-weight:800;
    letter-spacing:.04em;
    text-transform:uppercase;
}

.case-summary-card h3{
    margin:3px 0 7px;
    font-size:1.05rem;
}

.case-summary-meta{
    display:flex;
    flex-wrap:wrap;
    gap:7px 14px;
    color:var(--muted);
    font-size:.9rem;
}

.case-summary-meta span:not(:last-child)::after{
    content:'•';
    margin-left:14px;
    color:#a6afba;
}

.case-summary-state{
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    gap:7px;
    min-width:125px;
}

.priority-critical,
.priority-urgent{
    background:#fde8e7;
    color:#9f1c13;
}

.priority-important{
    background:#fff2d6;
    color:#8a5700;
}

.case-view-tabs{
    display:flex;
    gap:7px;
    margin-bottom:16px;
    overflow-x:auto;
}

.case-view-tabs a{
    flex:0 0 auto;
    padding:10px 14px;
    border:1px solid var(--border);
    border-radius:999px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    font-weight:700;
}

.case-view-tabs a.is-active{
    border-color:var(--primary);
    background:var(--primary);
    color:#fff;
}

.case-filter-form{
    display:grid;
    gap:16px;
}

.case-search-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
}

.advanced-filters{
    border-top:1px solid var(--border);
    padding-top:14px;
}

.advanced-filters summary{
    cursor:pointer;
    font-weight:800;
    color:var(--primary);
}

.filter-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
    margin-top:14px;
}

.filter-checks{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
    margin:5px 0 14px;
}

.filter-checks label{
    display:flex;
    gap:8px;
    align-items:center;
    margin:0;
    font-weight:600;
}

.filter-checks input{
    width:auto;
}

.pagination{
    display:flex;
    justify-content:center;
    gap:7px;
    flex-wrap:wrap;
    margin-top:20px;
}

.pagination a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:42px;
    min-height:42px;
    padding:8px 12px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
    color:var(--text);
    text-decoration:none;
    font-weight:700;
}

.pagination a.is-current{
    border-color:var(--primary);
    background:var(--primary);
    color:#fff;
}

.empty-state{
    padding:30px 18px;
    text-align:center;
    color:var(--muted);
}

.closed-case-banner{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:16px;
    padding:16px;
    border:1px solid #bdc7d2;
    border-radius:12px;
    background:#eef2f6;
}

.closed-case-banner div{
    display:flex;
    flex-direction:column;
    gap:4px;
}

@media(max-width:1000px){
    .dashboard-stat-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .filter-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:700px){
    .dashboard-heading,
    .section-heading,
    .closed-case-banner{
        display:block;
    }

    .dashboard-heading .actions,
    .section-heading .button,
    .closed-case-banner form{
        margin-top:12px;
    }

    .dashboard-stat-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:9px;
    }

    .dashboard-stat{
        min-height:96px;
        padding:14px;
    }

    .dashboard-stat-value{
        font-size:1.65rem;
    }

    .case-summary-card{
        grid-template-columns:1fr;
        gap:12px;
    }

    .case-summary-state{
        align-items:flex-start;
        min-width:0;
    }

    .case-summary-meta{
        display:grid;
        gap:4px;
    }

    .case-summary-meta span::after{
        display:none;
    }

    .case-search-row,
    .filter-grid{
        grid-template-columns:1fr;
    }

    .filter-checks{
        display:grid;
        gap:10px;
    }
}


/* Version 4.1 document accountability and management */
.document-card{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:18px;
    align-items:start;
    padding:16px;
    margin-top:12px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
    box-shadow:0 2px 8px rgba(15,23,42,.04);
}
.document-name{font-size:1.05rem;font-weight:800;margin-bottom:12px;overflow-wrap:anywhere}
.document-meta-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 18px}
.document-meta-grid>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.document-meta-grid strong{font-size:.82rem;color:#667085;text-transform:uppercase;letter-spacing:.035em}
.document-meta-grid span{overflow-wrap:anywhere}
.document-actions{display:flex;flex-direction:column;gap:8px;min-width:190px}
.document-actions form{margin:0}
.document-actions .button,.document-actions button,.document-actions select,.document-actions input{width:100%}
.document-visibility-form{display:grid;gap:7px}
.document-dialog{width:min(560px,calc(100% - 28px));border:0;border-radius:14px;padding:22px;box-shadow:0 24px 70px rgba(15,23,42,.3)}
.document-dialog::backdrop{background:rgba(15,23,42,.6)}
.deleted-document-card{border-left:5px solid var(--danger);background:#fffafa}
.permanent-delete-form{display:grid;gap:8px}
@media(max-width:760px){
    .document-card{grid-template-columns:1fr;padding:14px}
    .document-meta-grid{grid-template-columns:1fr}
    .document-actions{min-width:0;width:100%}
}


.diagnostic-stat{
    display:flex;
    flex-direction:column;
    gap:5px;
    padding:15px;
    border:1px solid var(--border);
    border-radius:10px;
    background:#f8fafc;
}

.diagnostic-stat span{
    overflow-wrap:anywhere;
}

.mail-test-result{
    margin-top:18px;
    padding:14px 16px;
    border-radius:9px;
}

.mail-test-result.success{
    background:#e8f5e9;
    color:#137333;
}

.mail-test-result.error{
    background:#fdecec;
    color:#b42318;
}


.email-usage-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:18px;
}

.email-metric-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:12px;
    margin-bottom:18px;
}

.email-metric-card{
    padding:16px;
    border:1px solid var(--border);
    border-radius:11px;
    background:#fff;
    box-shadow:var(--shadow);
}

.email-metric-card span{
    display:block;
    color:var(--muted);
    font-size:.86rem;
    margin-bottom:8px;
}

.email-metric-card strong{
    font-size:1.75rem;
}

.email-metric-card.success{
    background:#eefbf2;
}

.email-metric-card.danger{
    background:#fff1f1;
}

.email-metric-card.muted{
    background:#f4f6f8;
}

.usage-line{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}

.usage-meter{
    height:16px;
    border-radius:999px;
    background:#e6ebf0;
    overflow:hidden;
}

.usage-meter span{
    display:block;
    height:100%;
    background:#17814f;
}

.usage-meter.warning span{
    background:#d97706;
}

.usage-meter.critical span{
    background:#c62828;
}

.email-settings-card summary{
    cursor:pointer;
    padding:3px 0;
}

.email-settings-form{
    margin-top:18px;
}

.email-status{
    display:inline-block;
    padding:5px 9px;
    border-radius:999px;
    font-size:.8rem;
    font-weight:800;
}

.email-status.accepted{
    background:#dcfce7;
    color:#166534;
}

.email-status.failed{
    background:#fee2e2;
    color:#991b1b;
}

.email-status.skipped{
    background:#e5e7eb;
    color:#374151;
}

.email-activity-table{
    min-width:1120px;
}

@media(max-width:1000px){
    .email-metric-grid{
        grid-template-columns:repeat(3,minmax(0,1fr));
    }
}

@media(max-width:700px){
    .email-usage-heading{
        flex-direction:column;
    }

    .email-metric-grid{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .email-metric-card strong{
        font-size:1.5rem;
    }
}

.notification-bell-link{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:36px;font-size:1.2rem}.notification-bell-count{position:absolute;top:-8px;right:-10px;min-width:20px;height:20px;padding:0 5px;border-radius:999px;background:#dc2626;color:#fff;font-size:.72rem;line-height:20px;text-align:center;font-weight:800}.notification-page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.notification-list{display:grid;gap:10px}.notification-item{margin:0}.notification-item-button{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;width:100%;padding:14px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text);text-align:left}.notification-item.unread .notification-item-button{background:#f3f8fd;border-color:#a9c7df}.notification-dot{width:10px;height:10px;border-radius:999px;background:#cbd5e1}.notification-item.unread .notification-dot{background:#0b4d7a}.notification-copy{display:flex;flex-direction:column;gap:3px}.notification-copy span,.notification-copy small{color:var(--muted)}.notification-arrow{font-size:1.7rem;color:#64748b}.notification-delivery-settings{margin:20px 0 28px;padding:18px;border:1px solid var(--border);border-radius:14px;background:#f8fafc}@media(max-width:700px){.notification-page-heading{flex-direction:column}.notification-page-heading form,.notification-page-heading button{width:100%}}


/* Version 7.6.5 — mobile viewport containment */
@media(max-width:760px){
    html,
    body{
        max-width:100% !important;
        overflow-x:hidden !important;
        overscroll-behavior-x:none;
    }

    main,
    .wrap{
        min-width:0 !important;
        max-width:100% !important;
    }
}
