/* =============================================================================
   COASTAL COMMAND - SHARED DESIGN TOKENS
   Single source of truth for colors, typography, spacing, shadows, and radii.
   Imported by all subdomains: public, admin, customer, drivers.

   Usage:
     <link rel="stylesheet" href="/shared/design-tokens.css">

   Subdomain-specific overrides layer on top of these base tokens.
   ============================================================================= */

/* =============================================================================
   1. COLOR PALETTE
   Canonical brand colors used across all subdomains.
   Subdomains may alias these to their own variable names.
   ============================================================================= */
:root {
    /* --- Brand Primary (Ocean Blue) --- */
    --cc-primary: #0066cc;
    --cc-primary-dark: #0052a3;
    --cc-primary-light: #e6f0fa;

    /* --- Brand Secondary (Eco Green) --- */
    --cc-secondary: #28a745;
    --cc-secondary-dark: #218838;
    --cc-secondary-light: #d4edda;

    /* --- Brand Accent (Action Orange) --- */
    --cc-accent: #ff6b35;
    --cc-accent-dark: #e55a2b;
    --cc-accent-light: #fff0eb;

    /* --- Neutrals --- */
    --cc-text-dark: #1a1a1a;
    --cc-text: #333333;
    --cc-text-gray: #555555;
    --cc-text-light: #777777;
    --cc-text-muted: #999999;

    /* --- Backgrounds --- */
    --cc-bg-white: #ffffff;
    --cc-bg-light: #f8f9fa;
    --cc-bg-section: #f5f5f5;

    /* --- Borders --- */
    --cc-border: #e0e0e0;
    --cc-border-light: #eeeeee;

    /* --- Semantic: Status --- */
    --cc-success: #00a86b;
    --cc-success-dark: #008856;
    --cc-success-bg: #d4edda;
    --cc-success-text: #155724;

    --cc-warning: #f39c12;
    --cc-warning-dark: #d68910;
    --cc-warning-bg: #fff3cd;
    --cc-warning-text: #856404;

    --cc-danger: #e74c3c;
    --cc-danger-dark: #c0392b;
    --cc-danger-bg: #f8d7da;
    --cc-danger-text: #721c24;

    --cc-info: #3498db;
    --cc-info-dark: #2980b9;
    --cc-info-bg: #cce5ff;
    --cc-info-text: #004085;

    /* --- Semantic: Status Badges --- */
    --cc-badge-active-bg: #d4edda;
    --cc-badge-active-text: #155724;
    --cc-badge-pending-bg: #fff3cd;
    --cc-badge-pending-text: #856404;
    --cc-badge-completed-bg: #d4edda;
    --cc-badge-completed-text: #155724;
    --cc-badge-cancelled-bg: #f8d7da;
    --cc-badge-cancelled-text: #721c24;
    --cc-badge-scheduled-bg: #cce5ff;
    --cc-badge-scheduled-text: #004085;

    /* ==========================================================================
       2. TYPOGRAPHY
       ========================================================================== */

    /* --- Font Stacks --- */
    --cc-font-heading: 'Poppins', sans-serif;
    --cc-font-body: 'Open Sans', sans-serif;
    --cc-font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --cc-font-mono: 'Courier New', Consolas, monospace;

    /* --- Font Sizes (modular scale, base 1rem = 16px) --- */
    --cc-text-xs: 0.75rem;   /* 12px */
    --cc-text-sm: 0.85rem;   /* ~14px */
    --cc-text-base: 1rem;    /* 16px */
    --cc-text-md: 1.1rem;    /* ~18px */
    --cc-text-lg: 1.3rem;    /* ~21px */
    --cc-text-xl: 1.5rem;    /* 24px */
    --cc-text-2xl: 2rem;     /* 32px */
    --cc-text-3xl: 2.5rem;   /* 40px */
    --cc-text-4xl: 3.5rem;   /* 56px */

    /* --- Font Weights --- */
    --cc-weight-normal: 400;
    --cc-weight-medium: 500;
    --cc-weight-semibold: 600;
    --cc-weight-bold: 700;

    /* --- Line Heights --- */
    --cc-leading-tight: 1.2;
    --cc-leading-normal: 1.5;
    --cc-leading-relaxed: 1.7;

    /* ==========================================================================
       3. SPACING (4px base unit)
       ========================================================================== */
    --cc-space-1: 0.25rem;   /* 4px */
    --cc-space-2: 0.5rem;    /* 8px */
    --cc-space-3: 0.75rem;   /* 12px */
    --cc-space-4: 1rem;      /* 16px */
    --cc-space-5: 1.25rem;   /* 20px */
    --cc-space-6: 1.5rem;    /* 24px */
    --cc-space-8: 2rem;      /* 32px */
    --cc-space-10: 2.5rem;   /* 40px */
    --cc-space-12: 3rem;     /* 48px */
    --cc-space-16: 4rem;     /* 64px */
    --cc-space-20: 5rem;     /* 80px */

    /* ==========================================================================
       4. SHADOWS
       ========================================================================== */
    --cc-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --cc-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --cc-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --cc-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --cc-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --cc-shadow-xl: 0 10px 50px rgba(0, 0, 0, 0.2);

    /* ==========================================================================
       5. BORDER RADIUS
       ========================================================================== */
    --cc-radius-sm: 4px;
    --cc-radius: 6px;
    --cc-radius-md: 8px;
    --cc-radius-lg: 12px;
    --cc-radius-xl: 16px;
    --cc-radius-2xl: 20px;
    --cc-radius-pill: 50px;
    --cc-radius-circle: 50%;

    /* ==========================================================================
       6. TRANSITIONS
       ========================================================================== */
    --cc-transition-fast: 0.15s ease;
    --cc-transition: 0.2s ease;
    --cc-transition-slow: 0.3s ease;
    --cc-transition-smooth: 0.3s ease-out;

    /* ==========================================================================
       7. LAYOUT
       ========================================================================== */
    --cc-container-sm: 600px;
    --cc-container: 1200px;
    --cc-container-lg: 1400px;

    /* ==========================================================================
       8. Z-INDEX SCALE
       ========================================================================== */
    --cc-z-dropdown: 100;
    --cc-z-sticky: 200;
    --cc-z-fixed: 500;
    --cc-z-overlay: 1000;
    --cc-z-modal: 2000;
    --cc-z-toast: 3000;
    --cc-z-tooltip: 5000;
}


