/* =========================
   OdysCash Premium Design System
   Inspired by Apple's design language
========================= */

/* =========================
   Design Tokens / Base
========================= */
:root {
    color-scheme: light;

    /* Premium Color Palette - Sophisticated & Modern */
    --primary-color: #0071e3;
    --primary-hover: #0077ed;
    --primary-soft: rgba(0, 113, 227, 0.08);
    --primary-glow: rgba(0, 113, 227, 0.25);

    --secondary-color: #6e6e73;
    --success-color: #30d158;
    --success-soft: rgba(48, 209, 88, 0.10);
    --warning-color: #ff9f0a;
    --warning-soft: rgba(255, 159, 10, 0.10);
    --danger-color: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.10);
    --info-color: #64d2ff;
    --info-soft: rgba(100, 210, 255, 0.10);

    /* Premium Background Hierarchy */
    --bg-primary: #f5f5f7;
    --bg-secondary: rgba(255, 255, 255, 0.72);
    --bg-card: rgba(255, 255, 255, 0.88);
    --bg-elevated: rgba(255, 255, 255, 0.95);
    --bg-muted: rgba(0, 0, 0, 0.03);
    --bg-glass: rgba(255, 255, 255, 0.65);

    /* Text Colors */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --text-inverse: #ffffff;

    /* Borders & Dividers */
    --border-color: rgba(0, 0, 0, 0.06);
    --border-color-strong: rgba(0, 0, 0, 0.12);
    --divider: rgba(0, 0, 0, 0.08);

    /* Apple-style Border Radius */
    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-2xl: 36px;
    --radius-full: 9999px;

    /* Premium Shadows - Layered & Soft */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.08), 0 4px 8px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.10), 0 8px 16px rgba(0, 0, 0, 0.06);
    --shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.12), 0 12px 24px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 0 4px var(--primary-glow);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --content-max-width: 1440px;

    /* Spacing Scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Smooth Transitions */
    --transition-micro: 100ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-fast: 150ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-base: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-smooth: 350ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --transition-slow: 500ms cubic-bezier(0.25, 0.1, 0.25, 1);

    /* Spring Animation */
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Dark Mode */
.dark {
    color-scheme: dark;

    --primary-color: #0a84ff;
    --primary-hover: #409cff;
    --primary-soft: rgba(10, 132, 255, 0.12);
    --primary-glow: rgba(10, 132, 255, 0.30);

    --secondary-color: #98989d;
    --success-color: #32d74b;
    --success-soft: rgba(50, 215, 75, 0.15);
    --warning-color: #ffd60a;
    --warning-soft: rgba(255, 214, 10, 0.15);
    --danger-color: #ff453a;
    --danger-soft: rgba(255, 69, 58, 0.15);
    --info-color: #64d2ff;
    --info-soft: rgba(100, 210, 255, 0.15);

    --bg-primary: #000000;
    --bg-secondary: rgba(28, 28, 30, 0.85);
    --bg-card: rgba(44, 44, 46, 0.80);
    --bg-elevated: rgba(58, 58, 60, 0.90);
    --bg-muted: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(44, 44, 46, 0.70);

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-muted: #6e6e73;

    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-strong: rgba(255, 255, 255, 0.15);
    --divider: rgba(255, 255, 255, 0.10);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.20);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.30);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.40);
}

/* =========================
   Reset / Normalize
========================= */
html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: inherit;
}

* {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100dvh;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1;
    transition: background-color var(--transition-base), color var(--transition-base);
}

body.sidebar-open {
    overflow: hidden;
}

img, svg, video, canvas {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: 0;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style-position: outside;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

::selection {
    background: rgba(0, 113, 227, 0.20);
}

:focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid var(--primary-glow);
    outline-offset: 2px;
}

/* Custom Scrollbar */
body {
    scrollbar-color: var(--border-color-strong) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color-strong);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* =========================
   Layout Principal
========================= */
.app-container {
    display: flex;
    min-height: 100dvh;
    width: 100%;
}

/* =========================
   Sidebar - Premium Glass Effect
========================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid var(--border-color);
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transform: translateX(0);
    transition: transform var(--transition-smooth) var(--ease-out-expo), 
                box-shadow var(--transition-base),
                background-color var(--transition-base);
    will-change: transform;
    overflow: hidden;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
}

.sidebar-logo {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.sidebar-logo span {
    background: linear-gradient(135deg, var(--primary-color), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 16px;
    margin-bottom: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background-color: var(--bg-muted);
    color: var(--text-primary);
    transform: translateX(2px);
}

.nav-item:active {
    transform: scale(0.98) translateX(2px);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-soft), rgba(88, 86, 214, 0.08));
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: linear-gradient(180deg, var(--primary-color), #5856d6);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.nav-item:hover svg {
    transform: scale(1.05);
}

.sidebar-footer {
    padding: var(--space-5) var(--space-5);
    border-top: 1px solid var(--divider);
    flex-shrink: 0;
    background: var(--bg-muted);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-color), #5856d6);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.user-company {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* =========================
   Main Content
========================= */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    background: var(--bg-primary);
}

