:root {
    --app-bg-start: #172033;
    --app-bg-mid: #0d2a5c;
    --app-bg-end: #174ea6;
    --app-surface: #ffffff;
    --app-surface-soft: #eef4ff;
    --app-surface-strong: #dbe7fb;
    --app-border: #cbd8eb;
    --app-border-soft: #d9e2ef;
    --app-text: #172033;
    --app-muted: #475569;
    --app-primary: #1d5fbf;
    --app-primary-dark: #174ea6;
    --app-primary-deep: #0d3f88;
    --app-primary-navy: #0d2a5c;
    --app-row-alt: #e6f0ff;
    --app-row-hover: #d8e8ff;
    --app-shell-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
    --bs-primary: #174ea6;
    --bs-primary-rgb: 23, 78, 166;
    --bs-link-color: #174ea6;
    --bs-link-hover-color: #0d2a5c;
}

.bg-primary {
    background:
        linear-gradient(135deg, #0d3f88 0%, #174ea6 52%, #2f72d0 100%) !important;
}

.text-bg-primary {
    background-color: #174ea6 !important;
}

.btn-primary {
    --bs-btn-bg: #174ea6;
    --bs-btn-border-color: #174ea6;
    --bs-btn-hover-bg: #0d3f88;
    --bs-btn-hover-border-color: #0d3f88;
    --bs-btn-active-bg: #0d2a5c;
    --bs-btn-active-border-color: #0d2a5c;
    --bs-btn-disabled-bg: #52627a;
    --bs-btn-disabled-border-color: #52627a;
    background: linear-gradient(135deg, #0d3f88 0%, #174ea6 55%, #2f72d0 100%) !important;
    border-color: #174ea6 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(23, 78, 166, 0.18);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(135deg, #0d3676 0%, #0d3f88 55%, #174ea6 100%) !important;
    border-color: #0d3f88 !important;
    color: #ffffff !important;
    box-shadow: 0 10px 22px rgba(13, 63, 136, 0.24);
}

.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, #0d2a5c 0%, #0d3f88 100%) !important;
    border-color: #0d2a5c !important;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(37, 99, 235, 0.18), transparent 34rem),
        radial-gradient(circle at 88% 18%, rgba(79, 70, 229, 0.1), transparent 26rem),
        linear-gradient(135deg, #d8e8ff 0%, #eef4ff 46%, #cbdff8 100%);
    overflow: hidden;
}

.site-wrapper {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header-bar {
    width: 100%;
    background:
        linear-gradient(135deg, rgba(13, 42, 92, 0.98), rgba(23, 78, 166, 0.96)),
        linear-gradient(180deg, var(--app-primary-deep), var(--app-primary-dark));
    color: #f8fbff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.5rem 0;
    flex: 0 0 auto;
    z-index: 90;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 2rem;
    padding-right: 2rem;
    gap: 1rem;
    min-width: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    min-width: 0;
}

.notification-wrap {
    position: relative;
    flex: 0 0 auto;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    cursor: pointer;
    box-shadow: none;
    flex: 0 0 auto;
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.notification-bell i {
    font-size: 1.28rem;
}

.notification-bell:hover,
.notification-bell:focus-visible {
    background: transparent;
    box-shadow: none;
    transform: translateY(-1px);
    outline: none;
}

.notification-count {
    position: absolute;
    top: 2px;
    right: 4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    line-height: 19px;
    text-align: center;
    font-weight: 800;
    box-shadow: 0 0 0 2px rgba(13, 42, 92, 0.98);
}

.notification-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(360px, calc(100vw - 24px));
    background: #fff;
    color: #25324d;
    border: 1px solid #dfe5ef;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(20, 31, 55, 0.18);
    z-index: 1090;
    display: none;
    overflow: hidden;
    max-width: calc(100vw - 24px);
}

.notification-panel.open {
    display: block;
}

.notification-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f5;
    gap: 0.75rem;
}

.notification-panel-header button {
    border: 1px solid #d7dde8;
    border-radius: 999px;
    background: #fff;
    color: #0d6efd;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.26rem 0.62rem;
    white-space: nowrap;
}

.notification-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid #edf0f5;
    background: #f8fafc;
}

.notification-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.notification-tab:hover,
.notification-tab:focus-visible {
    background: #eef4ff;
    border-color: #b9c6da;
    color: #172033;
    outline: none;
}

.notification-tab.active {
    background: linear-gradient(180deg, #ffffff 0%, #e7edf6 100%);
    border-color: #aebbd0;
    color: #172033;
    box-shadow: inset 0 -2px 0 #2563eb;
}

.notification-tab span {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    line-height: 18px;
    text-align: center;
    font-weight: 800;
}

.notification-tab span:empty {
    display: none;
}

.notification-tab span[hidden] {
    display: none !important;
}

.notification-list {
    max-height: 320px;
    overflow-y: auto;
}

.notification-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 7px;
    padding: 12px 14px;
    color: #25324d;
    border-bottom: 1px solid #f0f2f6;
}

.notification-item:hover {
    background: #f3f6fa;
}

.notification-item.unread {
    background: #f3f7ff;
}

.notification-main {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.notification-title {
    font-weight: 700;
    line-height: 1.25;
}

.notification-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.notification-title-row .notification-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-message,
.notification-time,
.notification-empty {
    color: #6c757d;
    font-size: 0.84rem;
}

.notification-line {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    flex-direction: column;
}

.notification-message {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.notification-time {
    flex: 0 0 auto;
    white-space: nowrap;
}

.notification-empty {
    padding: 16px;
    text-align: center;
}

.notification-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid #d7dde8;
    border-radius: 999px;
    padding: 2px 6px;
    color: #0d6efd;
    background: #fff;
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    height: 28px;
    box-sizing: border-box;
}

.notification-action:hover {
    background: #dceafe;
}

.notification-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    flex-wrap: nowrap;
    flex: 0 0 auto;
}

.notification-read-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 1px solid #d7dde8;
    border-radius: 999px;
    background: #fff;
    color: #0d6efd;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 6px;
    white-space: nowrap;
    height: 28px;
    box-sizing: border-box;
}

