/* CoralLedger Manager - Design System Styles */
/* Bloomberg Terminal meets Caribbean Elegance */

/* ==========================================
   CSS VARIABLES - MANAGER CONSOLE PALETTE
   ========================================== */
:root {
    /* Primary Colors */
    --cl-primary: #00B4D8;
    --cl-primary-dark: #0096c7;
    --cl-primary-light: #48cae4;

    /* Secondary Colors */
    --cl-secondary: #003566;
    --cl-secondary-dark: #001d3d;
    --cl-secondary-light: #004080;

    /* Data Visualization Palette */
    --cl-chart-1: #00B4D8;  /* Ocean */
    --cl-chart-2: #FF6B6B;  /* Coral */
    --cl-chart-3: #FFD93D;  /* Gold */
    --cl-chart-4: #06D6A0;  /* Success */
    --cl-chart-5: #4ECDC4;  /* Turquoise */

    /* Status Colors */
    --cl-status-live: #06D6A0;
    --cl-status-warning: #FFB700;
    --cl-status-critical: #EF476F;
    --cl-status-offline: #6C757D;
    --cl-success: #06D6A0;
    --cl-warning: #FFB700;
    --cl-error: #EF476F;
    --cl-info: #00B4D8;

    /* Backgrounds - Muted for data density */
    --cl-bg-primary: #FFFFFF;
    --cl-bg-secondary: #F8FAFB;
    --cl-bg-tertiary: #E7F6F8;
    --cl-background: #f5f5f5;
    --cl-surface: #ffffff;

    /* Text */
    --cl-text-primary: #1A1A2E;
    --cl-text-secondary: #6C757D;
    --cl-text-muted: #ADB5BD;

    /* Fonts */
    --cl-font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --cl-space-xs: 4px;
    --cl-space-sm: 8px;
    --cl-space-md: 16px;
    --cl-space-lg: 24px;
    --cl-space-xl: 32px;

    /* Border Radius */
    --cl-radius-sm: 4px;
    --cl-radius-md: 8px;
    --cl-radius-lg: 12px;
    --cl-radius-xl: 24px;

    /* Shadows */
    --cl-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --cl-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --cl-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
}

/* ==========================================
   BASE STYLES - MANAGER CONSOLE
   ========================================== */
html, body {
    margin: 0;
    padding: 0;
    font-family: var(--cl-font-family);
    font-size: 14px; /* Smaller for data density */
    background-color: var(--cl-bg-secondary);
    color: var(--cl-text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--cl-bg-secondary);
    border-radius: var(--cl-radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--cl-text-muted);
    border-radius: var(--cl-radius-sm);
}

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

/* Links */
a {
    color: var(--cl-primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--cl-primary-dark);
}

/* ==========================================
   TYPOGRAPHY - INFORMATION HIERARCHY
   ========================================== */
.manager-console {
    font-size: 14px;
}

/* Metric Display */
.metric-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--cl-text-primary);
}

.metric-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cl-text-secondary);
}

.metric-change {
    font-size: 12px;
    font-weight: 500;
}

.metric-change.positive {
    color: var(--cl-status-live);
}

.metric-change.negative {
    color: var(--cl-status-critical);
}

/* ==========================================
   NAVIGATION STYLES
   ========================================== */

/* Store Badge */
.store-badge {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--cl-radius-xl);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.2);
}

.store-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 180, 216, 0.3);
}

.store-badge.single-store {
    background: linear-gradient(135deg, #4ECDC4, #00B4D8);
    color: white;
}

.store-badge.all-stores {
    background: linear-gradient(135deg, #FFD93D, #FFC93D);
    color: var(--cl-text-primary);
}

.store-badge.offline {
    background: linear-gradient(135deg, #6C757D, #495057);
    color: white;
}

/* Nav Link Active State */
.mud-nav-link.active,
.nav-link-active {
    border-left: 3px solid var(--cl-primary);
    background: rgba(0, 180, 216, 0.08) !important;
}

.mud-nav-link:hover {
    background: rgba(0, 180, 216, 0.04) !important;
}

/* ==========================================
   CARD & PANEL STYLES
   ========================================== */
.cl-card {
    background: var(--cl-surface);
    border-radius: var(--cl-radius-lg);
    box-shadow: var(--cl-shadow-sm);
    padding: var(--cl-space-lg);
    margin-bottom: var(--cl-space-md);
}

.cl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--cl-space-md);
    padding-bottom: var(--cl-space-sm);
    border-bottom: 1px solid var(--cl-bg-tertiary);
}

/* KPI Cards - Manager Style */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--cl-space-md);
    margin-bottom: var(--cl-space-lg);
}

.kpi-card {
    background: var(--cl-surface);
    border-radius: var(--cl-radius-lg);
    padding: var(--cl-space-lg);
    box-shadow: var(--cl-shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.kpi-card .kpi-value {
    font-size: 32px;
    font-weight: 700;
}

.kpi-card .kpi-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cl-text-secondary);
}

