/* ============================================
   flavIA - Serene Companion Design System
   A warm, accessible interface for elderly care
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap');

/* ============================================
   Design Tokens
   ============================================ */
:root {
    /* Color Palette - Warm & Reassuring */
    --color-cream: #FAF9F7;
    --color-cream-dark: #F0EDE8;
    --color-sage: #6B8E7B;
    --color-sage-light: #8FB09D;
    --color-sage-dark: #4A6B58;
    --color-terracotta: #D4A574;
    --color-terracotta-light: #E8C9A8;
    --color-charcoal: #2D3436;
    --color-slate: #636E72;
    --color-stone: #A0998A;

    /* Semantic Colors */
    --color-success: #7CB89E;
    --color-success-bg: #E8F5EE;
    --color-warning: #E6B86A;
    --color-warning-bg: #FDF6E8;
    --color-danger: #D17B7B;
    --color-danger-bg: #FCEAEA;

    /* Typography */
    --font-display: 'Source Serif 4', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(45, 52, 54, 0.04), 0 1px 2px rgba(45, 52, 54, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 52, 54, 0.06), 0 2px 4px rgba(45, 52, 54, 0.04);
    --shadow-lg: 0 12px 40px rgba(45, 52, 54, 0.08), 0 4px 12px rgba(45, 52, 54, 0.04);
    --shadow-glow: 0 0 40px rgba(107, 142, 123, 0.15);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Sidebar Width */
    --sidebar-width: 280px;
}

/* ============================================
   Base Reset & Defaults
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-charcoal);
    background: var(--color-cream);
    min-height: 100vh;
}

/* Subtle noise texture overlay for depth */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.015;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============================================
   Layout Structure
   ============================================ */
.page {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--color-sage-dark) 0%, var(--color-sage) 50%, var(--color-sage-light) 100%);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

/* Decorative organic shape */
.sidebar::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: 60px;
    left: -30px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Brand Section */
.brand {
    text-align: center;
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: var(--space-lg);
    position: relative;
}

.brand h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-xs);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand small {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.nav-menu li {
    opacity: 0;
    animation: slideInLeft 0.4s ease forwards;
}

.nav-menu li:nth-child(1) { animation-delay: 0.1s; }
.nav-menu li:nth-child(2) { animation-delay: 0.15s; }
.nav-menu li:nth-child(3) { animation-delay: 0.2s; }
.nav-menu li:nth-child(4) { animation-delay: 0.25s; }

.nav-menu a {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--color-terracotta);
    transform: scaleY(0);
    transition: transform var(--transition-base);
    border-radius: 0 2px 2px 0;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    transform: translateX(4px);
}

.nav-menu a:hover::before {
    transform: scaleY(1);
}

.nav-menu a.active {
    background: rgba(255, 255, 255, 0.18);
    color: white;
}

.nav-menu a.active::before {
    transform: scaleY(1);
}

/* ============================================
   Main Content Area
   ============================================ */
.content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--space-2xl) var(--space-3xl);
    background: var(--color-cream);
    min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1 {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-charcoal);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2xl);
    position: relative;
    display: inline-block;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-terracotta), var(--color-terracotta-light));
    border-radius: 2px;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-charcoal);
    letter-spacing: -0.02em;
    margin: var(--space-2xl) 0 var(--space-lg);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.2s;
}

h3 {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-slate);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

p {
    color: var(--color-slate);
    line-height: 1.7;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: white;
    padding: var(--space-xl) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    border: 1px solid rgba(107, 142, 123, 0.08);
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }

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

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

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

/* Card with alert indicator */
.stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, var(--color-danger), #E89B9B);
}

.stat-card h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 0.8rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-sage);
    line-height: 1;
    letter-spacing: -0.04em;
}

.stat-number.alert {
    color: var(--color-danger);
}

/* Decorative accent on cards */
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, var(--color-cream-dark) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* ============================================
   Data Table
   ============================================ */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border-collapse: separate;
    border-spacing: 0;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.3s;
    border: 1px solid rgba(107, 142, 123, 0.08);
}

.data-table thead {
    background: linear-gradient(135deg, var(--color-sage-dark), var(--color-sage));
}

.data-table th {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: white;
    padding: var(--space-lg) var(--space-xl);
    text-align: left;
    position: relative;
}

.data-table th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.data-table td {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-cream-dark);
    font-size: 0.95rem;
    color: var(--color-charcoal);
    transition: background var(--transition-fast);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

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

.data-table tbody tr:hover {
    background: var(--color-cream);
}

.data-table tbody tr:hover td {
    color: var(--color-sage-dark);
}

/* Status badges */
.success {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-success-bg);
    color: var(--color-sage-dark);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.success::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-success);
    border-radius: 50%;
}

.warning {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-warning-bg);
    color: #8B6914;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.warning::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-warning);
    border-radius: 50%;
}

