/* ============================================================
   CR Tools — Main CSS
   Identidad visual Carrasco y Reyes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    /* Brand Colors */
    --cr-primary:    #003366;
    --cr-secondary:  #0056b3;
    --cr-accent:     #00AEEF;
    --cr-success:    #28a745;
    --cr-warning:    #ffc107;
    --cr-danger:     #dc3545;
    --cr-light:      #f5f7fa;
    --cr-dark:       #1f2937;

    /* Derived */
    --cr-primary-rgb:   0, 51, 102;
    --cr-accent-rgb:    0, 174, 239;
    --cr-primary-hover: #002244;
    --cr-accent-hover:  #0095cc;

    /* Gradients */
    --cr-gradient-hero:   linear-gradient(135deg, #003366 0%, #0056b3 50%, #00AEEF 100%);
    --cr-gradient-card:   linear-gradient(135deg, rgba(0,51,102,0.05) 0%, rgba(0,174,239,0.05) 100%);
    --cr-gradient-glass:  linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);

    /* Typography */
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Courier New', monospace;

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

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg:  0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 30px rgba(0,174,239,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);

    /* Z-index */
    --z-navbar:  1030;
    --z-overlay: 1040;
    --z-modal:   1050;
    --z-toast:   1060;

    /* Surface Colors (light mode) */
    --surface-bg:      #ffffff;
    --surface-1:       #f5f7fa;
    --surface-2:       #eef2f7;
    --surface-border:  #e2e8f0;
    --text-primary:    #1f2937;
    --text-secondary:  #6b7280;
    --text-muted:      #9ca3af;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] {
    --surface-bg:     #0d1117;
    --surface-1:      #161b22;
    --surface-2:      #1c2230;
    --surface-border: #30363d;
    --text-primary:   #e6edf3;
    --text-secondary: #8b949e;
    --text-muted:     #656d76;
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:  0 4px 6px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg:  0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
    --cr-gradient-card: linear-gradient(135deg, rgba(0,51,102,0.15) 0%, rgba(0,174,239,0.08) 100%);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--surface-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.display-hero {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: var(--cr-gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-accent { color: var(--cr-accent) !important; }
.text-primary-cr { color: var(--cr-primary) !important; }

.font-mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar-cr {
    background: var(--cr-primary);
    backdrop-filter: blur(10px);
    padding: 0.6rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
    transition: all var(--transition-base);
    z-index: var(--z-navbar);
}

.navbar-cr .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.navbar-cr .navbar-nav .nav-link:hover,
.navbar-cr .navbar-nav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.12);
}

.navbar-cr .navbar-toggler {
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
}

.navbar-cr .navbar-toggler-icon {
    filter: invert(1);
}

/* Brand */
.brand-icon svg { border-radius: var(--radius-sm); }

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.01em;
}

.brand-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.6);
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Dropdown */
.dropdown-menu-cr {
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    min-width: 260px;
    background: var(--surface-bg);
}

[data-bs-theme="dark"] .dropdown-menu-cr {
    background: var(--surface-1);
    border-color: var(--surface-border);
}

.dropdown-menu-cr .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dropdown-menu-cr .dropdown-item:hover {
    background: var(--cr-gradient-card);
    color: var(--cr-secondary);
}

.dropdown-menu-cr .dropdown-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 0.75rem 0.25rem;
}

/* Buttons */
.btn-ghost-cr {
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    transition: all var(--transition-fast);
}

.btn-ghost-cr:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.btn-cr-outline {
    border: 1.5px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}

.btn-cr-outline:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    border-color: rgba(255,255,255,0.6);
}

/* Primary CTA Button */
.btn-cr-primary {
    background: var(--cr-gradient-hero);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(0,174,239,0.3);
    position: relative;
    overflow: hidden;
}

.btn-cr-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn-cr-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,174,239,0.4);
    color: white;
}

.btn-cr-primary:hover::before { opacity: 1; }
.btn-cr-primary:active { transform: translateY(0); }

/* Accent Button */
.btn-cr-accent {
    background: var(--cr-accent);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    padding: 0.65rem 1.5rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(0,174,239,0.25);
}

.btn-cr-accent:hover {
    background: var(--cr-accent-hover);
    transform: translateY(-1px);
    color: white;
    box-shadow: 0 6px 20px rgba(0,174,239,0.35);
}

/* ── Indicators Bar ─────────────────────────────────────────── */
.indicators-bar {
    background: var(--surface-1);
    border-bottom: 1px solid var(--surface-border);
    padding: 0.45rem 0;
    font-size: 0.8rem;
    overflow: hidden;
}

