@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap");

html {
    background-color: #0f0f0f;
}

html.dark {
    background-color: #0f0f0f;
    color: #ffffff;
}

html.light {
    background-color: #ffffff;
    color: #000000;
}

:root {
    --brand-primary: #00677c;
    --brand-blue: #163458;
    --brand-sky: #f7f9fb;
    --brand-white: #ffffff;
    --brand-text: #0d2c4a;
    --brand-muted: #5b7c99;
    --brand-border: #e4e9f0;
    --chart-radius: 14px;
}

body {
    background: var(--brand-sky) !important;
    background-image: none !important;
    color: var(--brand-text) !important;
}


body.manager-page {
    --brand-primary: #003366;
    --brand-blue: #163458;
    --brand-text: #0d2238;
    --primary-color: #003366;
    --accent-color: #163458;
    --primary-brown: #003366;
    --light-brown: #163458;
    --dark-brown: #001e3f;
    --shadow-sm: 0 2px 8px rgba(0, 51, 102, 0.14);
    --shadow-md: 0 4px 16px rgba(0, 30, 63, 0.20);
    --shadow-lg: 0 8px 32px rgba(0, 30, 63, 0.24);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

body.manager-page h1,
body.manager-page h2,
body.manager-page h3,
body.manager-page .section-title,
body.manager-page .logo-text h1,
body.manager-page .topbar__title {
    font-family: "Manrope", "Inter", sans-serif;
}

/*
 * Interactive controls:
 * - remove mobile tap highlight/system blue flash
 * - keep accessible keyboard focus via :focus-visible
 * - do not affect regular text selection or text inputs
 */
a[href],
button,
[role="button"],
summary,
input[type="button"],
input[type="submit"],
input[type="reset"],
input[type="file"]::file-selector-button {
    -webkit-tap-highlight-color: transparent;
}

a[href]:focus,
button:focus,
[role="button"]:focus,
summary:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="reset"]:focus,
input[type="file"]::file-selector-button:focus {
    outline: none;
}

a[href]:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
summary:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
input[type="file"]::file-selector-button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--brand-primary) 75%, white);
    outline-offset: 2px;
    border-radius: 8px;
}

.card, .dashboard-section, .kpi-card, .chart-card, .panel, .modal-content, .main-nav, .table-container {
    border-radius: 18px !important;
}

canvas { border-radius: var(--chart-radius) !important; }

.logo-text h1 span,
.brand-accent { color: var(--brand-primary) !important; }


html.dark {
    --brand-white: #151a1f;
    --brand-sky: #1d2630;
    --brand-text: #ffffff;
    --brand-muted: #ffffff;
    --brand-border: #2a3a48;
    --brand-blue: #163458;
    --primary-color: #003366;
    --accent-color: #163458;
    --dark-color: #001e3f;
    --primary-brown: #003366;
    --dark-brown: #001e3f;
    --gray-100: #ffffff;
    --gray-200: #ffffff;
    --gray-300: #ffffff;
    --gray-400: #ffffff;
    --gray-500: #ffffff;
    --gray-600: #ffffff;
    --gray-700: #ffffff;
    --gray-800: #ffffff;
    --gray-900: #ffffff;
}

html.dark body,
html.dark .container,
html.dark .dashboard-section,
html.dark .card,
html.dark .main-nav,
html.dark .modal-content,
html.dark .table-container,
html.dark .kpi-card,
html.dark .chart-card {
    background: #1a222b !important;
    color: var(--brand-text) !important;
    border-color: #2e3c49 !important;
}

html.dark input,
html.dark select,
html.dark textarea,
html.dark button:not(.theme-toggle-btn) {
    background: #111820 !important;
    color: var(--brand-text) !important;
    border-color: #2e3c49 !important;
}