/* =========================
   Header - Floating Glass Bar
========================= */
.header {
    height: var(--header-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-6);
    position: sticky;
    top: 0;
    z-index: 50;
    transition: background-color var(--transition-base), 
                border-color var(--transition-base),
                box-shadow var(--transition-base);
}

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

.header-title {
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    min-width: 0;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.menu-toggle {
    display: none;
    padding: 10px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.menu-toggle:hover {
    background-color: var(--bg-muted);
    color: var(--text-primary);
}

.menu-toggle:active {
    transform: scale(0.95);
}

/* =========================
   Content Area
========================= */
.content {
    flex: 1;
    padding: var(--space-6);
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* =========================
   Premium Cards
========================= */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: var(--space-6);
    margin-bottom: var(--space-5);
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--divider);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

/* =========================
   Sections
========================= */
.page-section {
    display: none;
    animation: fadeIn var(--transition-base) var(--ease-out-expo);
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   Dashboard Stats - Premium Grid
========================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    transition: all var(--transition-base) var(--spring);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--stat-accent, var(--primary-color)), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    transition: transform var(--transition-base) var(--spring);
}

.stat-card:hover .stat-icon {
    transform: scale(1.08);
}

.stat-icon.blue {
    --stat-accent: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-soft), rgba(88, 86, 214, 0.08));
    color: var(--primary-color);
}

.stat-icon.green {
    --stat-accent: var(--success-color);
    background: linear-gradient(135deg, var(--success-soft), rgba(48, 209, 88, 0.15));
    color: var(--success-color);
}

.stat-icon.yellow {
    --stat-accent: var(--warning-color);
    background: linear-gradient(135deg, var(--warning-soft), rgba(255, 159, 10, 0.15));
    color: var(--warning-color);
}

.stat-icon.red {
    --stat-accent: var(--danger-color);
    background: linear-gradient(135deg, var(--danger-soft), rgba(255, 69, 58, 0.15));
    color: var(--danger-color);
}

.stat-content {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-1);
    letter-spacing: 0.01em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-feature-settings: 'tnum' 1;
}

.stat-card small {
    display: block;
    margin-top: var(--space-2);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* =========================
   Charts Section
========================= */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.chart-card {
    min-height: 350px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

.chart-container-doughnut {
    height: 280px;
    max-width: 320px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .chart-card {
        min-height: 300px;
    }

    .chart-container {
        height: 240px;
    }

    .chart-container-doughnut {
        height: 240px;
        max-width: 280px;
    }
}

/* =========================
   Premium Buttons
========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 12px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1;
    user-select: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.75;
}

.btn.loading::before {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
    margin-right: var(--space-2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), #5856d6);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.30);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.40);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-color-strong);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #28c840);
    color: white;
    box-shadow: 0 2px 8px rgba(48, 209, 88, 0.30);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #d93025);
    color: white;
    box-shadow: 0 2px 8px rgba(255, 69, 58, 0.30);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8125rem;
}

.btn-icon {
    padding: 10px;
    border-radius: var(--radius-sm);
}

/* =========================
   Premium Forms
========================= */
.form-group {
    margin-bottom: var(--space-5);
    min-width: 0;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:hover {
    border-color: var(--border-color-strong);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:disabled {
    background: var(--bg-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e6e73' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
}

/* =========================
   Filters / Search
========================= */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    align-items: center;
    padding: var(--space-4);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.filters-bar > .form-control,
.filters-bar > .btn {
    min-height: 44px;
}

.filters-bar > .form-control {
    width: auto;
    min-width: 180px;
    padding: 10px 14px;
}

.search-box {
    flex: 1 1 280px;
    min-width: 280px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding-left: 44px;
    background: var(--bg-elevated);
}

.search-box svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.search-box:focus-within svg {
    color: var(--primary-color);
}

/* =========================
   Tables - Desktop
========================= */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
}

.table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--divider);
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    background: var(--bg-muted);
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(0, 113, 227, 0.03);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* =========================
   Mobile Cards - Responsive Data Display
========================= */
.data-cards {
    display: none;
}

.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-4);
    transition: all var(--transition-base);
}

.data-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.data-card:active {
    transform: scale(0.99);
}

.data-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--divider);
}