.indicators-scroll {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}

.indicators-scroll::-webkit-scrollbar { display: none; }

.indicator-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.indicator-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.indicator-value {
    color: var(--cr-accent);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.82rem;
}

.indicator-sep {
    color: var(--surface-border);
    font-size: 1rem;
}

/* ── Hero Section ───────────────────────────────────────────── */
.hero-section {
    background: var(--cr-gradient-hero);
    position: relative;
    overflow: hidden;
    padding: 4rem 0 3rem;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to bottom right, transparent 49%, var(--surface-bg) 50%);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    padding: 0.3rem 0.9rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 500;
    backdrop-filter: blur(5px);
    margin-bottom: 1.5rem;
}

/* ── Tool Cards ─────────────────────────────────────────────── */
.tool-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--cr-gradient-hero);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.tool-card:hover {
    border-color: var(--cr-accent);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-4px);
    color: inherit;
}

.tool-card:hover::before { transform: scaleX(1); }

.tool-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    background: var(--cr-gradient-card);
    border: 1px solid var(--surface-border);
    transition: all var(--transition-base);
}

.tool-card:hover .tool-card-icon {
    background: var(--cr-gradient-hero);
    border-color: transparent;
    color: white;
    box-shadow: 0 8px 20px rgba(0,174,239,0.3);
}

.tool-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tool-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

.tool-card-arrow {
    color: var(--cr-accent);
    margin-top: auto;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: gap var(--transition-fast);
}

.tool-card:hover .tool-card-arrow { gap: 0.6rem; }

/* ── Calculator Layout ──────────────────────────────────────── */
.calculator-section {
    padding: 2.5rem 0;
    min-height: calc(100vh - 200px);
}

.calc-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.calc-header {
    background: var(--cr-gradient-hero);
    padding: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.calc-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
}

.calc-header-icon {
    width: 64px;
    height: 64px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.calc-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.5rem;
}

.calc-header p {
    color: rgba(255,255,255,0.8);
    margin: 0;
    font-size: 0.9rem;
}

.calc-body {
    padding: 2rem;
}

/* ── Form Controls ──────────────────────────────────────────── */
.form-label-cr {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.input-cr {
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    background: var(--surface-bg);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.input-cr:focus {
    outline: none;
    border-color: var(--cr-accent);
    box-shadow: 0 0 0 4px rgba(var(--cr-accent-rgb), 0.12);
    background: var(--surface-bg);
}

.input-cr::placeholder { color: var(--text-muted); }

.input-group-cr {
    display: flex;
    gap: 0.5rem;
}

.input-prefix, .input-suffix {
    display: flex;
    align-items: center;
    padding: 0 0.85rem;
    background: var(--surface-1);
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* ── Result Cards ───────────────────────────────────────────── */
.result-card {
    background: var(--cr-gradient-card);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--cr-gradient-hero);
}

.result-card.result-total {
    background: var(--cr-gradient-hero);
    border: none;
}

.result-card.result-total::before { display: none; }

.result-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
}

.result-card.result-total .result-label {
    color: rgba(255,255,255,0.75);
}

.result-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.result-card.result-total .result-value { color: white; }

.result-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.result-card.result-total .result-sub { color: rgba(255,255,255,0.6); }

/* ── Indicator Card (UF/UTM/Dolar) ─────────────────────────── */
.indicator-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    text-align: center;
}

.indicator-card:hover {
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-2px);
    border-color: var(--cr-accent);
}

.indicator-card-value {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    background: var(--cr-gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin: 0.5rem 0;
}

.indicator-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.indicator-badge-demo {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,193,7,0.12);
    color: #d97706;
    border: 1px solid rgba(255,193,7,0.3);
    border-radius: 100px;
    padding: 0.2rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.indicator-badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(40,167,69,0.12);
    color: var(--cr-success);
    border: 1px solid rgba(40,167,69,0.3);
    border-radius: 100px;
    padding: 0.2rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
}