html.dark .card,
html.dark [class*='card'],
html.dark [class*='panel'],
html.dark [class*='modal'],
html.dark [class*='table'],
html.dark [class*='section'],
html.dark [class*='content'],
html.dark [class*='widget'],
html.dark [class*='dropdown'],
html.dark table,
html.dark thead,
html.dark tbody,
html.dark tfoot,
html.dark tr,
html.dark th,
html.dark td {
    background: #1a222b !important;
    border-color: #2e3c49 !important;
}

html.dark [style*='background: white'],
html.dark [style*='background:white'],
html.dark [style*='background: #fff'],
html.dark [style*='background:#fff'],
html.dark [style*='background-color: white'],
html.dark [style*='background-color:white'],
html.dark [style*='background-color: #fff'],
html.dark [style*='background-color:#fff'] {
    background: #1a222b !important;
    background-color: #1a222b !important;
}


html.dark .chart-container,
html.dark .chart-wrapper,
html.dark #incomeChart,
html.dark #workersChart,
html.dark .chart-card {
    background: #1a222b !important;
}

html.dark .schedule-day {
    background: #1a222b !important;
    border: 1px solid #2e3c49 !important;
}

html.dark .schedule-day .shift-card {
    background: #111820 !important;
    border: 1px solid #163458 !important;
}

html.dark .schedule-day .shift-edit,
html.dark .schedule-day .shift-delete {
    background: #111820 !important;
    border: 1px solid #2e3c49 !important;
}

html.dark .btn.btn-secondary,
html.dark a.btn.btn-secondary,
html.dark .btn.btn-light,
html.dark a.btn.btn-light {
    background: #111820 !important;
    color: #163458 !important;
    border-color: #163458 !important;
}

html.dark .header-actions .btn-icon,
html.dark .header-actions a.btn-icon,
html.dark .header-actions select.btn-icon {
    background: #111820 !important;
    color: #163458 !important;
    border-color: #163458 !important;
}

html.dark .header-actions .btn-icon:hover,
html.dark .header-actions a.btn-icon:hover {
    background: #163458 !important;
    color: #0d2c4a !important;
}


html.dark .muted,
html.dark [class*='gray'],
html.dark [class*='meta'],
html.dark .day-date,
html.dark .detail-label,
html.dark .kpi-label,
html.dark .notification-time,
html.dark .notification-message {
    color: #ffffff !important;
}


 .mobile-bottom-nav {
    display: none;
}


.manager-mobile-header {
    display: none;
}