.danger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-danger-bg);
    color: var(--color-danger);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.danger::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--color-danger);
    border-radius: 50%;
}

/* ============================================
   Loading State
   ============================================ */
p:has(+ .data-table),
p:only-child {
    padding: var(--space-2xl);
    text-align: center;
    color: var(--color-slate);
    font-style: italic;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }

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

    h1 {
        font-size: 1.875rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: var(--space-lg);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .sidebar::before,
    .sidebar::after {
        display: none;
    }

    .brand {
        border-bottom: none;
        padding-bottom: 0;
        margin-bottom: 0;
        text-align: left;
    }

    .brand h2 {
        font-size: 1.5rem;
    }

    .brand small {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        gap: var(--space-xs);
        width: 100%;
        margin-top: var(--space-md);
        justify-content: space-around;
    }

    .nav-menu a {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.85rem;
        justify-content: center;
    }

    .nav-menu a::before {
        display: none;
    }

    .content {
        margin-left: 0;
        padding: var(--space-lg);
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: var(--space-lg);
    }

    h1::after {
        width: 40px;
        height: 3px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

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

    .stat-number {
        font-size: 2rem;
    }

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .data-table th,
    .data-table td {
        padding: var(--space-md);
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .content {
        padding: var(--space-md);
    }

    .stats-grid {
        gap: var(--space-sm);
    }

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

    .stat-number {
        font-size: 1.75rem;
    }

    .nav-menu a {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-center { text-align: center; }
.text-muted { color: var(--color-slate); }
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--color-terracotta);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-charcoal: #000;
        --color-slate: #333;
    }

    .stat-card,
    .data-table {
        border: 2px solid var(--color-charcoal);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Enhanced Brand Section
   ============================================ */
.brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-align: left;
}

.brand-logo {
    flex-shrink: 0;
}

.brand-logo svg {
    display: block;
}

.brand-text {
    flex: 1;
}

.brand-text h2 {
    margin-bottom: 0;
}

.brand-text small {
    margin-top: 2px;
}

/* ============================================
   Sidebar Footer
   ============================================ */
.sidebar-footer {
    margin-top: auto;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #7CB89E;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
    box-shadow: 0 0 8px rgba(124, 184, 158, 0.6);
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* ============================================
   Page Header
   ============================================ */
.page-header {
    margin-bottom: var(--space-2xl);
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.page-header h1 {
    margin-bottom: var(--space-sm);
}

.page-subtitle {
    font-size: 1rem;
    color: var(--color-slate);
    margin-top: var(--space-md);
}

/* ============================================
   Enhanced Stat Cards
   ============================================ */
.stat-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-lg);
}

.stat-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-cream);
    border-radius: var(--radius-md);
    color: var(--color-sage);
    transition: all var(--transition-base);
}

.stat-card:hover .stat-icon {
    background: var(--color-sage);
    color: white;
    transform: scale(1.05);
}

.stat-card--alerts .stat-icon {
    color: var(--color-danger);
}

.stat-card--alerts:hover .stat-icon {
    background: var(--color-danger);
}

.stat-content {
    flex: 1;
}

.stat-content h3 {
    margin-bottom: var(--space-sm);
}

/* ============================================
   Section Header
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.section-header h2 {
    margin: 0;
    animation: none;
    opacity: 1;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-cream-dark);
    color: var(--color-slate);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-xl);
}

/* ============================================
   Conversations Section
   ============================================ */
.conversations-section {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
    animation-delay: 0.25s;
}

.table-container {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(107, 142, 123, 0.08);
}

.table-container .data-table {
    animation: none;
    opacity: 1;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

/* ============================================
   Loading State
   ============================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-cream-dark);
    border-top-color: var(--color-sage);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: var(--space-lg);
}

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

.loading-state p {
    color: var(--color-slate);
    font-style: italic;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.empty-state svg {
    color: var(--color-stone);
    margin-bottom: var(--space-lg);
    opacity: 0.6;
}

.empty-state p {
    font-size: 1.1rem;
    color: var(--color-charcoal);
    margin-bottom: var(--space-sm);
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--color-slate);
}

.empty-state--error svg {
    color: var(--color-danger);
}

.empty-state--error p {
    color: var(--color-danger);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn--primary {
    background: var(--color-sage);
    color: white;
}

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

.btn--secondary {
    background: var(--color-cream-dark);
    color: var(--color-charcoal);
    margin-top: var(--space-md);
}

.btn--secondary:hover {
    background: var(--color-cream);
    color: var(--color-sage-dark);
}

/* ============================================
   Table Footer
   ============================================ */
.table-footer {
    display: flex;
    justify-content: center;
    padding: var(--space-lg);
    background: white;
    border-top: 1px solid var(--color-cream-dark);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.view-all-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-sage);
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-base);
}

.view-all-link:hover {
    color: var(--color-sage-dark);
    gap: var(--space-md);
}