.data-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.data-card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: var(--space-1);
}

.data-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.data-card-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.data-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.data-card-value {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.data-card-value.highlight {
    font-weight: 700;
    color: var(--primary-color);
}

.data-card-value.danger {
    color: var(--danger-color);
}

.data-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--divider);
}

.data-card-actions {
    display: flex;
    gap: var(--space-2);
}

/* =========================
   Badges / Status - Premium Pill Style
========================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-success {
    background: linear-gradient(135deg, var(--success-soft), rgba(48, 209, 88, 0.15));
    color: var(--success-color);
}

.badge-warning {
    background: linear-gradient(135deg, var(--warning-soft), rgba(255, 159, 10, 0.15));
    color: var(--warning-color);
}

.badge-danger {
    background: linear-gradient(135deg, var(--danger-soft), rgba(255, 69, 58, 0.15));
    color: var(--danger-color);
}

.badge-info {
    background: linear-gradient(135deg, var(--primary-soft), rgba(88, 86, 214, 0.08));
    color: var(--primary-color);
}

/* =========================
   Modal - Premium Overlay
========================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: min(600px, 100%);
    max-height: 90dvh;
    overflow: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(20px);
    transition: transform var(--transition-smooth) var(--spring);
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-6);
    border-bottom: 1px solid var(--divider);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-muted);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--border-color-strong);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-6);
    border-top: 1px solid var(--divider);
    background: var(--bg-muted);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

/* =========================
   Shift Modal Sections
========================= */
#shift-modal .modal {
    width: min(720px, 100%);
}

.modal-section {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--divider);
}

.modal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.modal-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: var(--space-4);
}

#shift-summary {
    display: none;
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--success-soft), rgba(48, 209, 88, 0.05));
    border: 1px solid rgba(48, 209, 88, 0.20);
    border-radius: var(--radius-lg);
    margin-top: var(--space-4);
}

#shift-summary > div {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    font-size: 0.875rem;
}

#shift-summary strong {
    color: var(--text-secondary);
}

#shift-summary-total {
    color: var(--success-color) !important;
    font-weight: 700 !important;
    font-size: 1.125rem !important;
}

/* =========================
   Pagination - Premium Style
========================= */
.pagination-container {
    padding: var(--space-5) 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
    padding: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
}

.btn-paginate {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-paginate:hover:not(.disabled):not(.active) {
    background: var(--bg-muted);
    color: var(--primary-color);
}

.btn-paginate.active {
    background: linear-gradient(135deg, var(--primary-color), #5856d6);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.30);
}

.btn-paginate.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-paginate-arrow {
    min-width: 40px;
    height: 40px;
    padding: 0;
}

.pagination-ellipsis {
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 0 var(--space-2);
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding-left: var(--space-4);
    margin-left: var(--space-2);
    border-left: 1px solid var(--divider);
}

/* =========================
   Toast Notifications - Premium
========================= */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: min(400px, calc(100vw - 48px));
}

.toast {
    padding: 18px 24px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 300px;
    animation: toastIn var(--transition-smooth) var(--spring);
    transition: all var(--transition-base);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

@keyframes toastIn {
    from {
        transform: translateX(100%) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

.toast-success {
    background: linear-gradient(135deg, var(--success-color), #28c840);
    color: white;
}

.toast-error {
    background: linear-gradient(135deg, var(--danger-color), #d93025);
    color: white;
}

/* =========================
   Loading & Spinners
========================= */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================
   Empty State
========================= */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-6);
    color: var(--text-secondary);
}

.empty-state svg {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--space-5);
    opacity: 0.4;
    color: var(--text-muted);
}

.empty-state h3 {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
    font-weight: 600;
}

/* =========================
   Auth Pages
========================= */
.auth-container {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary), #e8e8ed);
    padding: var(--space-6);
}

.auth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-12);
    width: 100%;
    max-width: 440px;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.auth-logo {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: -0.03em;
}

.auth-logo span {
    background: linear-gradient(135deg, var(--primary-color), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-8);
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.auth-footer a {
    color: var(--primary-color);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.auth-footer a:hover {
    color: var(--primary-hover);
}

/* =========================
   WhatsApp Button
========================= */
.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border-radius: var(--radius-full);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.30);
}

.whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.40);
}

/* =========================
   Guide Page
========================= */
.guide-section {
    margin-bottom: var(--space-10);
}

.guide-section h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.guide-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-5);
    font-size: 1rem;
    line-height: 1.7;
}