/* =============================================================================
   9. FOCUS-VISIBLE STYLES (Accessibility)
   Visible keyboard focus indicators, invisible for mouse users.
   ============================================================================= */
:focus-visible {
    outline: 2px solid var(--cc-primary, #0066cc);
    outline-offset: 2px;
}

/* Refined focus for inputs -- inset ring instead of outline */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    border-color: var(--cc-primary, #0066cc);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}

/* Buttons get a subtle ring */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
    outline: 2px solid var(--cc-primary, #0066cc);
    outline-offset: 2px;
    border-radius: inherit;
}

/* Remove default outlines only when focus-visible is supported */
:focus:not(:focus-visible) {
    outline: none;
}


/* =============================================================================
   10. SHARED STATUS BADGE CLASSES
   Consistent status indicators across all subdomains.
   ============================================================================= */
.cc-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--cc-radius-pill);
    font-size: var(--cc-text-sm);
    font-weight: var(--cc-weight-semibold);
    line-height: 1;
    white-space: nowrap;
}

.cc-badge-active,
.cc-badge-completed,
.cc-badge-assigned {
    background: var(--cc-badge-active-bg);
    color: var(--cc-badge-active-text);
}

.cc-badge-pending,
.cc-badge-unassigned {
    background: var(--cc-badge-pending-bg);
    color: var(--cc-badge-pending-text);
}

.cc-badge-cancelled,
.cc-badge-error,
.cc-badge-skipped {
    background: var(--cc-badge-cancelled-bg);
    color: var(--cc-badge-cancelled-text);
}

.cc-badge-scheduled,
.cc-badge-info,
.cc-badge-in_progress {
    background: var(--cc-badge-scheduled-bg);
    color: var(--cc-badge-scheduled-text);
}

.cc-badge-warning {
    background: var(--cc-warning-bg);
    color: var(--cc-warning-text);
}
