/* MyPangsapuri Custom Styles - Modern Design System */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&family=Open+Sans:wght@400;600&family=Nunito:wght@600;700&display=swap');

:root {
    /* Brand Colors - sampled directly from the MyPangsapuri logo
       (green building #29A454, blue hands #04629F). */
    --primary-green: #29A454;
    --primary-blue: #04629F;

    /* Deeper variants for hover states and for solid fills that carry white
       text: #1E7D42 on white reaches 5.1:1 contrast, where the brand green
       alone only reaches 3.2:1 (below the 4.5:1 AA threshold). */
    --primary-green-deep: #1E7D42;
    --primary-blue-deep: #035387;

    /* Brand tints, kept as tokens so translucent surfaces stay in sync
       with the two brand hues above. */
    --tint-green-subtle: rgba(41, 164, 84, 0.08);
    --tint-green-soft: rgba(41, 164, 84, 0.15);
    --tint-blue-subtle: rgba(4, 98, 159, 0.08);
    --tint-blue-soft: rgba(4, 98, 159, 0.15);

    --brand-gradient: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    --brand-gradient-hover: linear-gradient(135deg, var(--primary-green-deep) 0%, var(--primary-blue-deep) 100%);

    --white: #FFFFFF;
    --grey-neutral: #555555;
    --grey-light: #F5F5F5;
    --grey-medium: #999999;

    /* Status Colors */
    --status-menunggu: #6c757d;
    --status-dalam-proses: #04629F;
    --status-selesai: #1E7D42;
    --status-ditolak: #dc3545;
    
    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Open Sans', sans-serif;
    --font-button: 'Nunito', sans-serif;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(circle at 15% 10%, rgba(41, 164, 84, 0.08), transparent 28rem),
        radial-gradient(circle at 85% 20%, rgba(4, 98, 159, 0.08), transparent 26rem),
        linear-gradient(180deg, #f8fafc 0%, #eef7f3 100%);
    color: var(--grey-neutral);
    line-height: 1.6;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--grey-neutral);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
}

h3 {
    font-size: 1.5rem;
}

/* Buttons */
.btn {
    font-family: var(--font-button);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-blue) 100%);
    border: none;
    color: var(--white);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1E7D42 0%, #035387 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.btn-success {
    /* Deep variant so the white label clears 4.5:1 contrast. */
    background-color: var(--primary-green-deep);
    border: none;
    color: var(--white);
}

.btn-success:hover {
    background-color: #196937;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-info {
    background-color: var(--primary-blue);
    border: none;
    color: var(--white);
}

.btn-info:hover {
    background-color: var(--primary-blue-deep);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Navbar - Modern & Futuristic */
.navbar {
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%);
    box-shadow: 0 4px 20px rgba(41, 164, 84, 0.2);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--white) !important;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    transition: transform 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.02);
}

.navbar-brand img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-nav .nav-link {
    font-family: var(--font-body);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 0.3rem;
    position: relative;
}

.navbar-nav .nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s ease;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white) !important;
    transform: translateY(-2px);
}

.navbar-nav .nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: var(--white) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.navbar-nav .nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

/* Navbar Dropdown */
.navbar .dropdown-menu {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(41, 164, 84, 0.15);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
}

.navbar .dropdown-item {
    padding: 0.65rem 1.25rem;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 0.15rem 0.5rem;
}

.navbar .dropdown-item:hover {
    background: linear-gradient(135deg, rgba(41, 164, 84, 0.1) 0%, rgba(4, 98, 159, 0.1) 100%);
    color: #29A454;
    transform: translateX(4px);
}

.navbar .dropdown-item i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.navbar .dropdown-divider {
    margin: 0.5rem 0;
    border-color: rgba(148, 163, 184, 0.2);
}

/* Cards */
.card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.card:hover {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    transform: translateY(-4px);
    border-color: rgba(41, 164, 84, 0.2);
}

.card-header {
    background: linear-gradient(135deg, rgba(41, 164, 84, 0.03) 0%, rgba(4, 98, 159, 0.03) 100%);
    border-bottom: 2px solid rgba(41, 164, 84, 0.1);
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    border-radius: 18px 18px 0 0 !important;
}

