/* ===== Page shell ===== */
html.dash-page-root,
html.acc-page-root {
    height: 100%;
}

body.dash-page,
body.acc-page {
    background: linear-gradient(160deg, #eef2f7 0%, #f8fafc 45%, #e8eef5 100%);
    height: 100%;
    overflow: hidden;
}

.dash-page-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
}

.dash-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.dash-page-header__main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dash-page-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.28);
}

.dash-page-header h1 {
    font-size: 1.65rem;
    font-weight: 700;
    color: #1a237e;
    margin: 0;
    letter-spacing: -0.02em;
}

.dash-page-subtitle {
    margin: 0.15rem 0 0;
    color: #64748b;
    font-size: 0.92rem;
}

.dash-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dash-header-link {
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ===== Cards ===== */
.dash-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    margin-bottom: 0.75rem;
    overflow: hidden;
    flex-shrink: 0;
}

.dash-filter-card {
    flex-shrink: 0;
}

.dash-view-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}

.dash-view-card > .dash-card-header,
.dash-view-card > .dash-tabs {
    flex-shrink: 0;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    background: linear-gradient(90deg, #f8fafc, #fff);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    color: #334155;
    font-size: 0.95rem;
}

.dash-card-header i {
    color: #1976d2;
    margin-right: 0.35rem;
}

.dash-card-body {
    padding: 1.15rem;
}

.dash-filter-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.35rem;
}

.dash-filter-input-wrap .form-control,
.dash-filter-input-wrap .form-select,
.dash-card .input-group .form-control {
    border-radius: 10px;
    border-color: #cbd5e1;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dash-filter-input-wrap .form-control {
    padding-right: 2.2rem;
}

.dash-filter-input-wrap .form-control:focus,
.dash-card .input-group .form-control:focus,
.dash-card .form-select:focus {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

.dash-filter-input-wrap .calendar-icon {
    color: #64748b;
    transition: color 0.2s;
}

.dash-filter-input-wrap .calendar-icon:hover {
    color: #1976d2;
}

.dash-btn-search {
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.25);
}

.dash-btn-google {
    border-radius: 10px;
    font-weight: 500;
}

.dash-btn-icon {
    border-radius: 0 10px 10px 0 !important;
}

.dash-row-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1976d2;
    background: #e3f2fd;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* ===== Tabs ===== */
.dash-tabs {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem 0;
    gap: 0.35rem;
}

.dash-tabs .nav-link {
    border: none;
    border-radius: 10px 10px 0 0;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.15rem;
    transition: background 0.2s, color 0.2s;
}

.dash-tabs .nav-link:hover {
    color: #1976d2;
    background: #f1f5f9;
}

.dash-tabs .nav-link.active {
    background: #1976d2;
    color: #fff;
}

.dash-tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem 0.5rem;
    overflow: hidden;
}

.dash-tab-content > .tab-pane {
    flex: 1;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.dash-tab-content > .tab-pane.active.show {
    display: flex !important;
}

.dash-grid-wrap {
    flex: 1;
    min-height: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.dash-grid {
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* ===== Calendar ===== */
#calendarTab:fullscreen {
    background: #f8fafc;
    padding: 24px;
    box-sizing: border-box;
}

#calendarWrapper:fullscreen,
#calendarWrapper:-webkit-full-screen {
    background: linear-gradient(160deg, #eef2f7 0%, #f8fafc 45%, #e8eef5 100%);
    padding: 28px 32px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

#calendarWrapper:fullscreen .dash-calendar-meta,
#calendarWrapper:-webkit-full-screen .dash-calendar-meta {
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
}

#calendarWrapper:fullscreen #calendar,
#calendarWrapper:-webkit-full-screen #calendar {
    flex: 1;
    min-height: 0;
    border-radius: 0 0 12px 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
    background: #fff;
}

#calendarTab {
    position: relative;
}

.dash-calendar-wrap,
#calendarWrapper {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.dash-calendar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, #f8fafc, #fff);
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.dash-calendar-meta i {
    color: #1976d2;
    margin-right: 0.35rem;
}

.dash-calendar-meta__hint {
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
}

#calendar {
    flex: 1;
    min-height: 0;
    background: #ffffff;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

#calendar .fc {
    height: 100%;
}

.fc .fc-toolbar.fc-header-toolbar {
    padding: 0.75rem 1rem 0.65rem;
    margin-bottom: 0 !important;
    border-bottom: 1px solid #eef2f7;
}