.guide-section ol {
    padding-left: 28px;
}

.guide-section li {
    margin-bottom: 14px;
    line-height: 1.7;
    color: var(--text-primary);
}

.guide-section li strong {
    color: var(--primary-color);
}

/* =========================
   Lists Page
========================= */
#page-lists .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

#page-lists .card {
    min-height: 200px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    transition: all var(--transition-fast);
}

.list-item:hover {
    background: var(--bg-card);
    border-color: var(--border-color-strong);
    transform: translateX(4px);
}

.list-item:last-child {
    margin-bottom: 0;
}

.list-item > div:first-child {
    flex: 1;
    min-width: 0;
}

.list-item-name {
    font-weight: 500;
    color: var(--text-primary);
    word-break: break-word;
}

.list-item-city {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.list-item .btn-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    min-width: 36px;
}

/* =========================
   Utility Classes
========================= */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.font-bold { font-weight: 700; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* Auth State Visibility */
.auth-only { display: none; }
.guest-only { display: block; }
body.authenticated .auth-only { display: block; }
body.authenticated .guest-only { display: none; }

/* Currency / Numeric */
.currency {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}

/* =========================
   Responsive - Tablet
========================= */
@media (max-width: 1024px) {
    .content {
        padding: var(--space-5);
    }

    .header {
        padding: 0 var(--space-5);
    }

    .dashboard-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }

    .stat-value {
        font-size: 1.5rem;
    }
}

/* =========================
   Responsive - Mobile
========================= */
@media (max-width: 768px) {
    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open,
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .content {
        padding: var(--space-4);
    }

    .header {
        padding: 0 var(--space-4);
    }

    .header-title {
        font-size: 1.125rem;
    }

    .header-actions {
        gap: var(--space-2);
    }

    /* Dashboard Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .stat-card {
        padding: var(--space-5);
    }

    /* Forms Mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Filters Mobile */
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-4);
    }

    .filters-bar > .form-control,
    .filters-bar > .btn {
        width: 100%;
        min-width: 0;
    }

    .search-box {
        min-width: 100%;
        flex-basis: 100%;
    }

    /* Tables -> Cards on Mobile */
    .table-container {
        display: none;
    }

    .data-cards {
        display: block;
    }

    /* Cards Mobile */
    .card {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }

    /* Modal Mobile */
    .modal {
        width: 100%;
        max-height: 95dvh;
        border-radius: var(--radius-xl);
        margin: var(--space-3);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: var(--space-5);
        padding-right: var(--space-5);
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: var(--space-3);
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* Toast Mobile */
    .toast-container {
        left: 16px;
        right: 16px;
        max-width: none;
    }

    .toast {
        min-width: 0;
        width: 100%;
    }

    /* Pagination Mobile */
    .pagination {
        width: 100%;
        padding: var(--space-3);
    }

    .pagination-info {
        width: 100%;
        border-left: 0;
        padding-left: 0;
        margin-left: 0;
        margin-top: var(--space-3);
        padding-top: var(--space-3);
        border-top: 1px solid var(--divider);
        text-align: center;
    }

    /* Shift Summary Mobile */
    #shift-summary > div {
        grid-template-columns: 1fr;
    }

    /* Lists Mobile */
    #page-lists .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   Responsive - Small Mobile
========================= */
@media (max-width: 480px) {
    .auth-card {
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    .auth-logo {
        font-size: 1.875rem;
    }

    /* Full width buttons except icon buttons and list item buttons */
    .modal-footer .btn,
    .filters-bar .btn:not(.btn-icon) {
        width: 100%;
    }

    /* Preserve icon button sizes */
    .btn-icon {
        width: auto;
        min-width: 36px;
    }

    .list-item .btn {
        width: auto;
    }

    .data-card-body {
        grid-template-columns: 1fr;
    }

    .btn-paginate {
        min-width: 36px;
        height: 36px;
    }

    #shift-modal .modal {
        width: 100%;
    }

    .stat-value {
        font-size: 1.375rem;
    }
}

/* =========================
   Reduced Motion
========================= */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* =========================
   Print
========================= */
@media print {
    .sidebar,
    .header,
    .menu-toggle,
    .btn,
    .modal-overlay,
    .toast-container,
    .filters-bar,
    .pagination-container,
    .sidebar-overlay,
    .data-card-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .card,
    .stat-card,
    .table-container,
    .data-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .table-container {
        display: block !important;
        overflow: visible !important;
    }

    .data-cards {
        display: none !important;
    }

    .table {
        min-width: 0 !important;
    }
}
