/**
 * Fluent 2 Design System - Camping Municipal
 * Color Principal: Orange (#FF8C00, #F7630C)
 * Basado en Microsoft Fluent 2
 */

/* ===== RESET Y VARIABLES ===== */
:root {
    /* Fluent Orange Palette */
    --fluent-orange-primary: #F7630C;
    --fluent-orange-dark: #C50F1F;
    --fluent-orange-light: #FFB900;
    --fluent-orange-hover: #FF8C00;
    --fluent-orange-active: #D83B01;

    /* Neutral Palette */
    --fluent-neutral-bg: #FAF9F8;
    --fluent-neutral-bg-alt: #F3F2F1;
    --fluent-neutral-border: #EDEBE9;
    --fluent-neutral-text: #323130;
    --fluent-neutral-secondary: #605E5C;
    --fluent-neutral-tertiary: #8A8886;
    --fluent-white: #FFFFFF;

    /* Semantic Colors */
    --fluent-success: #107C10;
    --fluent-warning: #FFB900;
    --fluent-error: #D13438;
    --fluent-info: #0078D4;

    /* Shadows - Fluent 2 style */
    --shadow-2: 0 0.3px 0.9px rgba(0, 0, 0, 0.1), 0 1.6px 3.6px rgba(0, 0, 0, 0.13);
    --shadow-4: 0 0.6px 1.8px rgba(0, 0, 0, 0.11), 0 3.2px 7.2px rgba(0, 0, 0, 0.13);
    --shadow-8: 0 1.2px 3.6px rgba(0, 0, 0, 0.11), 0 6.4px 14.4px rgba(0, 0, 0, 0.13);
    --shadow-16: 0 2.4px 7.2px rgba(0, 0, 0, 0.11), 0 12.8px 28.8px rgba(0, 0, 0, 0.13);

    /* Layout */
    --header-height: 60px;
    --sidebar-width: 260px;
    --border-radius: 4px;
    --border-radius-large: 8px;

    /* Typography */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    --font-size-base: 14px;
    --font-size-sm: 12px;
    --font-size-lg: 16px;
    --font-size-xl: 20px;
    --font-size-xxl: 28px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--fluent-neutral-text);
    background-color: var(--fluent-neutral-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LAYOUT PRINCIPAL ===== */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--fluent-white);
    border-bottom: 1px solid var(--fluent-neutral-border);
    box-shadow: var(--shadow-2);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 var(--space-lg);
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    color: var(--fluent-neutral-text);
}

.app-logo img {
    height: 40px;
    width: auto;
}

.app-logo-text {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--fluent-orange-primary);
}

.app-body {
    display: flex;
    margin-top: var(--header-height);
    flex: 1;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--fluent-white);
    border-right: 1px solid var(--fluent-neutral-border);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    transition: transform 0.3s ease;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-xl);
    max-width: 100%;
}

.app-footer {
    background: var(--fluent-white);
    border-top: 1px solid var(--fluent-neutral-border);
    padding: var(--space-lg);
    text-align: center;
    color: var(--fluent-neutral-secondary);
    font-size: var(--font-size-sm);
    margin-left: var(--sidebar-width);
}

/* ===== NAVEGACIÓN ===== */
.nav-menu {
    list-style: none;
    padding: var(--space-sm);
}

.nav-item {
    margin-bottom: var(--space-xs);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    color: var(--fluent-neutral-text);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
    font-weight: 400;
}

.nav-link:hover {
    background-color: var(--fluent-neutral-bg-alt);
    color: var(--fluent-orange-primary);
}

.nav-link.active {
    background-color: var(--fluent-orange-primary);
    color: var(--fluent-white);
    font-weight: 600;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* ===== TARJETAS (CARDS) ===== */
.card {
    background: var(--fluent-white);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius-large);
    padding: var(--space-lg);
    box-shadow: var(--shadow-2);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-4);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--fluent-neutral-border);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--fluent-neutral-text);
    margin: 0;
}

.card-body {
    margin-top: var(--space-md);
}

.card-footer {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--fluent-neutral-border);
}