.indicator-badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--cr-success);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ── Switch Tabs ─────────────────────────────────────────────── */
.tab-switch {
    display: flex;
    background: var(--surface-1);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab-switch-btn {
    flex: 1;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab-switch-btn.active {
    background: var(--cr-gradient-hero);
    color: white;
    box-shadow: var(--shadow-sm);
}

.tab-switch-btn:hover:not(.active) {
    background: var(--surface-2);
    color: var(--text-primary);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--cr-accent);
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 800;
    color: var(--cr-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

[data-bs-theme="dark"] .stat-value { color: var(--cr-accent); }

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Page Header ─────────────────────────────────────────────── */
.page-header {
    background: var(--surface-1);
    border-bottom: 1px solid var(--surface-border);
    padding: 1.25rem 0;
    margin-bottom: 2rem;
}

.page-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.page-breadcrumb a {
    color: var(--cr-accent);
    text-decoration: none;
    font-weight: 500;
}

.page-breadcrumb a:hover { text-decoration: underline; }

/* ── Alerts custom ───────────────────────────────────────────── */
.alert-cr-info {
    background: rgba(var(--cr-accent-rgb), 0.08);
    border: 1px solid rgba(var(--cr-accent-rgb), 0.2);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-cr-info i { color: var(--cr-accent); margin-top: 0.1rem; }

/* ── Chart container ─────────────────────────────────────────── */
.chart-container {
    position: relative;
    padding: 1.5rem;
    background: var(--surface-bg);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-xl);
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
}

/* ── Section ─────────────────────────────────────────────────── */
.section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
.footer-cr {
    background: var(--cr-dark);
    padding: 3.5rem 0 1.5rem;
    margin-top: 4rem;
}

[data-bs-theme="dark"] .footer-cr { background: #0a0e17; }

.footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 400;
    transition: color var(--transition-fast);
}

.footer-links a:hover { color: var(--cr-accent); }

.footer-divider {
    border-color: rgba(255,255,255,0.08);
    margin: 2rem 0 1rem;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
}

.text-muted-footer {
    color: rgba(255,255,255,0.4) !important;
    font-size: 0.8rem;
}

.text-muted-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}

.text-muted-footer a:hover { color: var(--cr-accent); }

.btn-footer-link {
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-footer-link:hover {
    background: rgba(255,255,255,0.12);
    color: white;
    border-color: rgba(255,255,255,0.25);
}

.btn-footer-admin {
    background: rgba(0,174,239,0.1);
    border: 1px solid rgba(0,174,239,0.3);
    color: var(--cr-accent);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    padding: 0.3rem 0.75rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.btn-footer-admin:hover {
    background: rgba(0,174,239,0.2);
    color: var(--cr-accent);
}

/* ── Admin Panel ─────────────────────────────────────────────── */
.admin-sidebar {
    background: var(--cr-primary);
    min-height: 100vh;
    padding: 2rem 1rem;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: white;
}

.admin-content {
    padding: 2rem;
    min-height: 100vh;
    background: var(--surface-1);
}

/* Cache status badges */
.badge-valid   { background: rgba(40,167,69,0.15); color: var(--cr-success); border: 1px solid rgba(40,167,69,0.3); }
.badge-expired { background: rgba(220,53,69,0.1); color: var(--cr-danger); border: 1px solid rgba(220,53,69,0.25); }

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

.animate-fade-in-up  { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in     { animation: fadeIn 0.4s ease forwards; }

.stagger-1 { animation-delay: 0.1s; opacity: 0; }
.stagger-2 { animation-delay: 0.2s; opacity: 0; }
.stagger-3 { animation-delay: 0.3s; opacity: 0; }
.stagger-4 { animation-delay: 0.4s; opacity: 0; }
.stagger-5 { animation-delay: 0.5s; opacity: 0; }
.stagger-6 { animation-delay: 0.6s; opacity: 0; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--surface-1) 25%, var(--surface-2) 50%, var(--surface-1) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: var(--radius-sm);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .calc-body   { padding: 1.25rem; }
    .calc-header { padding: 1.5rem; }
    .hero-section { padding: 3rem 0 2rem; }
    .result-value { font-size: 1.3rem; }
}

@media (max-width: 576px) {
    .display-hero { font-size: 1.8rem; }
    .tool-card    { padding: 1.25rem; }
}

/* ── Utilities ───────────────────────────────────────────────── */
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.gap-cr { gap: 1rem; }
.rounded-cr  { border-radius: var(--radius-lg); }
.rounded-cr-xl { border-radius: var(--radius-xl); }
.text-mono   { font-family: var(--font-mono); }

.divider-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 1.5rem 0;
}

.divider-or::before, .divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface-border);
}

/* Print */
@media print {
    .navbar-cr, .indicators-bar, .footer-cr { display: none; }
    .calc-header { background: var(--cr-primary) !important; -webkit-print-color-adjust: exact; }
}