.fc-toolbar-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.fc .fc-button {
    border-radius: 8px !important;
    padding: 0.35rem 0.7rem !important;
    background: #fff !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: none !important;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fc .fc-button:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #334155 !important;
}

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-primary:not(:disabled).fc-button-active:focus {
    background: #1976d2 !important;
    border-color: #1565c0 !important;
    color: #fff !important;
}

.fc .fc-button-primary:focus {
    box-shadow: 0 0 0 0.15rem rgba(25, 118, 210, 0.2) !important;
}

.fc .fc-toolbar-chunk .fc-button-group > .fc-button {
    margin: 0 1px;
}

.fc .fc-daygrid-day.fc-day-sat,
.fc .fc-daygrid-day.fc-day-sun {
    background: #fafbfc;
}

.fc-day-today {
    background: #eff6ff !important;
}

.fc-day-today .fc-daygrid-day-number {
    background: #1976d2;
    color: #fff !important;
    border-radius: 999px;
    min-width: 1.65rem;
    min-height: 1.65rem;
    line-height: 1.65rem;
    text-align: center;
    margin: 3px 4px;
    padding: 0;
    font-weight: 600;
}

.fc .fc-daygrid-day-number {
    color: #475569;
    font-weight: 500;
    font-size: 0.82rem;
    padding: 4px 6px;
    text-decoration: none !important;
}

.fc .fc-daygrid-day.fc-day-sun:not(.fc-day-today) .fc-daygrid-day-number {
    color: #c62828 !important;
}

.fc-event,
.fc .dash-cal-event {
    border: none !important;
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 500;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.fc-event:hover,
.fc .dash-cal-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.16);
}

.fc-col-header-cell {
    background: #eef2f7 !important;
    color: #334155 !important;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: center;
    padding: 8px 0;
    border-color: #e2e8f0 !important;
}

.fc-theme-standard th {
    border-color: #e2e8f0;
}

.fc-theme-standard td {
    border-color: #eef2f7;
}

.fc-col-header-cell.fc-day-sat,
.fc-col-header-cell.fc-day-sun {
    background: #e8eef5 !important;
    color: #475569 !important;
}

.fc .fc-col-header-cell-cushion {
    color: inherit !important;
    text-decoration: none !important;
}

.fc .fc-scrollgrid {
    border-color: #e2e8f0 !important;
}

.fc .fc-daygrid-day-frame {
    min-height: 4.5rem;
}

.fc .fc-timegrid-slot-label,
.fc .fc-timegrid-axis-cushion {
    color: #64748b;
    font-size: 0.78rem;
}

.fc .fc-timegrid-col.fc-day-today {
    background: #eff6ff !important;
}

.fc .fc-fullscreenBtn-button,
.fc .fc-printBtn-button {
    min-width: 2.1rem;
}

.fc .fc-fullscreenBtn-button .bi,
.fc .fc-printBtn-button .bi {
    font-size: 0.95rem;
}

.datepicker-input.is-invalid {
    background-position: right 30px center !important;
}

.fc-printBtn-button.hide-print {
    visibility: hidden;
    width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* ===== Modals ===== */
#modalAdd .modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#modalAdd .modal-header {
    background: linear-gradient(90deg, #1976d2, #1565c0);
    color: #fff;
    border: 0;
    padding: 1rem 1.25rem;
}

#modalAdd .modal-header .btn-close {
    filter: invert(1);
}

#modalAdd .modal-title {
    font-weight: 600;
}

#modalAdd .modal-body {
    padding: 1.25rem;
}

#modalAdd .modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
}

#modalAdd .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

#googleAlertModal .modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
}

#googleAlertModal .modal-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

#googleAlertModal .modal-icon.success {
    background: #e8f5e9;
    color: #2e7d32;
}

#googleAlertModal .modal-icon.warning {
    background: #fff3e0;
    color: #ef6c00;
}

#googleAlertModal .modal-icon.error {
    background: #ffebee;
    color: #c62828;
}

#googleAlertModal .modal-icon.info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ===== Select2 ===== */
.dash-card .select2-container--bootstrap-5 .select2-selection {
    border-radius: 10px;
    border-color: #cbd5e1;
    min-height: 38px;
}

.dash-card .select2-container--bootstrap-5.select2-container--focus .select2-selection,
.dash-card .select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: #1976d2;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

@media (max-width: 768px) {
    .dash-page-shell {
        padding: 1rem 0.75rem 1.5rem;
    }

    .dash-page-header h1 {
        font-size: 1.35rem;
    }

    .dash-header-actions {
        width: 100%;
    }

    .dash-header-actions .btn {
        flex: 1;
    }
}