/* ===== STAT CARDS (Dashboard) ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--fluent-white);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius-large);
    padding: var(--space-lg);
    box-shadow: var(--shadow-2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--fluent-orange-primary);
}

.stat-card.blue::before {
    background: var(--fluent-info);
}

.stat-card.green::before {
    background: var(--fluent-success);
}

.stat-card.orange::before {
    background: var(--fluent-orange-primary);
}

.stat-card.red::before {
    background: var(--fluent-error);
}

.stat-card.yellow::before {
    background: var(--fluent-warning);
}

.stat-value {
    font-size: var(--font-size-xxl);
    font-weight: 700;
    color: var(--fluent-neutral-text);
    margin: var(--space-sm) 0;
}

.stat-label {
    font-size: var(--font-size-sm);
    color: var(--fluent-neutral-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fluent-neutral-bg-alt);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-sm);
    font-size: 24px;
    color: var(--fluent-orange-primary);
}

/* ===== BOTONES - Fluent Style ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--fluent-orange-primary);
    color: var(--fluent-white);
    border-color: var(--fluent-orange-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--fluent-orange-hover);
    border-color: var(--fluent-orange-hover);
    box-shadow: var(--shadow-4);
}

.btn-primary:active:not(:disabled) {
    background: var(--fluent-orange-active);
    border-color: var(--fluent-orange-active);
}

.btn-secondary {
    background: var(--fluent-white);
    color: var(--fluent-neutral-text);
    border-color: var(--fluent-neutral-border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--fluent-neutral-bg-alt);
    border-color: var(--fluent-neutral-secondary);
}

.btn-success {
    background: var(--fluent-success);
    color: var(--fluent-white);
}

.btn-success:hover:not(:disabled) {
    background: #0e6b0e;
    box-shadow: var(--shadow-4);
}

.btn-danger {
    background: var(--fluent-error);
    color: var(--fluent-white);
}

.btn-danger:hover:not(:disabled) {
    background: #b72b2f;
    box-shadow: var(--shadow-4);
}

.btn-warning {
    background: var(--fluent-warning);
    color: var(--fluent-neutral-text);
}

.btn-warning:hover:not(:disabled) {
    background: #eca400;
    box-shadow: var(--shadow-4);
}

.btn-info {
    background: var(--fluent-info);
    color: var(--fluent-white);
}

.btn-info:hover:not(:disabled) {
    background: #0062a8;
    box-shadow: var(--shadow-4);
}

.btn-sm {
    padding: 4px 12px;
    font-size: var(--font-size-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: var(--font-size-lg);
}

.btn-icon-only {
    padding: var(--space-sm);
    aspect-ratio: 1;
}

/* ===== FORMULARIOS - Fluent Style ===== */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--fluent-neutral-text);
    font-size: var(--font-size-base);
}

.form-control,
.form-input,
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--fluent-neutral-text);
    background: var(--fluent-white);
    transition: all 0.2s ease;
}

.form-control:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--fluent-orange-primary);
    box-shadow: 0 0 0 2px rgba(247, 99, 12, 0.2);
}

.form-control:disabled,
.form-input:disabled,
.form-select:disabled {
    background: var(--fluent-neutral-bg-alt);
    color: var(--fluent-neutral-tertiary);
    cursor: not-allowed;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--fluent-orange-primary);
    border-color: var(--fluent-orange-primary);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* ===== TABLAS - Fluent Style ===== */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--fluent-white);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius-large);
    overflow: hidden;
}

.table thead {
    background: var(--fluent-neutral-bg-alt);
}

.table th {
    padding: var(--space-md);
    text-align: left;
    font-weight: 600;
    color: var(--fluent-neutral-text);
    border-bottom: 2px solid var(--fluent-neutral-border);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    padding: var(--space-md);
    border-bottom: 1px solid var(--fluent-neutral-border);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background: var(--fluent-neutral-bg);
}

/* ===== BADGES & PILLS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    background: var(--fluent-neutral-bg-alt);
    color: var(--fluent-neutral-text);
}

.badge-primary {
    background: var(--fluent-orange-primary);
    color: var(--fluent-white);
}

.badge-success {
    background: var(--fluent-success);
    color: var(--fluent-white);
}

.badge-danger {
    background: var(--fluent-error);
    color: var(--fluent-white);
}

.badge-warning {
    background: var(--fluent-warning);
    color: var(--fluent-neutral-text);
}

.badge-info {
    background: var(--fluent-info);
    color: var(--fluent-white);
}

.badge-user {
    background: var(--fluent-neutral-secondary);
    color: var(--fluent-white);
}

/* Custom added to map old 'badge-user' */

/* ===== ALERTS ===== */
.alert {
    padding: var(--space-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--space-lg);
    border-left: 4px solid;
}

