﻿/* =========================================================
   GLOBAL THEME
========================================================= */
body {
    background: #0f172a;
    color: #e5e7eb;
}

.container-fluid {
    color: #e5e7eb;
}

.card {
    background-color: #111827;
    border: 1px solid #334155;
    color: #e5e7eb;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card-body {
    padding: 1.25rem;
}

/* =========================================================
   TABLES
========================================================= */
.table-dark {
    --bs-table-bg: #111827;
    --bs-table-striped-bg: #172033;
    --bs-table-hover-bg: #1e293b;
    --bs-table-border-color: #334155;
    color: #e5e7eb;
}

/* =========================================================
   FORMS
========================================================= */
.form-label {
    color: #cbd5e1;
}

.form-control,
.form-select {
    background-color: #111827;
    color: #e5e7eb;
    border: 1px solid #334155;
}

    .form-control:focus,
    .form-select:focus {
        background-color: #111827;
        color: #e5e7eb;
        border-color: #38bdf8;
        box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.15);
    }

.year-picker,
.agent-filter,
.year-select {
    min-width: 160px;
}

/* =========================================================
   BUTTONS
========================================================= */
.btn-primary {
    background-color: #38bdf8;
    border-color: #38bdf8;
}

    .btn-primary:hover {
        background-color: #0ea5e9;
        border-color: #0ea5e9;
    }

/* =========================================================
   CALENDAR - VISIBILITY
========================================================= */
.desktop-calendar {
    display: block;
}

.mobile-calendar {
    display: none;
}

/* =========================================================
   CALENDAR - DESKTOP
========================================================= */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 10px;
}

.calendar-header {
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    padding: 0.5rem;
    font-weight: 600;
}

.calendar-cell,
.calendar-day {
    min-height: 150px;
    border: 1px solid #334155;
    border-radius: 1rem;
    background: #111827;
    color: #e5e7eb;
    padding: 1rem;
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
}

    .calendar-cell:hover,
    .calendar-day:hover {
        border-color: #64748b;
        transform: translateY(-1px);
        background: #1e293b;
    }

    .calendar-cell.is-selected,
    .calendar-day.is-selected {
        border-color: #38bdf8;
        box-shadow: 0 0 0 1px #38bdf8 inset;
    }

    .calendar-cell.is-muted,
    .calendar-day.is-muted {
        opacity: 0.35;
    }

    .calendar-cell.is-blocked,
    .calendar-day.is-blocked {
        background: #0b1220;
    }

.weekend {
    background-color: #1f2937;
}

.holiday {
    background-color: #7f1d1d;
    border-color: #ef4444;
}

