:root {
    --ink:#182b32;
    --muted:#64767c;
    --teal:#176c64;
    --sidebar:#132e34;
    --canvas:#f5f7f8;
    --border:#e3e9eb;
    --portal-header-height:48px;
    --bs-primary:#176c64;
    --bs-body-font-family:"Segoe UI",Arial,sans-serif;
}

body {
    color:var(--ink);
    font-family:var(--bs-body-font-family);
    font-size:14px;
    -webkit-font-smoothing:antialiased;
}

svg {
    width:22px;
    height:22px;
    flex-shrink:0;
    fill:none;
    stroke:currentColor;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

a {
    color:var(--teal);
}

button,a,input {
    touch-action:manipulation;
}

a:focus-visible,button:focus-visible,input:focus-visible {
    outline:3px solid #59b5a7;
    outline-offset:4px;
}

.btn-primary {
    --bs-btn-bg:#176c64;
    --bs-btn-border-color:#176c64;
    --bs-btn-hover-bg:#12574f;
    --bs-btn-hover-border-color:#12574f;
    --bs-btn-active-bg:#104d46;
    --bs-btn-active-border-color:#104d46;
    padding:12px 20px;
    border-radius:8px;
    font-weight:600;
}

.eyebrow {
    display:block;
    font-size:11px;
    font-weight:700;
    letter-spacing:1.9px;
    margin-bottom:14px;
}

.brand {
    display:flex;
    align-items:center;
    gap:13px;
    text-decoration:none;
    font-size:21px;
    letter-spacing:2px;
    font-weight:750;
}

.brand small {
    display:block;
    font-size:9px;
    letter-spacing:4px;
    font-weight:500;
    margin-top:1px;
}

.brand-light {
    color:#fff;
}

.brand-light:hover {
    color:#fff;
}

.brand-mark {
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    border:1px solid #638b8b;
    border-radius:10px;
    font-size:26px;
    position:relative;
    letter-spacing:-2px;
    padding-right:2px;
}

.brand-mark>span {
    position:absolute;
    width:5px;
    height:5px;
    background:#76c6b7;
    right:-3px;
    top:6px;
    border-radius:2px;
}

.public-body {
    background:#fff;
}

.login-shell {
    display:grid;
    grid-template-columns:46% 54%;
    min-height:100vh;
    min-height:100dvh;
}

.login-intro {
    background:var(--sidebar);
    color:#fff;
    padding:54px 64px;
    display:flex;
    flex-direction:column;
    position:relative;
    overflow:hidden;
}

.login-intro:after {
    content:"";
    width:520px;
    height:520px;
    border:1px solid #ffffff08;
    border-radius:50%;
    position:absolute;
    right:-280px;
    bottom:-180px;
    box-shadow:0 0 0 65px #ffffff03,0 0 0 130px #ffffff02;
    pointer-events:none;
}

.intro-copy {
    margin:auto 0;
    max-width:480px;
    padding:85px 0;
    position:relative;
    z-index:1;
}

.intro-copy .eyebrow {
    color:#89bdb4;
    font-size:10px;
}

.intro-copy h1 {
    font-size:clamp(32px,3.2vw,48px);
    line-height:1.25;
    letter-spacing:-1.8px;
    font-weight:650;
    margin:22px 0;
}

.intro-copy h1 span {
    color:#a3c7c2;
}

.intro-copy p {
    color:#b5c8cb;
    max-width:310px;
    line-height:1.85;
    font-size:15px;
    margin-top:25px;
}

.intro-line {
    width:48px;
    height:3px;
    background:#68b6a7;
    margin-top:40px;
}

.intro-footer {
    font-size:11px;
    letter-spacing:.6px;
    color:#93afb4;
}

.login-form-region {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:60px 42px 30px;
    position:relative;
}

.login-form-wrap {
    width:100%;
    max-width:370px;
    margin:auto 0;
}

.login-symbol {
    width:48px;
    height:48px;
    border:1px solid #dce9e6;
    background:#f1f8f6;
    color:var(--teal);
    border-radius:13px;
    display:grid;
    place-items:center;
    margin-bottom:35px;
}

.login-form-wrap h2 {
    font-weight:650;
    font-size:29px;
    letter-spacing:-.8px;
    margin-bottom:13px;
}

.login-description {
    color:var(--muted);
    line-height:1.8;
    max-width:325px;
    margin-bottom:30px;
}

.form-label {
    font-size:13px;
    font-weight:600;
    margin-bottom:9px;
}

.form-control {
    border-color:#d5dfe1;
    border-radius:8px;
    padding:13px 15px;
    font-size:14px;
}

.form-control::placeholder {
    color:#849196;
}

.form-control:focus {
    border-color:#32857a;
    box-shadow:0 0 0 3px #176c6418;
}

.login-submit {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:16px;
    min-height:49px;
    margin-top:6px;
}

.login-submit svg {
    width:19px;
    height:19px;
}

.login-help {
    font-size:12px;
    line-height:1.9;
    color:var(--muted);
    margin-top:25px;
    padding-top:24px;
    border-top:1px solid var(--border);
}

.login-copyright {
    font-size:11px;
    color:var(--muted);
    margin:48px 0 0;
}

.alert {
    font-size:13px;
    border-radius:8px;
}

.portal-body {
    background:var(--canvas);
}

.portal-sidebar {
    --bs-offcanvas-width:256px;
    --bs-offcanvas-bg:var(--sidebar);
    width:256px;
    background:var(--sidebar)!important;
    color:#fff;
    display:flex;
    flex-direction:column;
    position:fixed;
    inset:0 auto 0 0;
    z-index:1045;
}

.sidebar-top {
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:31px 27px 36px;
}

.sidebar-body {
    flex:1;
    min-height:0;
    overflow-y:auto;
    padding:8px 16px;
}

.portal-nav-group > summary { cursor:pointer; list-style:none; }
.portal-nav-group > summary::-webkit-details-marker { display:none; }
.portal-nav-group > summary:focus-visible { outline:2px solid #8ac6b7; outline-offset:2px; }
.portal-nav-group.has-active > summary { color:white; background:#ffffff08; }
.portal-nav-group .nav-group-chevron { margin-left:auto; width:14px; height:14px; flex-shrink:0; transition:transform .15s ease; }
.portal-nav-group[open] .nav-group-chevron { transform:rotate(180deg); }
.portal-nav-children { margin:0 0 10px 23px; padding-left:9px; border-left:1px solid #ffffff25; }
.portal-nav-children .portal-nav-link { font-size:12px; font-weight:400; padding:11px 10px; margin:2px 0; min-height:44px; }
.portal-nav-children .portal-nav-link > svg { display:none; }
.portal-nav-children .portal-nav-link.active { font-weight:600; }
.portal-nav-link > svg, .nav-active-dot { flex-shrink:0; }

.nav-caption {
    font-size:9px;
    letter-spacing:1.8px;
    font-weight:650;
    color:#90a9af;
    margin:8px 12px 17px;
}

.portal-nav-link {
    display:flex;
    align-items:center;
    gap:13px;
    color:#bbcdd0;
    text-decoration:none;
    border-radius:8px;
    padding:13px 14px;
    margin:6px 0;
    font-size:13px;
    font-weight:550;
}

.portal-nav-link:hover {
    background:#ffffff08;
    color:white;
}

.portal-nav-link.active {
    background:#254a4e;
    color:#fff;
}

.portal-nav-link svg {
    width:19px;
    height:19px;
    color:#9ac8bf;
}

.nav-active-dot {
    margin-left:auto;
    background:#8ac6b7;
    width:5px;
    height:5px;
    border-radius:50%;
}

.sidebar-footer {
    display:flex;
    align-items:center;
    gap:9px;
    margin:24px 26px;
    padding-top:22px;
    border-top:1px solid #ffffff12;
    color:#9bb3b7;
    font-size:10px;
}

.sidebar-footer-mark {
    width:6px;
    height:6px;
    border:1px solid #86b3a9;
    border-radius:50%;
}

.portal-main {
    margin-left:256px;
    min-height:100vh;
    min-height:100dvh;
    display:flex;
    flex-direction:column;
}

.portal-header {
    height:var(--portal-header-height);
    flex-shrink:0;
    padding:0 24px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    background:#fff;
    border-bottom:1px solid var(--border);
    gap:16px;
}

.header-location {
    display:flex;
    align-items:center;
    gap:10px;
    font-size:12px;
    min-width:0;
}

.header-label {
    color:var(--muted);
}

.header-divider {
    color:#bcc8cc;
}

.user-menu {
    display:flex;
    align-items:center;
    gap:8px;
    min-height:44px;
    background:transparent;
    border:0;
    text-align:left;
    color:var(--ink);
    padding:5px;
    border-radius:8px;
}

.avatar {
    background:#e8f1ee;
    color:#246a5f;
    width:30px;
    height:30px;
    flex-shrink:0;
    border-radius:50%;
    display:grid;
    place-items:center;
    font-size:12px;
    font-weight:700;
}

.user-details strong {
    display:block;
    font-size:12px;
    font-weight:600;
    max-width:200px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.user-details small {
    display:block;
    font-size:10px;
    color:var(--muted);
    margin-top:0;
}

.user-menu .chevron {
    width:16px;
    height:16px;
    margin-left:12px;
    color:var(--muted);
}

.user-dropdown {
    min-width:220px;
    padding:7px 0;
    border:1px solid var(--border);
    box-shadow:0 12px 32px #173a3a12;
    font-size:13px;
    border-radius:10px;
}

.logout-button {
    display:flex;
    align-items:center;
    gap:9px;
    font-size:13px;
    padding:10px 16px;
}

.logout-button svg {
    width:17px;
    height:17px;
}

.portal-content {
    flex:1;
    padding:48px 40px;
    max-width:1600px;
    width:100%;
    align-self:center;
}

.page-heading .eyebrow {
    color:#597f78;
    font-size:10px;
}

.page-heading h1 {
    font-weight:650;
    font-size:30px;
    letter-spacing:-.8px;
    line-height:1.35;
    overflow-wrap:anywhere;
    margin-bottom:12px;
}

.page-heading p {
    color:var(--muted);
    font-size:14px;
    margin-bottom:33px;
}

.workspace-card {
    background:#fff;
    border:1px solid var(--border);
    border-radius:12px;
    box-shadow:0 3px 12px #213b3b02;
}

.workspace-card-header {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:15px;
    padding:23px 26px;
    border-bottom:1px solid #edf0f1;
}

.workspace-card-header h2 {
    font-size:14px;
    font-weight:650;
    margin:0;
}

.workspace-label {
    font-size:10px;
    color:var(--muted);
}

.workspace-empty {
    min-height:370px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    padding:50px 25px;
    text-align:center;
}

.workspace-illustration {
    width:90px;
    height:90px;
    display:grid;
    place-items:center;
    border-radius:24px;
    background:#f3f7f6;
    color:#66988e;
    margin-bottom:25px;
    transform:rotate(-3deg);
}

.workspace-illustration svg {
    width:57px;
    height:57px;
    transform:rotate(3deg);
}

.workspace-empty h3 {
    font-size:17px;
    font-weight:600;
    margin-bottom:12px;
}

.workspace-empty p {
    color:var(--muted);
    font-size:13px;
    margin:0;
    line-height:1.8;
}

.portal-footer {
    display:flex;
    justify-content:space-between;
    gap:15px;
    padding:20px 40px;
    color:#75868c;
    font-size:10px;
}

.icon-button {
    display:grid;
    place-items:center;
    border:1px solid var(--border);
    background:#fff;
    width:38px;
    height:38px;
    border-radius:8px;
    color:var(--ink);
}

.skip-link {
    position:fixed;
    top:-80px;
    left:16px;
    background:white;
    color:var(--ink);
    padding:12px;
    z-index:1100;
}

.skip-link:focus {
    top:12px;
}

.message-card {
    background:#fff;
    border:1px solid var(--border);
    border-radius:12px;
    padding:42px;
}

.message-card h1 {
    font-size:26px;
    font-weight:650;
    line-height:1.4;
}

.message-card p {
    color:var(--muted);
    line-height:1.8;
    margin:20px 0;
}

.error-page {
    margin:12vh auto;
    max-width:650px;
}

@media(min-width:992px) {
    .portal-sidebar.offcanvas-lg {
        position:fixed;
        display:flex!important;
    }
    .portal-sidebar .sidebar-body {
        overflow-y:auto;
    }
}

@media(max-width:1199px) {
    .login-intro {
        padding:42px 38px;
    }
    .portal-header {
        padding:0 24px;
    }
    .portal-content {
        padding:36px 28px;
    }
    .portal-footer {
        padding:20px 28px;
    }
}

@media(max-width:991.98px) {
    .portal-main {
        margin-left:0;
    }
    .portal-header {
        padding:0 24px;
    }
    .portal-sidebar {
        width:276px;
        --bs-offcanvas-width:276px;
    }
    .sidebar-top {
        padding:30px 23px;
    }
    .portal-content {
        padding:32px 24px;
    }
    .portal-footer {
        padding:20px 24px;
    }
    .login-shell {
        grid-template-columns:40% 60%;
    }
    .login-intro {
        padding:35px 25px;
    }
    .intro-copy h1 {
        font-size:32px;
        letter-spacing:-1px;
    }
    .intro-copy p {
        font-size:13px;
    }
    .login-form-region {
        padding:45px 35px 25px;
    }
    .brand {
        font-size:19px;
    }
    .header-location {
        gap:12px;
    }
}

@media(max-width:767.98px) {
    .login-shell {
        display:flex;
        flex-direction:column;
    }
    .login-intro {
        padding:23px 26px;
    }
    .intro-copy,.intro-footer {
        display:none;
    }
    .login-intro:after {
        display:none;
    }
    .login-form-region {
        flex:1;
        padding:36px 26px 22px;
    }
    .login-form-wrap {
        max-width:390px;
    }
    .login-symbol {
        margin-bottom:25px;
    }
    .login-form-wrap h2 {
        font-size:27px;
    }
    .login-copyright {
        margin-top:25px;
    }
    .page-heading h1 {
        font-size:25px;
    }
    .user-details {
        display:none;
    }
    .user-menu {
        gap:3px;
    }
    .user-menu .chevron {
        margin-left:3px;
    }
    .portal-header {
        padding:0 18px;
    }
    .portal-content {
        padding:30px 18px;
    }
    .workspace-card-header {
        padding:20px;
    }
    .workspace-empty {
        min-height:330px;
        padding:40px 20px;
    }
    .portal-footer {
        padding:18px;
    }
    .message-card {
        padding:25px;
    }
    .message-card h1 {
        font-size:23px;
    }
    .error-page {
        margin:40px 18px;
    }
    .workspace-label {
        display:none;
    }
}

@media(prefers-reduced-motion:reduce) {
    *,*:before,*:after {
        scroll-behavior:auto!important;
        transition:none!important;
        animation:none!important;
    }
}

.duty-page-heading {
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
}

.duty-refresh {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:9px;
    flex-shrink:0;
    border:1px solid var(--border);
    background:#fff;
    color:var(--ink);
    border-radius:8px;
    font-size:12px;
    padding:10px 15px;
    margin-top:24px;
}

.duty-refresh:hover {
    border-color:#adc8c1;
    color:var(--teal);
    background:#f0f7f5;
}

.duty-refresh svg {
    width:16px;
    height:16px;
}

.duty-days {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:20px;
    align-items:start;
}

.duty-day {
    background:#fff;
    border:1px solid var(--border);
    border-radius:12px;
    overflow:hidden;
}

.duty-day-today {
    border-color:#82b5a8;
    box-shadow:0 3px 16px #176c6408;
}

.duty-day-heading {
    padding:23px 20px;
    border-bottom:1px solid var(--border);
    background:#fafbfc;
}

.duty-day-today .duty-day-heading {
    background:#eef6f3;
    border-color:#dceae5;
}

.duty-day-title {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:10px;
}

.duty-day-title h2 {
    font-size:17px;
    font-weight:650;
    margin:0;
}

.duty-day-today .duty-day-title h2 {
    color:var(--teal);
}

.duty-count {
    color:var(--muted);
    background:#edf0f2;
    padding:4px 9px;
    border-radius:20px;
    font-size:10px;
    white-space:nowrap;
}

.duty-day-today .duty-count {
    background:#d9ebe3;
    color:#2b6a5b;
}

.duty-day-heading time {
    display:block;
    color:var(--muted);
    font-size:11px;
    line-height:1.7;
}

.duty-day-body {
    padding:15px;
    display:grid;
    gap:14px;
}

.duty-staff-card {
    border:1px solid #e8edef;
    padding:17px;
    border-radius:9px;
    background:#fff;
    min-width:0;
}

.duty-staff-tags {
    display:flex;
    align-items:center;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:8px;
    margin-bottom:22px;
}

.duty-facility {
    display:inline-flex;
    align-items:center;
    gap:5px;
    font-size:10px;
    color:#547077;
}

.duty-facility svg {
    width:13px;
    height:13px;
}

.duty-shift {
    padding:4px 8px;
    border-radius:5px;
    background:#fff5e5;
    color:#8a651c;
    font-size:9px;
    font-weight:650;
}

.duty-shift-night {
    background:#edf0f7;
    color:#576782;
}

.duty-staff-identity {
    display:flex;
    align-items:center;
    gap:11px;
    margin-bottom:19px;
}

.duty-avatar {
    flex-shrink:0;
    width:36px;
    height:36px;
    display:grid;
    place-items:center;
    background:#f0f5f4;
    border-radius:10px;
    color:#48756d;
    font-size:11px;
    font-weight:650;
}

.duty-staff-identity h3 {
    font-size:13px;
    font-weight:650;
    line-height:1.65;
    margin:0;
    overflow-wrap:anywhere;
}

.duty-phone {
    display:flex;
    align-items:center;
    gap:8px;
    color:var(--muted);
    font-size:12px;
    text-decoration:none;
    margin:0 0 19px;
    overflow-wrap:anywhere;
}

.duty-phone:hover {
    color:var(--teal);
}

.duty-phone svg {
    width:14px;
    height:14px;
}

.duty-contact-actions {
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    border-top:1px solid #edf0f1;
    padding-top:15px;
}

.duty-contact-actions .btn {
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    padding:9px 7px;
    border-radius:6px;
    font-size:11px;
    white-space:nowrap;
}

.duty-contact-actions svg {
    width:14px;
    height:14px;
}

.duty-call {
    color:#fff;
    background:var(--teal);
    border-color:var(--teal);
}

.duty-call:hover {
    color:#fff;
    background:#12574f;
    border-color:#12574f;
}

.duty-whatsapp {
    color:#3d6e5c;
    background:#f0f6f2;
    border-color:#d8e7dd;
}

.duty-whatsapp:hover {
    color:#255641;
    background:#e4f0e9;
    border-color:#bcd6c8;
}

.duty-empty {
    min-height:250px;
    padding:32px 10px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
}

.duty-empty-icon {
    display:grid;
    place-items:center;
    width:44px;
    height:44px;
    background:#f2f5f6;
    color:#94a7ac;
    border-radius:12px;
    margin-bottom:20px;
}

.duty-empty-icon svg {
    width:20px;
    height:20px;
}

.duty-empty h3 {
    font-size:12px;
    font-weight:600;
    line-height:1.8;
    margin-bottom:8px;
}

.duty-empty p {
    font-size:11px;
    line-height:1.8;
    color:var(--muted);
    margin:0;
}

@media(max-width:1199.98px) {
    .duty-days {
        grid-template-columns:1fr;
    }
    .duty-day-body {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
    .duty-empty {
        grid-column:1/-1;
        min-height:180px;
    }
}

@media(max-width:767.98px) {
    .duty-page-heading {
        flex-direction:column;
        gap:0;
        margin-bottom:25px;
    }
    .duty-page-heading p {
        margin-bottom:17px;
        font-size:13px;
        line-height:1.8;
    }
    .duty-refresh {
        margin-top:0;
    }
    .duty-day-body {
        grid-template-columns:1fr;
    }
}

/* User identity stays central; Portal only presents access and team choices. */
.access-columns { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.5fr); gap: 24px; align-items: start; }
.access-panel { background: white; border: 1px solid #dee7e6; border-radius: 16px; padding: 24px; min-width: 0; }
.access-panel h2 { font-size: 1.3rem; }
.access-user-list { max-height: 620px; overflow-y: auto; }
.access-user { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 8px; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.access-user span, .access-user small { color: #61747c; font-size: .85rem; }
.access-user:hover, .access-user-selected { background: #e9f5f2; color: #176b64; }
@media (max-width: 767px) { .access-columns { grid-template-columns: 1fr; } .access-user-list { max-height: 280px; } .access-panel { padding: 18px; } }
.access-page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.access-teams-toggle { margin-top: 24px; }
.access-team-management { margin-bottom: 24px; }
.access-team-management .table-responsive { position: relative; }
.access-team-table { font-size: .9rem; margin-bottom: 0; min-width: 640px; }
.access-team-table td:nth-child(2) { max-width: 360px; overflow-wrap: anywhere; }
.access-team-table th, .access-team-table td { padding: 12px 8px; }
@media (max-width: 767px) { .access-teams-toggle { margin-top: 0; } .access-page-heading { margin-bottom: 24px; } }