/* KPI Card with accent */
.kpi-card.primary { border-left: 4px solid var(--cl-primary); }
.kpi-card.success { border-left: 4px solid var(--cl-success); }
.kpi-card.warning { border-left: 4px solid var(--cl-warning); }
.kpi-card.error { border-left: 4px solid var(--cl-error); }

/* ==========================================
   DATA TABLE PATTERNS
   ========================================== */
.manager-table {
    font-size: 14px;
}

/* Desktop: Full table */
@media (min-width: 1024px) {
    .manager-table {
        display: table;
    }
}

/* Tablet: Condensed */
@media (max-width: 1023px) {
    .manager-table {
        font-size: 13px;
    }
    .manager-table .hide-tablet {
        display: none;
    }
}

/* Mobile: Card view */
@media (max-width: 767px) {
    .manager-table tr {
        display: block;
        border: 1px solid var(--cl-bg-tertiary);
        margin-bottom: var(--cl-space-sm);
        border-radius: var(--cl-radius-md);
        padding: var(--cl-space-sm);
    }
    .manager-table td {
        display: flex;
        justify-content: space-between;
        padding: var(--cl-space-xs) 0;
    }
    .manager-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--cl-text-secondary);
    }
}

/* ==========================================
   STATUS INDICATORS
   ========================================== */
.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.live { background-color: var(--cl-status-live); }
.status-indicator.warning { background-color: var(--cl-status-warning); }
.status-indicator.offline { background-color: var(--cl-status-offline); }
.status-indicator.critical { background-color: var(--cl-status-critical); }

/* Sync Status */
.sync-status {
    display: flex;
    align-items: center;
    gap: var(--cl-space-sm);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
}

.sync-status.online {
    background: rgba(6, 214, 160, 0.15);
    color: var(--cl-status-live);
}

.sync-status.offline {
    background: rgba(108, 117, 125, 0.15);
    color: var(--cl-status-offline);
}

.sync-status.syncing {
    background: rgba(0, 180, 216, 0.15);
    color: var(--cl-primary);
}

.sync-status.pending {
    background: rgba(255, 183, 0, 0.15);
    color: var(--cl-status-warning);
}

.sync-status.error {
    background: rgba(239, 71, 111, 0.15);
    color: var(--cl-status-critical);
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.sync-status.syncing .sync-indicator {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ==========================================
   ACTIVITY FEED ANIMATION
   ========================================== */
.activity-item {
    animation: slideInRight 0.3s ease-out;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
}

.activity-item:hover {
    border-left-color: var(--cl-chart-1);
}

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

/* ==========================================
   OFFLINE BANNER
   ========================================== */
.offline-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--cl-space-sm) var(--cl-space-md);
    background: linear-gradient(135deg, #FFB700, #FF9500);
    color: var(--cl-text-primary);
    font-size: 13px;
    font-weight: 500;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.text-primary { color: var(--cl-primary) !important; }
.text-secondary { color: var(--cl-text-secondary) !important; }
.text-success { color: var(--cl-success) !important; }
.text-warning { color: var(--cl-warning) !important; }
.text-error { color: var(--cl-error) !important; }

.bg-primary { background-color: var(--cl-primary) !important; }
.bg-secondary { background-color: var(--cl-secondary) !important; }
.bg-surface { background-color: var(--cl-surface) !important; }

/* Page Container */
.page-container {
    padding: var(--cl-space-lg);
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================================
   RESPONSIVE BREAKPOINTS
   ========================================== */

/* Desktop large */
@media (min-width: 1280px) {
    .hide-desktop-large { display: none !important; }
}

/* iPad Pro landscape */
@media (min-width: 1024px) and (max-width: 1279px) {
    .hide-tablet-landscape { display: none !important; }
}

/* iPad portrait */
@media (min-width: 768px) and (max-width: 1023px) {
    .hide-tablet-portrait { display: none !important; }

    .page-container {
        padding: var(--cl-space-md);
    }
}

/* Phones - limited features */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }

    .page-container {
        padding: var(--cl-space-sm);
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .kpi-card .kpi-value {
        font-size: 24px;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */
@media print {
    .no-print,
    .mud-drawer,
    .mud-appbar,
    .bottom-nav,
    .command-palette-overlay,
    .store-badge,
    .sync-status {
        display: none !important;
    }

    body {
        background: white;
    }

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

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

/* Focus visible */
:focus-visible {
    outline: 2px solid var(--cl-primary);
    outline-offset: 2px;
}

/* Touch targets */
@media (pointer: coarse) {
    .mud-button,
    .mud-icon-button,
    .mud-nav-link,
    .bottom-nav-item {
        min-height: 44px;
        min-width: 44px;
    }
}