.notification-read-toggle:hover {
    background: #dceafe;
}

.notification-action,
.notification-read-toggle {
    width: 34px;
    min-width: 34px;
}

.notification-action span,
.notification-read-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
    padding: 0.38rem 0.78rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.08) 55%, rgba(0, 0, 0, 0.03) 100%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.24),
        0 3px 8px rgba(8, 43, 98, 0.11),
        0 1px 2px rgba(10, 37, 77, 0.1);
    backdrop-filter: blur(1px);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.header-home-link:hover .header-brand-mark,
.header-home-link:focus .header-brand-mark {
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.26),
        0 4px 10px rgba(8, 43, 98, 0.13),
        0 1px 2px rgba(10, 37, 77, 0.11);
    filter: brightness(1.03);
}

.header-brand-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.header-brand-text {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, "Times New Roman", serif;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.header-logo {
    height: 40px;
    margin-right: 1rem;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 0;
}

.header-user-info {
    min-width: 150px;
    text-align: right;
    color: #fff;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
    padding: 0.4rem 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    height: 58px;
    box-sizing: border-box;
    flex: 0 1 190px;
}

.header-welcome-line {
    display: flex;
    align-items: baseline;
    gap: 4px;
    max-width: 100%;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
}

.header-welcome-line strong {
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
}

.header-user-info .logout-btn {
    font-size: 0.76rem;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0.08rem 0;
    border-radius: 0;
    font-weight: 800;
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
    transition: color 0.2s ease, transform 0.2s ease;
}

.header-user-info .logout-btn:hover {
    transform: translateY(-1px);
}

.header-user-info .logout-muted {
    color: rgba(255,255,255,0.66);
}

.header-user-info .logout-danger {
    color: rgba(255,255,255,0.84);
}

.header-user-info .logout-btn:hover .logout-danger {
    color: #facc15;
}

.staff-view-header {
    float: right;
    position: relative;
    top: -1.05rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-width: min(100%, 720px);
    max-width: min(100%, 980px);
    margin: 0 0 0 1rem;
    padding: 0.68rem 0.78rem;
    border: 1px solid #b9d3fb;
    border-radius: 10px;
    background: #ffffff;
    color: var(--app-text);
    box-shadow:
        0 10px 24px rgba(23, 78, 166, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.staff-view-header-copy {
    display: flex;
    flex-direction: column;
    gap: 0.08rem;
    min-width: 150px;
    flex: 1 1 180px;
}

.staff-view-header-copy strong,
.staff-view-header-copy span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-view-header-copy strong {
    color: var(--app-text);
    font-size: 0.92rem;
    font-weight: 850;
    line-height: 1.2;
}

.staff-view-header-copy span {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.staff-view-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
}

.staff-view-user-switch {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 300px;
    flex: 0 0 360px;
    margin: 0;
    padding: 0.38rem 0.45rem;
    border: 1px solid #d6e6ff;
    border-radius: 8px;
    background: #f8fbff;
}

.staff-view-user-switch label {
    color: var(--app-muted);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.staff-view-user-switch select {
    width: 190px;
    min-width: 190px;
    max-width: 190px;
    height: 32px;
    border: 1px solid #b7c7dc;
    border-radius: 7px;
    background: #ffffff;
    color: var(--app-text);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0 0.45rem;
}

.staff-view-user-switch button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    min-height: 32px;
    border: 1px solid #b7c7dc;
    border-radius: 7px;
    background: #ffffff;
    color: #174ea6;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
    padding: 0 0.58rem;
}

.staff-view-user-switch button:hover,
.staff-view-user-switch button:focus {
    border-color: #174ea6;
    background: #e7f0ff;
    color: #0d2a5c;
}

.staff-view-header-actions form {
    margin: 0;
}

.staff-view-header-actions a,
.staff-view-header-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-height: 36px;
    min-width: 96px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 800;
    line-height: 1;
    padding: 0 0.82rem;
    text-decoration: none;
    white-space: nowrap;
    box-sizing: border-box;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.staff-view-stop {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: #b91c1c !important;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(185, 28, 28, 0.16);
}

.staff-view-stop:hover,
.staff-view-stop:focus {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    border-color: #991b1b !important;
    color: #ffffff;
    transform: translateY(-1px);
}

@media (max-width: 1320px) {
    .staff-view-header {
        float: none;
        top: 0;
        width: 100%;
        max-width: none;
        margin: 0 0 1rem 0;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .staff-view-header-copy {
        flex: 1 1 160px;
    }

    .staff-view-header-actions {
        flex-wrap: nowrap;
    }

    .staff-view-user-switch {
        flex: 0 0 340px;
        justify-content: flex-start;
    }

    .staff-view-user-switch select {
        width: 170px;
        min-width: 170px;
        max-width: 170px;
    }
}

@media (max-width: 900px) {
    .staff-view-header {
        flex-wrap: wrap;
    }

    .staff-view-user-switch {
        flex: 1 1 100%;
    }
}

@media (max-width: 560px) {
    .staff-view-header-actions,
    .staff-view-header-actions form,
    .staff-view-header-actions a,
    .staff-view-header-actions button,
    .staff-view-user-switch,
    .staff-view-user-switch button {
        width: 100%;
    }

    .staff-view-user-switch {
        align-items: stretch;
        flex-direction: column;
    }

    .staff-view-user-switch select {
        width: 100%;
    }
}

.company-header-logo {
    display: block;
    flex: 0 0 auto;
    align-self: center;
    vertical-align: middle;
    height: 52px;
    width: auto;
    margin: 0 0.55rem;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    object-fit: contain;
    max-width: 173px;
    padding: 0;
    transform: none;
    transform-origin: center;
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.34)) drop-shadow(0 5px 12px rgba(8,20,39,0.22));
    transition: filter 0.2s ease;
}

.company-header-logo.needs-light-bg,
.company-header-logo.logo-on-light-card {
    height: 50px;
    max-width: 178px;
    padding: 5px 8px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(8, 20, 39, 0.16);
    filter: none;
}

.app-header-logo {
    display: block;
    flex: 0 0 auto;
    align-self: center;
    width: 40px;
    height: 40px;
    margin: 0 0.55rem;
    border-radius: 8px;
    box-shadow: 0 5px 14px rgba(8, 20, 39, 0.2);
}

@media (max-width: 860px) {
    .header-bar {
        padding: 0.45rem 0;
    }

    .header-container {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
        gap: 0.65rem;
    }

    .header-actions {
        gap: 0.65rem;
    }

    .header-brand-mark {
        padding: 0.34rem 0.52rem;
        gap: 0.38rem;
    }

    .header-brand-text {
        max-width: 38vw;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.92rem;
        letter-spacing: 0.03em;
    }

    .header-user-info {
        display: none;
    }

    .company-header-logo {
        height: 40px;
        max-width: 96px;
        margin: 0 0.15rem;
        border-radius: 0;
        padding: 0;
    }

    .app-header-logo {
        width: 36px;
        height: 36px;
        margin: 0 0.15rem;
    }

    .company-header-logo.needs-light-bg,
    .company-header-logo.logo-on-light-card {
        height: 38px;
        max-width: 106px;
        padding: 4px 6px;
        border-radius: 6px;
    }

    .notification-bell {
        width: 38px;
        height: 38px;
    }

    .notification-panel {
        position: fixed;
        top: calc(env(safe-area-inset-top, 0px) + 62px);
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-width: none;
        max-height: min(520px, calc(100dvh - 78px));
        border-radius: 8px;
    }

    .notification-list {
        max-height: calc(min(520px, 100dvh - 78px) - 50px);
    }
}

@media (max-width: 520px) {
    .header-container {
        padding-left: 0.65rem;
        padding-right: 0.65rem;
        gap: 0.5rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .header-brand-text {
        max-width: 32vw;
        font-size: 0.82rem;
    }

    .header-brand-icon {
        font-size: 1.02rem;
    }

    .company-header-logo {
        height: 34px;
        max-width: 68px;
    }

    .app-header-logo {
        width: 32px;
        height: 32px;
    }

    .company-header-logo.needs-light-bg,
    .company-header-logo.logo-on-light-card {
        height: 34px;
        max-width: 82px;
        padding: 3px 5px;
    }

    .notification-panel {
        top: calc(env(safe-area-inset-top, 0px) + 58px);
        left: 0.5rem;
        right: 0.5rem;
        max-height: calc(100dvh - 66px);
    }

    .notification-list {
        max-height: calc(100dvh - 118px);
    }

    .notification-panel-header {
        padding: 10px 12px;
    }

    .notification-item {
        padding: 11px 12px;
    }

    .notification-title-row {
        gap: 6px;
    }

    .notification-title-row .notification-title,
    .notification-message {
        white-space: normal;
        overflow-wrap: anywhere;
        text-overflow: clip;
    }

    .notification-actions {
        gap: 5px;
    }

    .notification-action,
    .notification-read-toggle {
        width: 36px;
        min-width: 36px;
        height: 32px;
        padding: 0;
    }
}

@media (max-width: 380px) {
    .header-brand-text {
        display: none;
    }

    .company-header-logo {
        max-width: 54px;
    }

    .app-header-logo {
        width: 30px;
        height: 30px;
    }

    .company-header-logo.needs-light-bg,
    .company-header-logo.logo-on-light-card {
        max-width: 66px;
    }
}

.company-header-logo:hover {
    filter: drop-shadow(0 1px 1px rgba(255,255,255,0.38)) drop-shadow(0 7px 14px rgba(8,20,39,0.26)) brightness(1.02);
}

.company-header-logo.needs-light-bg:hover,
.company-header-logo.logo-on-light-card:hover {
    filter: none;
    box-shadow: 0 5px 14px rgba(8, 20, 39, 0.2);
}

.logout-wrap {
    font-size: 0.95em;
    margin-top: 2px;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 105;
    position: relative;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 4px;
    background-color: #fff;
    border-radius: 2px;
    transition: background-color 0.3s, transform 0.3s;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s;
}
.menu-overlay.open {
    display: block;
    opacity: 1;
}

.staff-view-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 2rem;
    background: #fff7ed;
    border-bottom: 1px solid #fed7aa;
    color: #7c2d12;
    font-size: 0.92rem;
}

.staff-view-banner strong,
.staff-view-banner span {
    display: block;
}

.staff-view-banner span {
    color: #9a3412;
    font-size: 0.82rem;
}

.staff-view-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.staff-view-actions a,
.staff-view-actions button {
    border: 0;
    background: transparent;
    color: #9a3412;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.staff-empty-state {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    max-width: 760px;
    margin: 2rem auto;
    padding: 1.25rem;
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.staff-empty-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef4ff;
    color: #1f3f77;
    font-size: 1.35rem;
}

.staff-empty-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}

@media (max-width: 640px) {
    .staff-empty-state {
        flex-direction: column;
        margin: 1rem 0;
    }
}

.django-message-strip {
    position: fixed;
    top: 5.4rem;
    right: 1.25rem;
    z-index: 1070;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.django-message {
    border: 1px solid #d9e2ef;
    border-radius: 8px;
    background: #f3f6fa;
    color: #1f2937;
    padding: 0.72rem 0.88rem;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
    pointer-events: auto;
    animation: toast-slide-in 0.22s ease-out both;
}

.django-message.is-dismissing {
    animation: toast-slide-out 0.24s ease-in forwards;
}

.django-message-success {
    border-color: #b7e4c7;
    background: #f0fdf4;
    color: #166534;
}

.django-message-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.django-message-warning {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

@keyframes toast-slide-in {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-slide-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(18px);
    }
}

.menu-section-title {
    margin: 0.9rem 0 0.25rem;
    padding: 0.35rem 0.5rem;
    color: #8fa4c2;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.menu-context-hint {
    padding: 0.35rem 0.5rem 0.75rem;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.35;
}

.menu-context-hint span {
    display: block;
    border: 1px solid rgba(219, 231, 251, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.65rem 0.7rem;
}

.side-menu {
    --sidebar-x-padding: 1.5rem;
    --sidebar-logout-bottom: 3rem;
    --sidebar-logout-width: 170px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    right: -500px;
    width: 250px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    background:
        linear-gradient(180deg, rgba(13, 42, 92, 0.98), rgba(23, 32, 51, 0.98)),
        #172033;
    color: #eff6ff;
    box-shadow: -18px 0 44px rgba(15, 23, 42, 0.24);
    z-index: 103;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem var(--sidebar-x-padding) 1.5rem var(--sidebar-x-padding);
    overflow-x: hidden;
    overflow-y: hidden;
    transition: right 0.35s cubic-bezier(.77,0,.18,1);
}

#company-alerts {
    pointer-events: none;
}

#company-alerts > * {
    pointer-events: auto;
}

.card,
.card-body {
    border: 1px solid var(--app-border);
    border-radius: 12px;
    background: var(--app-surface);
    box-shadow:
        0 10px 28px rgba(15, 23, 42, 0.08),
        inset 0 0 0 1px rgba(37, 99, 235, 0.04);
}

.card-body {
    padding: 1.25rem;
    color: var(--app-muted);
    text-align: left;
}

.card table {
    width: 100%;
    border-collapse: collapse;
    background: inherit;
    border: 1px solid var(--app-border);
    border-radius: 8px;
    overflow: hidden;
}

.card table th,
.card table td {
    border-color: var(--app-border-soft);
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    color: var(--app-text);
}

.card table thead th {
    background: linear-gradient(180deg, #f8fafc 0%, #e7edf6 100%);
    font-weight: 600;
    color: var(--app-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.side-menu.open {
    right: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #ffffff;
    align-self: flex-end;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover {
    color: #d32f2f;
}

.main-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.25rem;
    padding-bottom: 0;
    scrollbar-gutter: stable;
}
.main-menu li {
    margin-bottom: 1.1rem;
    width: 100%;
}
.main-menu li:last-child {
    margin-bottom: 0;
}
.main-menu a,
.main-menu .logout-btn {
    background: none;
    border: none;
    color: #e6efff;
    font-size: 1.1rem;
    font-weight: 500;
    font-family: inherit;
    padding: 0.3em 1em;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, transform 0.2s, border-color 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
}
.main-menu a:hover,
.main-menu .logout-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    text-decoration: none;
    transform: translateX(2px);
}
.main-menu a.active {
    color: #fff !important;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.08) 100%),
        linear-gradient(90deg, #0d2a5c 0%, #174ea6 100%);
    border: 1px solid rgba(219, 231, 251, 0.22);
    border-radius: 6px;
    padding: 0.3em 1em;
    text-decoration: none;
    box-shadow:
        inset 3px 0 0 #93c5fd,
        0 8px 20px rgba(15, 23, 42, 0.22);
    font-weight: 600;
}
.main-menu .menu-logout {
    position: static;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    margin-top: auto;
    margin-bottom: 0;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background: transparent;
}
.main-menu .menu-logout form {
    display: flex;
    justify-content: center;
    width: 100%;
}
.main-menu .menu-logout .logout-btn {
    display: inline-flex;
    color: #ffffff;
    background: linear-gradient(90deg, #dc2626 0%, #b91c1c 100%);
    border: 1px solid rgba(254, 202, 202, 0.55);
    box-shadow: 0 10px 24px rgba(185, 28, 28, 0.28);
    align-items: center;
    justify-content: center;
    text-align: center;
    width: min(100%, var(--sidebar-logout-width));
    min-width: 0;
    margin: 0 auto;
}
.main-menu .menu-logout .logout-btn:hover {
    color: #ffffff;
    background: linear-gradient(90deg, #b91c1c 0%, #991b1b 100%);
    border-color: rgba(254, 202, 202, 0.78);
    box-shadow: 0 12px 26px rgba(185, 28, 28, 0.34);
    transform: translateY(-1px);
}
.menu-icon {
    display: inline-flex;
    width: 1em;
    height: 1em;
    align-items: center;
    justify-content: center;
    flex: 0 0 1em;
}
.menu-icon svg {
    width: 1em;
    height: 1em;
    display: block;
}
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 22, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1200;
    padding: 1.5rem;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background: #fff;
    border-radius: 16px;
    max-width: 420px;
    width: 100%;
    padding: 1.5rem 1.5rem 1.25rem 1.5rem;
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(37, 99, 235, 0.08);
}
.modal-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}
.modal-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff1f0;
    color: #b42318;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.modal-card h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #101828;
}
.modal-card p {
    margin: 0 0 1.25rem 0;
    color: #475467;
    line-height: 1.45;
}
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.modal-btn {
    border: none;
    border-radius: 10px;
    padding: 0.65rem 1.1rem;
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.modal-btn.secondary {
    background: #f2f4f7;
    color: #344054;
}
.modal-btn.secondary:hover {
    background: #e4e7ec;
}
.modal-btn.danger {
    background: linear-gradient(90deg, #d92d20 0%, #b42318 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(217, 45, 32, 0.25);
}
.modal-btn.danger:hover {
    transform: translateY(-1px);
}

main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 3vh, 2.5rem) clamp(1rem, 3vw, 3rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    background:
        radial-gradient(circle at 8% 6%, rgba(37, 99, 235, 0.16), transparent 32rem),
        radial-gradient(circle at 92% 10%, rgba(79, 70, 229, 0.09), transparent 28rem),
        linear-gradient(135deg, #d8e8ff 0%, #eef4ff 48%, #cbdff8 100%);
}

main:has(.login-outer),
main:has(.password-reset-container) {
    padding: 0;
}

.footer-bar {
    width: 100%;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    min-height: 34px;
    height: 34px;
    padding: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background:
        linear-gradient(135deg, rgba(23, 32, 51, 0.98), rgba(13, 42, 92, 0.94)),
        #172033;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 90;
}
.footer-bar a {
    color: #ffffff;
}
.footer-bar a:hover {
    color: #e6f0ff;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.footer-container::before {
    content: none;
}
.footer-container p {
    margin: 0;
}


/*
    The logo and "InfoCloud" are clickable as a single link.
    The underline appears only on hover or focus.
    No inline styles are used.
*/
.header-home-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.header-home-link:hover,
.header-home-link:focus {
    text-decoration: none;
    color: inherit;
}

.main-content {
    flex: 1 0 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    box-sizing: border-box;
    padding: 2.5rem 2rem;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 14px;
    box-shadow: var(--app-shell-shadow);
    transition: box-shadow 0.2s;
}
.page-instructions {
    background: var(--app-surface-soft);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}
.tz-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-content h1 {
    color: var(--app-text);
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: 1.5px;
    text-shadow:
        0 2px 8px rgba(38,99,235,0.10),
        0 1px 2px rgba(38,99,235,0.08);
    background: none;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    background-clip: border-box;
    filter: none;
    padding-bottom: 0.3em;
    border-bottom: 2.5px solid rgba(23, 78, 166, 0.24);
    border-radius: 2px;
    display: inline-block;
    transition: text-shadow 0.2s, filter 0.2s;
}

/* Global table zebra (blue/white) */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--app-row-alt) !important;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: #ffffff !important;
}
.table-hover > tbody > tr:hover > * {
    background-color: var(--app-row-hover) !important;
}