.view-all-link svg {
    transition: transform var(--transition-base);
}

.view-all-link:hover svg {
    transform: translateX(4px);
}

/* ============================================
   Status Badges (Enhanced)
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.status-badge.success {
    background: var(--color-success-bg);
    color: var(--color-sage-dark);
}

.status-badge.warning {
    background: var(--color-warning-bg);
    color: #8B6914;
}

.status-badge.danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

/* ============================================
   Table Cell Formatting
   ============================================ */
.phone-number {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.85rem;
    color: var(--color-slate);
    letter-spacing: 0.02em;
}

.duration {
    font-weight: 500;
    color: var(--color-charcoal);
}

.title-text {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

time {
    color: var(--color-slate);
    font-size: 0.9rem;
}

/* ============================================
   Mobile Navigation Enhancements
   ============================================ */
@media (max-width: 768px) {
    .brand {
        flex-direction: row;
    }

    .brand-logo svg {
        width: 28px;
        height: 28px;
    }

    .brand-text h2 {
        font-size: 1.25rem;
    }

    .sidebar-footer {
        display: none;
    }

    .nav-menu a span {
        display: none;
    }

    .nav-menu a svg {
        margin: 0;
    }

    .stat-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .stat-icon svg {
        width: 20px;
        height: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-footer {
        padding: var(--space-md);
    }

    .view-all-link {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .empty-state,
    .loading-state {
        padding: var(--space-xl);
    }

    .title-text {
        max-width: 120px;
    }
}

/* ============================================
   Login Page Styles
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-cream) 0%, var(--color-cream-dark) 100%);
    padding: var(--space-lg);
    position: relative;
    overflow: hidden;
}

.login-background {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
}

.bg-shape--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--color-sage-light) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    animation: float 20s ease-in-out infinite;
}

.bg-shape--2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--color-terracotta-light) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    animation: float 15s ease-in-out infinite reverse;
}

.bg-shape--3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--color-sage) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    animation: pulse 10s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.login-container {
    display: flex;
    gap: var(--space-3xl);
    max-width: 1000px;
    width: 100%;
    position: relative;
    z-index: 1;
}

.login-card {
    flex: 1;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.login-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.login-logo {
    display: inline-flex;
    margin-bottom: var(--space-md);
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-charcoal);
    margin-bottom: var(--space-xs);
    animation: none;
    opacity: 1;
}

.login-header h1::after {
    display: none;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--color-slate);
    margin: 0;
}

/* Alert */
.alert {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

.alert--error {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.alert svg {
    flex-shrink: 0;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-charcoal);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--space-md);
    color: var(--color-stone);
    pointer-events: none;
    transition: color var(--transition-base);
}

.form-input {
    width: 100%;
    padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) * 2 + 20px);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-charcoal);
    background: var(--color-cream);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-base);
}

.form-input::placeholder {
    color: var(--color-stone);
}

.form-input:focus {
    background: white;
    border-color: var(--color-sage);
    box-shadow: 0 0 0 4px rgba(107, 142, 123, 0.1);
}

.form-input:focus + .input-icon,
.input-wrapper:focus-within .input-icon {
    color: var(--color-sage);
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.password-toggle {
    position: absolute;
    right: var(--space-md);
    background: none;
    border: none;
    color: var(--color-stone);
    cursor: pointer;
    padding: var(--space-xs);
    display: flex;
    transition: color var(--transition-base);
}

.password-toggle:hover {
    color: var(--color-sage);
}

.validation-message {
    font-size: 0.8rem;
    color: var(--color-danger);
    margin-top: var(--space-xs);
}

/* Login Button */
.btn-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    margin-top: var(--space-md);
}

.btn-login:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(107, 142, 123, 0.3);
}

.btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-cream-dark);
}

.login-footer p {
    font-size: 0.85rem;
    color: var(--color-slate);
    margin: 0;
}

/* Info Panel */
.login-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-xl);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    animation-delay: 0.2s;
}

.login-info h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-charcoal);
    margin-bottom: var(--space-md);
    animation: none;
    opacity: 1;
}

.login-info > p {
    font-size: 1.1rem;
    color: var(--color-slate);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--color-charcoal);
    font-size: 1rem;
}

.feature-list svg {
    flex-shrink: 0;
    color: var(--color-sage);
}

/* User Info in Sidebar */
.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
}

.user-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 50%;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: capitalize;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Sidebar footer with user */
.sidebar-footer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

/* Responsive Login */
@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .login-card {
        max-width: 100%;
    }

    .login-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-page {
        padding: var(--space-md);
    }

    .login-card {
        padding: var(--space-xl);
    }

    .login-header h1 {
        font-size: 1.75rem;
    }

    .bg-shape--1,
    .bg-shape--2 {
        display: none;
    }
}

/* Mobile sidebar user info */
@media (max-width: 768px) {
    .sidebar-footer {
        display: none;
    }
}