.alert-success {
    background: #DFF6DD;
    border-left-color: var(--fluent-success);
    color: #0e6b0e;
}

.alert-danger,
.alert-error {
    /* Mapped alert-error to alert-danger for compatibility */
    background: #FDE7E9;
    border-left-color: var(--fluent-error);
    color: #b72b2f;
}

.alert-warning {
    background: #FFF4CE;
    border-left-color: var(--fluent-warning);
    color: #8a6d00;
}

.alert-info {
    background: #E1F5FE;
    border-left-color: var(--fluent-info);
    color: #0062a8;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--fluent-white);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-16);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--fluent-neutral-border);
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--fluent-neutral-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

/* ===== UTILIDADES ===== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.text-primary {
    color: var(--fluent-orange-primary);
}

.text-success {
    color: var(--fluent-success);
}

.text-danger {
    color: var(--fluent-error);
}

.text-warning {
    color: var(--fluent-warning);
}

.text-info {
    color: var(--fluent-info);
}

.text-muted {
    color: var(--fluent-neutral-tertiary);
}

.bg-primary {
    background-color: var(--fluent-orange-primary);
}

.bg-white {
    background-color: var(--fluent-white);
}

.bg-light {
    background-color: var(--fluent-neutral-bg-alt);
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: var(--space-xs);
}

.mt-2 {
    margin-top: var(--space-sm);
}

.mt-3 {
    margin-top: var(--space-md);
}

.mt-4 {
    margin-top: var(--space-lg);
}

.mt-5 {
    margin-top: var(--space-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: var(--space-xs);
}

.mb-2 {
    margin-bottom: var(--space-sm);
}

.mb-3 {
    margin-bottom: var(--space-md);
}

.mb-4 {
    margin-bottom: var(--space-lg);
}

.mb-5 {
    margin-bottom: var(--space-xl);
}

.d-flex {
    display: flex;
}

.d-block {
    display: block;
}

.d-inline-block {
    display: inline-block;
}

.d-none {
    display: none;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: var(--space-xs);
}

.gap-2 {
    gap: var(--space-sm);
}

.gap-3 {
    gap: var(--space-md);
}

.gap-4 {
    gap: var(--space-lg);
}

.w-100 {
    width: 100%;
}

/* ===== ICONOS FLUENT (SVG via CDN) ===== */
.icon,
.nav-icon-img,
.btn-icon-img,
.stat-icon-img {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.nav-link .nav-icon-img {
    width: 20px;
    height: 20px;
}

.btn .btn-icon-img {
    width: 18px;
    height: 18px;
}

.stat-icon-img {
    width: 24px;
    height: 24px;
}

/* ===== RESPONSIVE DESIGN ===== */
/* Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--space-sm);
    cursor: pointer;
    color: var(--fluent-orange-primary);
    font-size: 24px;
}

/* Tablet */
@media (max-width: 1024px) {
    .app-main {
        margin-left: 0;
        padding: var(--space-lg);
    }

    .app-footer {
        margin-left: 0;
    }

    .app-sidebar {
        transform: translateX(-100%);
        z-index: 999;
        box-shadow: var(--shadow-16);
    }

    .app-sidebar.active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .app-header {
        padding: 0 var(--space-md);
    }

    .app-logo-text {
        font-size: var(--font-size-lg);
    }

    .app-main {
        padding: var(--space-md);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .card {
        padding: var(--space-md);
    }

    .table {
        font-size: var(--font-size-sm);
    }

    .table th,
    .table td {
        padding: var(--space-sm);
    }

    /* Botones responsivos */
    .btn {
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* Ocultar textos en móvil, solo iconos */
    .btn-text-hide-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 13px;
        --space-lg: 16px;
        --space-xl: 24px;
    }

    .app-logo img {
        height: 32px;
    }

    .app-logo-text {
        display: none;
    }

    .modal {
        width: 95%;
        max-height: 95vh;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .app-header,
    .app-sidebar,
    .app-footer,
    .btn,
    .menu-toggle {
        display: none !important;
    }

    .app-main {
        margin-left: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.slide-in {
    animation: slideIn 0.3s ease;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--fluent-neutral-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--fluent-neutral-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fluent-neutral-secondary);
}

/* Helper Mappings for Old Classes */
.glass-panel {
    background: var(--fluent-white);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: var(--border-radius-large);
    padding: var(--space-lg);
    box-shadow: var(--shadow-2);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-lg);
}

/* ===== RESPONSIVE TABLES ===== */
@media screen and (max-width: 768px) {
    .table-mobile {
        border: 0;
        background: transparent;
    }

    .table-mobile thead {
        border: none;
        clip: rect(0 0 0 0);
        height: 1px;
        margin: -1px;
        overflow: hidden;
        padding: 0;
        position: absolute;
        width: 1px;
    }

    .table-mobile tr {
        background: var(--fluent-white);
        border: 1px solid var(--fluent-neutral-border);
        border-radius: var(--border-radius-large);
        display: block;
        margin-bottom: var(--space-md);
        box-shadow: var(--shadow-2);
    }

    .table-mobile td {
        border-bottom: 1px solid var(--fluent-neutral-border);
        display: block;
        font-size: var(--font-size-base);
        text-align: right;
        padding: var(--space-md);
        position: relative;
    }

    .table-mobile td:last-child {
        border-bottom: 0;
    }

    .table-mobile td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        color: var(--fluent-neutral-secondary);
        font-size: var(--font-size-sm);
    }

    .table-mobile td.actions {
        display: flex;
        justify-content: flex-end;
        gap: var(--space-sm);
    }

    .table-mobile td.actions::before {
        content: "Acciones";
        display: flex;
        align-items: center;
        margin-right: auto;
    }
}

/* ===== ESTADISTICAS MODULE - PREMIUM DESIGN ===== */

/* 1. Header Container */
.stats-header {
    background: var(--fluent-white);
    border-radius: 16px;
    padding: 16px 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Soft, deep shadow */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

/* 2. Navigation - Modern Tabs */
.stats-nav {
    display: flex;
    gap: 8px;
    background: var(--fluent-neutral-bg-alt);
    padding: 4px;
    border-radius: 12px;
}

.stats-nav .nav-link {
    border: none;
    background: transparent;
    color: var(--fluent-neutral-secondary);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    text-decoration: none;
}

.stats-nav .nav-link:hover {
    color: var(--fluent-neutral-text);
    background: rgba(255, 255, 255, 0.5);
}

.stats-nav .nav-link.active {
    background: var(--fluent-white);
    color: var(--fluent-orange-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.stats-nav .nav-link i {
    font-size: 1.1em;
}

/* 3. Filters Section */
.stats-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.date-group {
    display: flex;
    align-items: center;
    background: var(--fluent-white);
    border: 1px solid var(--fluent-neutral-border);
    border-radius: 10px;
    padding: 4px 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.date-group:focus-within {
    border-color: var(--fluent-orange-primary);
    box-shadow: 0 0 0 3px rgba(247, 99, 12, 0.1);
}

.date-group input[type="date"] {
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 0.9rem;
    color: var(--fluent-neutral-text);
    padding: 6px;
    outline: none;
    cursor: pointer;
}

.date-separator {
    color: var(--fluent-neutral-tertiary);
    font-weight: bold;
    margin: 0 4px;
}

.filter-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: none;
    background: var(--fluent-orange-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 2px 5px rgba(247, 99, 12, 0.3);
}

.filter-btn:hover {
    background: var(--fluent-orange-hover);
    transform: translateY(-2px);
}

.action-group {
    display: flex;
    gap: 8px;
    margin-left: 8px;
    padding-left: 12px;
    border-left: 2px solid var(--fluent-neutral-border);
}

/* 4. KPI Cards - Premium */
.kpi-card-new {
    background: var(--fluent-white);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kpi-card-new:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.kpi-icon-bg {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 5rem;
    opacity: 0.05;
    transform: rotate(15deg);
    color: var(--fluent-neutral-text);
}

.kpi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.kpi-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-icon-primary {
    background: rgba(247, 99, 12, 0.1);
    color: var(--fluent-orange-primary);
}

.kpi-icon-success {
    background: rgba(16, 124, 16, 0.1);
    color: var(--fluent-success);
}

.kpi-icon-info {
    background: rgba(0, 120, 212, 0.1);
    color: var(--fluent-info);
}

.kpi-icon-warning {
    background: rgba(255, 185, 0, 0.1);
    color: #9e7305;
}

/* Darker yellow for text */

.kpi-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fluent-neutral-secondary);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--fluent-neutral-text);
    line-height: 1.2;
}

.kpi-subtext {
    font-size: 0.85rem;
    color: var(--fluent-neutral-tertiary);
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-nav {
        overflow-x: auto;
    }

    .stats-filters {
        flex-wrap: wrap;
    }

    .date-group {
        flex: 1;
    }
}