.card-header h5 {
    color: #0f172a;
    font-weight: 700;
    margin: 0;
}

/* Prevent transitions from interfering with modals */
.modal .card {
    transition: none !important;
}

.modal .card:hover {
    transform: none !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Stats Cards */
.stats-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, currentColor 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.15);
}

.stats-card:hover::before {
    opacity: 1;
}

.stats-card.border-secondary::before {
    color: #6c757d;
}

.stats-card.border-info::before {
    color: #04629F;
}

.stats-card.border-success::before {
    color: #29A454;
}

.stats-card .card-body h3 {
    background: linear-gradient(135deg, currentColor 0%, currentColor 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stats-card .badge {
    border-radius: 999px;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 1.5rem 1.25rem;
    margin-bottom: 2rem;
    position: sticky;
    top: 5.5rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    align-self: flex-start;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.4rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border-radius: 14px;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-nav .nav-link:hover {
    background: linear-gradient(135deg, rgba(41, 164, 84, 0.08) 0%, rgba(4, 98, 159, 0.08) 100%);
    color: #29A454;
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(41, 164, 84, 0.1);
}

.sidebar-nav .nav-link:hover::before {
    transform: scaleY(1);
}

.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(41, 164, 84, 0.3);
    transform: translateX(0);
}

.sidebar-nav .nav-link.active::before {
    transform: scaleY(1);
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
}

/* Gradient Elements */
.gradient-bg {
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(41, 164, 84, 0.25);
    border: none;
    position: relative;
    overflow: hidden;
}

.gradient-bg::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.gradient-bg .card-body {
    position: relative;
    z-index: 1;
}

/* The global heading colour is set on h1-h6 directly, which beats the
   white inherited from .text-white - restore contrast on the gradient. */
.gradient-bg h1,
.gradient-bg h2,
.gradient-bg h3,
.gradient-bg h4,
.gradient-bg h5,
.gradient-bg h6 {
    color: #fff;
}

.text-gradient {
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.shadow-soft {
    box-shadow: var(--shadow-sm);
}

/* ... rest of the code remains the same ... */
.shadow-medium {
    box-shadow: var(--shadow-md);
}

.shadow-large {
    box-shadow: var(--shadow-lg);
}

/* Loading Spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* SLA Indicators */
.sla-indicator {
    display: inline-block;
    padding: 0.25em 0.75em;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-button);
}

.sla-warning {
    background-color: #fff3cd;
    color: #856404;
}

.sla-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.sla-ok {
    background-color: #d1e7dd;
    color: #0f5132;
}

/* Activity Log */
.activity-log {
    border-left: 4px solid var(--primary-blue);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.activity-log small {
    color: var(--grey-medium);
}

/* Status Badges - Clear & Visible */
.badge.status-menunggu,
.badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.badge.status-dalam-proses,
.badge.bg-info {
    background-color: #04629F !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(4, 98, 159, 0.3);
}

.badge.status-selesai,
.badge.bg-success {
    /* Deep variant: small bold white text needs 4.5:1, which the lighter
       brand green does not meet. */
    background-color: var(--primary-green-deep) !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(41, 164, 84, 0.3);
}

.badge.status-ditolak,
.badge.bg-danger {
    background-color: #dc3545 !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

/* Priority Indicators */
.priority-high,
.priority-tinggi {
    color: #dc3545;
    font-weight: 600;
    font-size: 0.9rem;
}

.priority-medium,
.priority-sederhana {
    color: #ffc107;
    font-weight: 600;
    font-size: 0.9rem;
}

.priority-low,
.priority-rendah {
    color: #28a745;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    footer,
    .btn,
    .alert,
    .breadcrumb,
    .no-print {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        /* Keep a card and its chart from being split across two sheets. */
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .card:hover {
        transform: none;
    }

    body {
        background: #ffffff !important;
    }

    /* Report letterhead: hidden on screen, shown only on the printed sheet. */
    .report-print-header {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        padding-bottom: 0.75rem;
        margin-bottom: 1.25rem;
        border-bottom: 3px solid var(--primary-green);
    }

    .report-print-header img {
        height: 64px;
        width: auto;
    }

    .report-print-header h1 {
        font-size: 1.35rem;
        margin: 0;
        color: var(--primary-blue);
    }

    .report-print-header p {
        margin: 0;
        font-size: 0.85rem;
        color: #444;
    }

    /* Charts are canvases: force them to fit the sheet width. */
    .chart-container {
        height: 240px !important;
    }

    .report-table {
        font-size: 0.72rem;
    }

    .report-table th,
    .report-table td {
        padding: 0.3rem 0.4rem !important;
        white-space: normal !important;
    }

    .table-responsive {
        overflow: visible !important;
    }

    /* Badges lose their background in print; keep them legible as outlines. */
    .badge {
        border: 1px solid #999 !important;
        color: #000 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    @page {
        size: A4 landscape;
        margin: 12mm;
    }
}

/* Report KPI cards stay compact so six fit on one row. */
.kpi-card .card-body h3 {
    font-size: 1.75rem;
    font-weight: 800;
}

/* ========================================
   STAR RATING INPUT
   ======================================== */

/* The original markup referenced .rating-input / .rating-stars but those
   classes were never written, so the control fell back to bare radio
   buttons. Radios are kept underneath for validation and keyboard support;
   only their presentation changes. */
.rating-input {
    display: inline-flex;
    flex-direction: row;
    gap: 0.25rem;
}

.rating-input input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.rating-input label {
    font-size: 2rem;
    line-height: 1;
    color: #d8dee6;
    cursor: pointer;
    transition: color 0.15s ease, transform 0.15s ease;
    margin: 0;
}

.rating-input label:hover {
    transform: scale(1.12);
}

.rating-input label.is-on {
    color: #f5a623;
}

/* Focus lives on the hidden radio, so surface it on the star instead. */
.rating-input input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
    border-radius: 4px;
}

.rating-value {
    font-weight: 700;
    color: var(--grey-neutral);
    margin-left: 0.5rem;
}

.rating-static {
    color: #f5a623;
    font-size: 1.35rem;
    letter-spacing: 0.1rem;
}

/* ========================================
   HALL BOOKING CALENDAR
   ======================================== */

.cal-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #ffffff;
}

.cal-legend-approved { background: var(--primary-blue); }
.cal-legend-pending { background: #b8860b; }
.cal-legend-today {
    background: var(--tint-green-soft);
    color: var(--primary-green-deep);
    border: 1px solid var(--primary-green);
}

.cal-grid {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.cal-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e2e8f0;
}

.cal-row:last-child { border-bottom: none; }

.cal-cell {
    min-height: 118px;
    border-right: 1px solid #e2e8f0;
    padding: 0.5rem;
    background: #ffffff;
}

.cal-cell:last-child { border-right: none; }

.cal-row-head .cal-cell {
    min-height: auto;
    padding: 0.7rem 0.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: #475569;
    background: linear-gradient(135deg, var(--tint-green-subtle) 0%, var(--tint-blue-subtle) 100%);
}

.cal-cell-muted { background: #f8fafc; }
.cal-cell-muted .cal-date { color: #cbd5e1; }

.cal-cell-today {
    background: var(--tint-green-subtle);
    box-shadow: inset 0 0 0 2px var(--primary-green);
}

.cal-date {
    font-weight: 700;
    font-size: 0.92rem;
    color: #334155;
    margin-bottom: 0.3rem;
}

.cal-events {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cal-event {
    display: block;
    width: 100%;
    border: none;
    text-align: left;
    color: #ffffff;
    padding: 0.22rem 0.45rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.cal-event:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.cal-event-approved { background: var(--primary-blue); }
.cal-event-pending { background: #b8860b; }

/* Day view */
.cal-day-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.cal-day-item {
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: var(--radius-md);
    padding: 1rem;
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

.cal-day-item:hover { box-shadow: var(--shadow-md); }
.cal-day-item.is-approved { border-left-color: var(--primary-blue); }
.cal-day-item.is-pending { border-left-color: #b8860b; }

.cal-day-time {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--primary-blue);
}

.cal-day-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
}

.cal-day-desc {
    font-size: 0.9rem;
    color: #64748b;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

/* Year view */
.cal-mini-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: #ffffff;
    height: 100%;
}

.cal-mini-title {
    display: block;
    width: 100%;
    border: none;
    background: linear-gradient(135deg, var(--tint-green-subtle) 0%, var(--tint-blue-subtle) 100%);
    border-radius: 8px;
    padding: 0.4rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cal-mini-title:hover { color: var(--primary-green-deep); }

.cal-mini-grid {
    border: 1px solid #eef2f7;
    border-radius: 6px;
    overflow: hidden;
}

.cal-mini-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-mini-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    border: none;
    background: #ffffff;
    color: #475569;
    padding: 0;
}

button.cal-mini-cell { cursor: pointer; }
button.cal-mini-cell:hover { background: var(--tint-blue-subtle); }

.cal-mini-head {
    background: #f8fafc;
    font-weight: 700;
    color: #94a3b8;
    font-size: 0.6rem;
}

.cal-mini-empty { background: #fcfdfe; }

.cal-mini-today {
    background: var(--tint-green-soft);
    font-weight: 800;
    color: var(--primary-green-deep);
}

.cal-mini-has {
    position: relative;
    font-weight: 700;
    color: var(--primary-blue);
}

.cal-mini-has::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-blue);
}

@media (max-width: 768px) {
    .cal-cell { min-height: 76px; padding: 0.25rem; }
    .cal-date { font-size: 0.78rem; }
    .cal-event { font-size: 0.6rem; padding: 0.15rem 0.3rem; }
    .cal-row-head .cal-cell { font-size: 0.65rem; padding: 0.5rem 0.2rem; }
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet & Small Desktop (≤ 992px) */
@media (max-width: 992px) {
    /* Navbar adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-brand img {
        height: 36px;
    }
    
    /* Sidebar becomes full width */
    .sidebar {
        position: static;
        margin-bottom: 1.5rem;
        max-height: none;
        top: 0;
    }
    
    /* Stats cards 2 columns */
    .stats-card {
        margin-bottom: 1rem;
    }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    /* Typography scaling */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.35rem;
    }
    
    /* Navbar mobile */
    .navbar {
        padding: 0.75rem 0;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .navbar-brand img {
        height: 32px;
        margin-right: 8px;
    }
    
    .navbar-nav {
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
        border-radius: 8px;
    }
    
    .navbar .dropdown-menu {
        border: none;
        box-shadow: none;
        background: rgba(255, 255, 255, 0.1);
        margin-top: 0.25rem;
    }
    
    .navbar .dropdown-item {
        color: rgba(255, 255, 255, 0.9);
        padding: 0.65rem 1.5rem;
    }
    
    .navbar .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }
    
    /* Sidebar mobile */
    .sidebar {
        border-radius: 16px;
        padding: 1.25rem 1rem;
    }
    
    .sidebar-nav .nav-link {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Cards mobile */
    .card {
        border-radius: 16px;
        margin-bottom: 1.25rem;
    }
    
    .card-header {
        padding: 1rem 1.25rem;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .card-body {
        padding: 1.25rem;
    }
    
    /* Stats cards stack */
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .stats-card .card-body {
        padding: 1.5rem 1rem;
        min-height: 120px !important;
    }
    
    .stats-card .card-body h3 {
        font-size: 2.5rem !important;
    }
    
    .stats-card .badge {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    /* Gradient background card */
    .gradient-bg {
        border-radius: 16px;
    }
    
    .gradient-bg .card-body {
        padding: 2rem 1.5rem;
    }
    
    .gradient-bg h2 {
        font-size: 2.5rem !important;
    }
    
    .gradient-bg h4 {
        font-size: 1rem;
    }
    
    /* Buttons mobile */
    .btn {
        padding: 0.65rem 1.15rem;
        font-size: 0.9rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Forms mobile */
    .form-label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .form-control,
    .form-select {
        font-size: 0.95rem;
        padding: 0.65rem 0.85rem;
    }
    
    /* Tables mobile - scroll horizontally */
    .table-responsive {
        margin-bottom: 1rem;
        border-radius: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.85rem;
        min-width: 600px;
    }
    
    .table th,
    .table td {
        padding: 0.65rem 0.75rem;
        white-space: nowrap;
    }
    
    /* Charts mobile */
    .chart-container {
        position: relative;
        height: 250px !important;
        margin-bottom: 1rem;
    }
    
    /* Breadcrumb mobile */
    .breadcrumb {
        font-size: 0.85rem;
        padding: 0.5rem 0;
        margin-bottom: 1rem;
    }
    
    /* Alert mobile */
    .alert {
        font-size: 0.9rem;
        padding: 0.85rem 1rem;
        border-radius: 12px;
    }
    
    /* Modal mobile */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 16px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem 1.25rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    /* Pagination mobile */
    .pagination {
        font-size: 0.85rem;
    }
    
    .page-link {
        padding: 0.5rem 0.75rem;
    }
    
    /* Badge mobile */
    .badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.65rem;
    }
    
    /* Container spacing */
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    main.container-fluid {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }
    
    /* Row spacing */
    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }
    
    .row > * {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Section spacing */
    section {
        padding: 2.5rem 0 !important;
    }
    
    /* Text alignment mobile */
    .text-center-mobile {
        text-align: center !important;
    }
}

/* Small Mobile (≤ 576px) */
@media (max-width: 576px) {
    /* Even smaller typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Navbar extra small */
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand img {
        height: 28px;
    }
    
    /* Cards extra compact */
    .card-body {
        padding: 1rem;
    }
    
    .card-header {
        padding: 0.85rem 1rem;
    }
    
    /* Stats cards extra compact */
    .stats-card .card-body {
        padding: 1.25rem 0.85rem;
        min-height: 100px !important;
    }
    
    .stats-card .card-body h3 {
        font-size: 2rem !important;
    }
    
    .stats-card .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.85rem;
    }
    
    /* Gradient card compact */
    .gradient-bg .card-body {
        padding: 1.5rem 1rem;
    }
    
    .gradient-bg h2 {
        font-size: 2rem !important;
    }
    
    /* Buttons full width on tiny screens */
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
    
    .d-flex.gap-2,
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .d-flex.gap-2 .btn,
    .d-flex.gap-3 .btn {
        width: 100%;
    }
    
    /* Forms extra compact */
    .form-control,
    .form-select {
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
    }
    
    /* Table even smaller */
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.6rem;
    }
    
    /* Charts smaller */
    .chart-container {
        height: 200px !important;
    }
    
    /* Modal full screen on tiny devices */
    .modal-dialog {
        margin: 0;
        max-width: 100%;
        height: 100vh;
    }
    
    .modal-content {
        height: 100%;
        border-radius: 0;
    }
    
    /* Sidebar nav compact */
    .sidebar-nav .nav-link {
        padding: 0.75rem 0.85rem;
        font-size: 0.85rem;
    }
    
    /* Container extra tight */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Section tighter spacing */
    section {
        padding: 2rem 0 !important;
    }
}

.auth-shell {
    min-height: calc(100vh - 86px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-shell > .row {
    width: 100%;
}

.auth-shell .col-md-5,
.auth-shell .col-lg-4 {
    width: 100%;
    max-width: 520px;
    flex: 0 1 520px;
}

.auth-shell .card {
    border: 1px solid rgba(41, 164, 84, 0.16);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    overflow: hidden;
    width: 100%;
}

.auth-shell .card-header,
.card-header.bg-primary {
    background: linear-gradient(135deg, #29A454 0%, #04629F 100%) !important;
    color: #ffffff !important;
    border-bottom: 0;
}

.auth-shell .card-header h1,
.auth-shell .card-header h2,
.auth-shell .card-header h3,
.auth-shell .card-header h4,
.auth-shell .card-header h5,
.auth-shell .card-header h6,
.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6 {
    color: #ffffff !important;
}

.auth-shell .form-control,
.auth-shell .form-select {
    width: 100%;
}

.resident-shell {
    padding-top: 1.25rem;
}

/* Chart containers (base size; overridden smaller on mobile below) */
.chart-container {
    position: relative;
    height: 320px;
    margin-bottom: 1rem;
}

/* Notification bell dropdown */
.notif-dropdown {
    width: 340px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
}

.notif-item {
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.notif-item:hover {
    background-color: rgba(41, 164, 84, 0.08) !important;
}

/* Toast/snackbar stack */
.toast-container .toast {
    min-width: 280px;
    box-shadow: var(--shadow-md);
}

/* Dashboard skeleton loading */
.dashboard-skeleton {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
}