@media (max-width: 767px) {
    body.mobile-nav-enabled {
        padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
    }

    body.mobile-nav-enabled .container {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .main-nav {
        display: none !important;
    }


    .manager-mobile-header {
        display: block;
        margin: 0 0 12px;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .manager-mobile-header .topbar {
        position: static;
        width: 100%;
        background: transparent;
        backdrop-filter: none;
        border-bottom: 0;
        padding: 0 12px 8px;
    }


    .manager-mobile-header header.topbar[data-nav-role='worker'] .topbar__button-line {
        flex-wrap: nowrap;
        gap: 4px;
        width: 100%;
    }

    .manager-mobile-header header.topbar[data-nav-role='worker'] .topbar__button-line .btn-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        flex: 0 0 36px;
    }

    .manager-mobile-header header.topbar[data-nav-role='worker'] .topbar__button-line select.btn-icon {
        width: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 12px;
        text-align: center;
        text-align-last: center;
        appearance: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        background-image: none;
        text-indent: 0;
    }

    .manager-mobile-header header.topbar[data-nav-role='worker'] .topbar__actions {
        width: 100%;
        overflow: visible !important;
    }

    body.manager-page,
    body.manager-page .container {
        max-width: 100vw;
        overflow-x: hidden;
    }

    header.header[data-nav-role='manager'] {
        display: none;
    }

    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    header.topbar[data-nav-role='worker'] .header-actions,
    header.topbar[data-nav-role='worker'] .topbar__actions {
        justify-content: flex-start;
    }

    .user-info,
    .user-details {
        min-width: 0;
    }

    .mobile-bottom-nav {
        display: block;
        position: fixed;
        left: 50%;
        bottom: max(12px, env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        width: min(90vw, 520px);
        z-index: 1100;
        border-radius: 999px;
        background: color-mix(in srgb, var(--brand-white) 84%, transparent);
        border: 1px solid color-mix(in srgb, var(--brand-border) 80%, transparent);
        box-shadow: 0 14px 35px rgba(15, 76, 129, 0.2);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 8px;
        touch-action: pan-x;
    }

    html.dark .mobile-bottom-nav {
        background: color-mix(in srgb, #111820 84%, transparent);
    }

    .mobile-bottom-nav__track {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-snap-type: x proximity;
        scroll-behavior: smooth;
    }

    .mobile-bottom-nav__track::-webkit-scrollbar {
        display: none;
    }

    .mobile-nav-item {
        flex: 0 0 calc((100% - 18px) / 4);
        min-width: calc((100% - 18px) / 4);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        text-decoration: none;
        color: var(--brand-text);
        border-radius: 999px;
        padding: 8px 6px;
        font-size: 10px;
        line-height: 1.15;
        scroll-snap-align: center;
        white-space: nowrap;
    }

    .mobile-nav-item i {
        font-size: 15px;
    }

    .mobile-nav-item span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-nav-item.active {
        background: rgba(0, 51, 102, 0.18);
        color: #003366;
    }

    html.dark .mobile-nav-item.active {
        background: rgba(22, 52, 88, 0.32);
        color: #c7dbf5;
    }
}

/* Shared worker header (used from fragments/worker_header.html) */
header.topbar[data-nav-role='worker'] {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.55);
}

header.topbar[data-nav-role='worker'] .topbar__brand { min-width: 0; }
header.topbar[data-nav-role='worker'] .topbar__app-title {
    margin: 0;
    text-decoration: none;
    color: #003366;
    display: inline-flex;
    width: fit-content;
}
header.topbar[data-nav-role='worker'] .topbar__app-title span {
    font-family: "Manrope", sans-serif;
    font-size: 30px;
    line-height: 1;
    letter-spacing: -0.8px;
    font-weight: 800;
    position: relative;
}
header.topbar[data-nav-role='worker'] .topbar__app-title span::after {
    content: none;
}
header.topbar[data-nav-role='worker'] .topbar__divider {
    margin: 12px 0 8px;
    height: 3px;
    width: min(220px, 70vw);
    border-radius: 999px;
    background: linear-gradient(90deg, #003366 0%, #2b6777 100%);
}
header.topbar[data-nav-role='worker'] .topbar__bottom-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
}
header.topbar[data-nav-role='worker'] .topbar__text {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
header.topbar[data-nav-role='worker'] .topbar__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #003366;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
header.topbar[data-nav-role='worker'] .topbar__actions {
    min-width: 0;
    align-self: flex-start;
}
header.topbar[data-nav-role='worker'] .topbar__button-line {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-start;
    flex-wrap: wrap;
}
header.topbar[data-nav-role='worker'] .topbar__button-line .btn-icon {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 12px;
    background: #f2f4f6;
    color: #003366;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
}
header.topbar[data-nav-role='worker'] .topbar__button-line select.btn-icon {
    width: auto;
    min-width: 52px;
    padding: 0 10px;
    font-weight: 700;
}
header.topbar[data-nav-role='worker'] #notificationsBtn,
header.topbar[data-nav-role='worker'] #globalNotificationsBtn {
    position: relative;
    overflow: visible;
}
header.topbar[data-nav-role='worker'] #notificationsBtn .badge,
header.topbar[data-nav-role='worker'] #globalNotificationsBtn .badge,
header.topbar[data-nav-role='worker'] #globalNotificationCount {
    position: absolute;
    top: -6px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d62828;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    line-height: 1;
}