.day-number {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1f2937;
    border-radius: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

    .day-number.today {
        background: #38bdf8;
        color: #020617;
    }

/* =========================================================
   CALENDAR - USER TAGS / STATES
========================================================= */
.calendar-user {
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 4px 8px;
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.approved-user {
    background: rgba(25, 135, 84, 0.2);
    color: #86efac;
    border: 1px solid rgba(25, 135, 84, 0.35);
}

.pending-user {
    background: rgba(13, 202, 240, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(13, 202, 240, 0.3);
}

.calendar-more {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 4px;
}

.approved-list {
    font-size: 12px;
    color: #22c55e;
    margin-top: 0.5rem;
}

.pending-alert {
    color: #f59e0b;
    font-weight: 700;
    font-size: 12px;
    margin-top: 0.5rem;
}

/* =========================================================
   DAY DETAIL / ACTIVITY
========================================================= */
.day-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-user-item {
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.9rem;
    word-break: break-word;
}

.pending-date {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #374151;
    border-radius: 12px;
    background: #111827;
}

.pending-date-label {
    font-size: 0.78rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pending-date-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: #e5e7eb;
}

.pending-actions {
    display: flex;
    gap: 8px;
}

/* =========================================================
   MOBILE MONTH CALENDAR
========================================================= */
.calendar-grid-mobile {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.calendar-header-mobile {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 4px 0;
    text-transform: uppercase;
}

.mobile-day {
    aspect-ratio: 1 / 1;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #111827;
    color: #e5e7eb;
    padding: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

    .mobile-day.is-selected {
        border-color: #38bdf8;
        box-shadow: 0 0 0 1px #38bdf8 inset;
        background: #0f1d36;
    }

    .mobile-day.is-muted {
        opacity: 0.35;
    }

    .mobile-day.is-weekend {
        background: #0b1220;
    }

    .mobile-day.is-holiday {
        border-color: #f59e0b;
    }

    .mobile-day.is-today .mobile-day-number {
        background: #38bdf8;
        color: #020617;
    }

.mobile-day-top {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

.mobile-day-number {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
}

.mobile-day-markers {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-height: 10px;
    margin-bottom: 2px;
}

.day-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    display: inline-block;
}

.approved-dot {
    background: #22c55e;
}

.pending-dot {
    background: #38bdf8;
}

.holiday-dot {
    background: #f59e0b;
}

.mobile-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #cbd5e1;
}

.mobile-activity-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-activity-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 12px;
    background: #111827;
    color: #e5e7eb;
    text-align: left;
}

    .mobile-activity-item.selected {
        border-color: #38bdf8;
        background: #0f1d36;
    }

.mobile-activity-date {
    font-weight: 700;
    min-width: 52px;
}

.mobile-activity-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.activity-pill {
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.72rem;
}

/* =========================================================
   WEEKDAY ANALYTICS
========================================================= */
.weekday-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.weekday-bar-item {
    border: 1px solid #334155;
    border-radius: 16px;
    background: #111827;
    padding: 14px;
}

.weekday-bar-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.weekday-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #1f2937;
    overflow: hidden;
}

.weekday-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #22c55e);
}

.weekday-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* =========================================================
   MODAL / OVERLAY
========================================================= */
.teams-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.teams-modal {
    background: #111827;
    color: #e5e7eb;
    border: 1px solid #334155;
    border-radius: 14px;
    width: 420px;
    max-width: 95%;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #334155;
}

.modal-body {
    padding: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #cbd5e1;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #1f2937;
}

.user-name {
    font-weight: 500;
    color: #e5e7eb;
}

.actions button {
    margin-left: 5px;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.approve {
    background-color: #28a745;
    color: #fff;
}

.reject {
    background-color: #dc3545;
    color: #fff;
}

.create-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background-color: #0078d4;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1200px) {
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .desktop-calendar {
        display: none;
    }

    .mobile-calendar {
        display: block;
    }

    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    h1.fw-bold {
        font-size: 1.35rem;
    }

    .h3.fw-bold {
        font-size: 1.15rem;
    }

    .display-6 {
        font-size: 1.8rem;
    }

    .badge.fs-6 {
        font-size: 0.8rem !important;
        white-space: normal;
        text-align: center;
    }

    .card-body {
        padding: 1rem;
    }

    .row.g-4 {
        --bs-gutter-x: 0.8rem;
        --bs-gutter-y: 0.8rem;
    }

    .form-label {
        margin-bottom: 0.35rem;
        font-size: 0.9rem;
    }

    .form-control,
    .btn {
        min-height: 44px;
    }

        .btn.w-100.rounded-3 {
            font-size: 0.95rem;
            font-weight: 600;
        }

    .teams-modal {
        width: 95%;
    }

    .weekday-bar-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .year-picker,
    .agent-filter,
    .year-select {
        width: 100%;
        min-width: unset;
    }
}

@media (max-width: 576px) {
    .pending-actions {
        flex-direction: column;
    }

        .pending-actions .btn {
            width: 100%;
        }

    .day-user-item {
        font-size: 0.82rem;
        padding: 7px 9px;
    }

    .pending-date {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .calendar-user {
        font-size: 0.65rem;
        padding: 3px 6px;
        margin-top: 4px;
    }

    .calendar-more {
        font-size: 0.65rem;
    }

    .detail-stats-row .col-6 {
        width: 100%;
    }

    .detail-stat-box {
        padding: 0.85rem !important;
    }
}

.year-picker {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

    .year-picker .form-label {
        font-size: 0.75rem;
        margin-bottom: 2px;
        line-height: 1;
    }

.year-select {
    height: 38px;
    min-width: 100px;
}

.d-flex.flex-wrap.align-items-center {
    align-items: flex-end !important;
}

.badge {
    height: 38px;
    display: flex;
    align-items: center;
}

button.btn {
    height: 38px;
}

.nav-scrollable .nav-item {
    margin-bottom: 0.35rem;
}

    .nav-scrollable .nav-item .nav-link.nav-link-menu {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px;
        width: 100%;
        min-height: 48px;
        padding: 0.75rem 1rem;
        text-align: left !important;
        border-radius: 8px;
        white-space: normal;
    }

        .nav-scrollable .nav-item .nav-link.nav-link-menu .nav-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            min-width: 24px;
            font-size: 1rem;
            line-height: 1;
            flex-shrink: 0;
        }

        .nav-scrollable .nav-item .nav-link.nav-link-menu .nav-text {
            display: block;
            flex: 1;
            text-align: left !important;
            line-height: 1.2;
        }