/* ==========================================================================
   CodeSynq Desktop Release Orchestrator
   Theme: Luxury Professional Light - Reddish-Blue & Cream Palette
   ========================================================================== */

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

:root {
    /* Cream & Surface Backgrounds */
    --bg-base: #faf7f2;
    --bg-cream-warm: #f5f0e6;
    --bg-cream-light: #fcfbf9;
    --bg-card: #ffffff;
    --bg-card-elevated: #ffffff;
    --bg-card-hover: #fdfcfa;
    --bg-input: #fbf9f5;
    --bg-terminal: #0f172a;

    /* Text & Foregrounds */
    --fg-primary: #0f172a;       /* Deep slate navy */
    --fg-secondary: #334155;     /* Slate text */
    --fg-muted: #64748b;         /* Muted label */
    --fg-subtle: #94a3b8;        /* Soft hint */
    --fg-on-dark: #f8fafc;

    /* Reddish-Blue Harmony */
    --brand-navy: #1e3a8a;       /* Deep Royal Navy */
    --brand-blue: #2563eb;       /* Vivid Blue */
    --brand-blue-light: #dbeafe; /* Soft blue wash */
    --brand-crimson: #dc2626;    /* Crimson Red */
    --brand-crimson-hover: #b91c1c;
    --brand-crimson-light: #fee2e2; /* Soft red wash */
    --brand-wine: #991b1b;       /* Deep wine */
    --brand-coral: #ef4444;

    /* Status Colors */
    --status-success: #15803d;
    --status-success-bg: #ecfdf5;
    --status-success-border: #bbf7d0;
    --status-warning: #b45309;
    --status-warning-bg: #fffbeb;
    --status-warning-border: #fde68a;
    --status-danger: #dc2626;
    --status-danger-bg: #fef2f2;
    --status-danger-border: #fecaca;
    --status-info: #1d4ed8;
    --status-info-bg: #eff6ff;
    --status-info-border: #bfdbfe;

    /* Borders & Accents */
    --border-subtle: rgba(30, 58, 138, 0.08);
    --border-card: rgba(30, 58, 138, 0.12);
    --border-card-hover: rgba(37, 99, 235, 0.4);
    --border-input: rgba(30, 58, 138, 0.18);
    --border-focus: #2563eb;

    /* Shadows & Glows */
    --shadow-sm: 0 1px 3px rgba(30, 58, 138, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 14px rgba(30, 58, 138, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 35px rgba(30, 58, 138, 0.12), 0 4px 10px rgba(0, 0, 0, 0.04);
    --shadow-card: 0 8px 24px rgba(30, 58, 138, 0.07), 0 2px 8px rgba(0, 0, 0, 0.02);
    --glow-blue: 0 0 20px rgba(37, 99, 235, 0.2);
    --glow-crimson: 0 0 20px rgba(220, 38, 38, 0.2);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --grad-accent: linear-gradient(135deg, #1e3a8a 0%, #dc2626 100%);
    --grad-crimson: linear-gradient(135deg, #dc2626 0%, #e11d48 100%);
    --grad-cream: linear-gradient(180deg, #faf7f2 0%, #f5f0e6 100%);
    --grad-banner: linear-gradient(135deg, rgba(30, 58, 138, 0.06) 0%, rgba(220, 38, 38, 0.05) 100%);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 9999px;

    /* Typography */
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, monospace;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
    color-scheme: light;
}

body {
    min-height: 100vh;
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(ellipse 90% 50% at 50% -10%, rgba(30, 58, 138, 0.08), transparent 70%),
        radial-gradient(ellipse 60% 40% at 90% 80%, rgba(220, 38, 38, 0.05), transparent 60%),
        radial-gradient(ellipse 50% 50% at 10% 40%, rgba(37, 99, 235, 0.05), transparent 60%);
    background-attachment: fixed;
    color: var(--fg-primary);
    font-family: var(--font-sans);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--brand-navy);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    z-index: 1000;
    font-weight: 600;
    text-decoration: none;
    transition: top var(--transition-fast);
}
.skip-link:focus {
    top: 16px;
    box-shadow: var(--shadow-md);
}

/* Layout Shell */
.shell {
    width: min(1160px, calc(100% - 40px));
    margin: 32px auto 80px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.shell.narrow {
    width: min(600px, calc(100% - 32px));
    margin-top: 48px;
}

/* ==========================================================================
   AUTHENTICATION GATE (Shown Before Successful Login)
   ========================================================================== */
.auth-gate-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-base);
}

/* Ambient Animated Canvas & Mesh Layer */
.auth-ambient-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ambient-mesh-glow {
    position: absolute;
    inset: -20%;
    background: 
        radial-gradient(circle at 25% 25%, rgba(30, 58, 138, 0.15) 0%, transparent 45%),
        radial-gradient(circle at 75% 75%, rgba(220, 38, 38, 0.13) 0%, transparent 45%),
        radial-gradient(circle at 60% 30%, rgba(37, 99, 235, 0.14) 0%, transparent 50%),
        radial-gradient(circle at 35% 70%, rgba(245, 158, 11, 0.08) 0%, transparent 45%);
    filter: blur(40px);
    animation: ambientMeshShift 24s ease-in-out infinite alternate;
}

.ambient-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(30, 58, 138, 0.1) 1.2px, transparent 1.2px);
    background-size: 32px 32px;
    opacity: 0.85;
    animation: gridPan 80s linear infinite;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(75px);
    opacity: 0.75;
    will-change: transform;
}

.orb-navy {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(30, 58, 138, 0.42) 0%, rgba(30, 58, 138, 0) 70%);
    top: -10%;
    left: -10%;
    animation: floatNavyOrb 20s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.orb-crimson {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.38) 0%, rgba(220, 38, 38, 0) 70%);
    bottom: -10%;
    right: -10%;
    animation: floatCrimsonOrb 24s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.orb-blue {
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.36) 0%, rgba(37, 99, 235, 0) 70%);
    top: 40%;
    right: 15%;
    animation: floatBlueOrb 18s ease-in-out infinite alternate;
}

.orb-coral {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.28) 0%, rgba(239, 68, 68, 0) 70%);
    bottom: 20%;
    left: 15%;
    animation: floatCoralOrb 22s ease-in-out infinite alternate;
}

/* Ambient Orbit Rings */
.ambient-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px dashed rgba(30, 58, 138, 0.14);
    pointer-events: none;
    transform-origin: center center;
}

.ring-1 {
    width: 680px;
    height: 680px;
    top: 50%;
    left: 50%;
    margin-top: -340px;
    margin-left: -340px;
    animation: rotateRing 50s linear infinite;
}

.ring-2 {
    width: 960px;
    height: 960px;
    top: 50%;
    left: 50%;
    margin-top: -480px;
    margin-left: -480px;
    border-color: rgba(220, 38, 38, 0.1);
    animation: rotateRingReverse 75s linear infinite;
}

/* Keyframe Animations for Background */
@keyframes ambientMeshShift {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.12) rotate(6deg) translateY(-20px); }
    100% { transform: scale(1.05) rotate(-6deg) translateY(20px); }
}

@keyframes gridPan {
    0% { background-position: 0 0; }
    100% { background-position: 320px 320px; }
}

@keyframes floatNavyOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(120px, 80px) scale(1.15); }
    66% { transform: translate(60px, 160px) scale(0.92); }
}

@keyframes floatCrimsonOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-140px, -90px) scale(1.18); }
    66% { transform: translate(-80px, -180px) scale(0.9); }
}

@keyframes floatBlueOrb {
    0% { transform: translate(0, 0) scale(0.95); }
    50% { transform: translate(-100px, 90px) scale(1.16); }
    100% { transform: translate(60px, -70px) scale(1.02); }
}

@keyframes floatCoralOrb {
    0% { transform: translate(0, 0) scale(1.05); }
    50% { transform: translate(90px, -110px) scale(0.92); }
    100% { transform: translate(-70px, 80px) scale(1.18); }
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateRingReverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

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

/* Glassmorphic Auth Card */
.auth-gate-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    box-shadow: 
        0 25px 60px rgba(30, 58, 138, 0.12),
        0 8px 24px rgba(220, 38, 38, 0.05),
        0 1px 3px rgba(0, 0, 0, 0.04);
    width: min(480px, 100%);
    padding: 44px 38px;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.auth-gate-card:hover {
    box-shadow: 
        0 30px 70px rgba(30, 58, 138, 0.16),
        0 10px 30px rgba(220, 38, 38, 0.08);
}

.auth-gate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-navy), var(--brand-blue), var(--brand-crimson), var(--brand-navy));
    background-size: 200% 100%;
    animation: shimmerTopBorder 6s linear infinite;
}

.auth-brand-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 28px;
    gap: 14px;
}

.auth-logo-frame {
    width: 68px;
    height: 68px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #ffffff, #f5f0e6);
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-md);
    display: grid;
    place-items: center;
    padding: 8px;
    transition: transform var(--transition-normal);
}

.auth-logo-frame:hover {
    transform: scale(1.05) rotate(-2deg);
}

.auth-logo-frame img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--brand-navy);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--fg-muted);
    font-weight: 500;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.app-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-navy), var(--brand-blue), var(--brand-crimson), transparent);
    opacity: 0.6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
}

.brand-icon-wrapper {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: #ffffff;
    border: 1px solid var(--border-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: 6px;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.brand-icon-wrapper:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.brand-icon-wrapper img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

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

.brand-tagline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.eyebrow {
    color: var(--brand-crimson);
    letter-spacing: 0.12em;
    font-weight: 800;
    font-size: 11px;
    text-transform: uppercase;
}

.version-chip {
    background: var(--brand-blue-light);
    color: var(--brand-navy);
    border: 1px solid var(--border-subtle);
    padding: 1px 8px;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
}

h1.app-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--brand-navy);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Status Pill */
.status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    background: var(--bg-cream-warm);
    border: 1px solid var(--border-subtle);
    color: var(--fg-secondary);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-warning);
    box-shadow: 0 0 6px var(--status-warning);
}

.status.online {
    background: var(--status-success-bg);
    border-color: var(--status-success-border);
    color: var(--status-success);
}

.status.online .status-dot {
    background: var(--status-success);
    box-shadow: 0 0 8px var(--status-success);
}

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

.status.error .status-dot {
    background: var(--status-danger);
    box-shadow: none;
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-pill);
    font-size: 12px;
    box-shadow: var(--shadow-sm);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--grad-primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    font-size: 11px;
}

/* Icon Buttons */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--fg-secondary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-cream-warm);
    border-color: var(--brand-blue);
    color: var(--brand-navy);
    transform: translateY(-1px);
}

.icon-btn.spinning svg {
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

/* ==========================================================================
   Tab Navigation System
   ========================================================================== */
.tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 2px;
    gap: 16px;
    overflow-x: auto;
}

.tabs-nav {
    display: flex;
    gap: 8px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    color: var(--fg-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--brand-navy);
    background: rgba(30, 58, 138, 0.04);
}

.tab-btn.active {
    background: #ffffff;
    border-color: var(--border-card);
    color: var(--brand-navy);
    box-shadow: var(--shadow-sm);
    border-bottom: 2px solid var(--brand-crimson);
}

.tab-badge {
    background: var(--bg-cream-warm);
    color: var(--fg-secondary);
    padding: 1px 7px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
}

.tab-btn.active .tab-badge {
    background: var(--brand-blue-light);
    color: var(--brand-navy);
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.2s ease-out forwards;
}

.tab-content.active {
    display: flex;
}

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

/* ==========================================================================
   KPI Stats Grid
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-navy), var(--brand-crimson));
    opacity: 0.85;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--fg-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    background: var(--bg-cream-warm);
    color: var(--brand-navy);
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--brand-navy);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.stat-sub {
    font-size: 12px;
    color: var(--fg-muted);
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow-card);
    position: relative;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.card-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

h2.card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-navy);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-desc {
    color: var(--fg-secondary);
    font-size: 13px;
}

/* ==========================================================================
   Terminal / Endpoint Box (High Contrast Dark Navy)
   ========================================================================== */
.terminal-box {
    background: var(--bg-terminal);
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-md);
}

.terminal-prefix {
    color: #38bdf8;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    user-select: none;
}

.terminal-content {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
}

.terminal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ==========================================================================
   Current Release Showcase
   ========================================================================== */
.release-showcase {
    background: var(--bg-cream-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.version-badge-lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--brand-blue-light);
    border: 1px solid #bfdbfe;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 16px;
    color: var(--brand-navy);
}

/* Status Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pill-mandatory {
    background: var(--brand-crimson-light);
    color: var(--brand-crimson);
    border: 1px solid var(--status-danger-border);
}

.pill-optional {
    background: var(--brand-blue-light);
    color: var(--brand-navy);
    border: 1px solid #bfdbfe;
}

.pill-channel {
    background: var(--bg-cream-warm);
    color: var(--brand-navy);
    border: 1px solid var(--border-subtle);
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    font-size: 13px;
}

.showcase-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.showcase-label {
    color: var(--fg-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.showcase-val {
    color: var(--fg-primary);
    font-weight: 600;
    word-break: break-all;
}

.showcase-notes {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    font-size: 13px;
    color: var(--fg-secondary);
    white-space: pre-wrap;
    max-height: 160px;
    overflow-y: auto;
    border-left: 3px solid var(--brand-crimson);
}

/* ==========================================================================
   Security Audit Grid
   ========================================================================== */
.security-audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.audit-card {
    background: var(--bg-cream-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all var(--transition-fast);
}

.audit-card:hover {
    border-color: var(--border-card);
    background: #ffffff;
}

.audit-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.audit-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-navy);
}

.audit-desc {
    font-size: 11px;
    color: var(--fg-muted);
}

.audit-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.audit-status-badge.ok {
    background: var(--status-success-bg);
    color: var(--status-success);
    border: 1px solid var(--status-success-border);
}

.audit-status-badge.warn {
    background: var(--status-warning-bg);
    color: var(--status-warning);
    border: 1px solid var(--status-warning-border);
}

.audit-status-badge.bad {
    background: var(--status-danger-bg);
    color: var(--status-danger);
    border: 1px solid var(--status-danger-border);
}

/* ==========================================================================
   Form Controls
   ========================================================================== */
form.publisher-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    color: var(--brand-navy);
    letter-spacing: 0.02em;
}

.form-hint {
    font-size: 11px;
    color: var(--fg-muted);
    font-weight: 400;
}

input, textarea, select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: var(--fg-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

input.font-mono, textarea.font-mono {
    font-family: var(--font-mono);
    font-size: 12px;
}

input:hover, textarea:hover, select:hover {
    border-color: var(--brand-blue);
    background: #ffffff;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

input.invalid, textarea.invalid {
    border-color: var(--status-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.5;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%231e3a8a' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

/* Quick Fill Banner */
.quick-fill-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: var(--grad-banner);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.quick-fill-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--brand-navy);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
}

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

.btn-primary {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.35);
    filter: brightness(1.08);
}

.btn-crimson {
    background: var(--grad-crimson);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}

.btn-crimson:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
    filter: brightness(1.08);
}

.btn-indigo {
    background: var(--brand-navy);
    color: #ffffff;
}

.btn-indigo:hover {
    background: #172554;
}

.btn-secondary {
    background: #ffffff;
    border-color: var(--border-card);
    color: var(--brand-navy);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: var(--bg-cream-warm);
    border-color: var(--brand-blue);
    color: var(--brand-navy);
}

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

.btn-danger:hover {
    background: var(--status-danger);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 14px;
    border-radius: var(--radius-md);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Release History Table & Cards
   ========================================================================== */
.history-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

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

.search-box input {
    padding-left: 36px;
    background: #ffffff;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-muted);
    pointer-events: none;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-card {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.history-card:hover {
    border-color: var(--brand-blue);
    box-shadow: var(--shadow-md);
}

.history-card.is-active-release {
    border-left: 4px solid var(--brand-crimson);
    background: #fffdfc;
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.history-main-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.history-version {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--brand-navy);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.history-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    padding: 14px 18px;
    background: var(--bg-cream-light);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
}

.history-detail-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.detail-label {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--fg-muted);
    letter-spacing: 0.04em;
}

.detail-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--fg-primary);
    word-break: break-all;
}

.history-notes-box {
    background: #ffffff;
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--brand-navy);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
}

.history-notes-content {
    font-size: 13px;
    color: var(--fg-secondary);
    white-space: pre-wrap;
    line-height: 1.5;
    max-height: 140px;
    overflow-y: auto;
}

.history-manifest-link {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 6px;
    border-top: 1px dashed var(--border-subtle);
}

/* ==========================================================================
   Dropzone & Studio
   ========================================================================== */
.dropzone {
    border: 2px dashed rgba(30, 58, 138, 0.25);
    border-radius: var(--radius-lg);
    background: var(--bg-cream-light);
    padding: 40px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--brand-navy);
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

.dropzone-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--brand-blue-light);
    color: var(--brand-navy);
    display: grid;
    place-items: center;
}

.dropzone-text h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-navy);
    margin-bottom: 4px;
}

.dropzone-text p {
    font-size: 13px;
    color: var(--fg-muted);
}

.hash-result-box {
    background: var(--bg-cream-light);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

/* ==========================================================================
   Code Blocks
   ========================================================================== */
pre.code-block {
    background: var(--bg-terminal);
    border: 1px solid #1e293b;
    border-radius: var(--radius-md);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #e2e8f0;
    overflow-x: auto;
    white-space: pre;
    line-height: 1.6;
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    color: var(--fg-primary);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.toast.success {
    border-left: 4px solid var(--status-success);
}

.toast.error {
    border-left: 4px solid var(--brand-crimson);
}

.toast.info {
    border-left: 4px solid var(--brand-blue);
}

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

/* ==========================================================================
   Modal Dialogs
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    width: min(500px, 100%);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 24px;
    font-size: 14px;
    color: var(--fg-secondary);
    line-height: 1.6;
}

.modal-footer {
    padding: 16px 24px;
    background: var(--bg-cream-light);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.hidden { display: none !important; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Responsive */
@media (max-width: 768px) {
    .shell {
        margin: 16px auto 60px;
        width: calc(100% - 24px);
    }
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    .stats-grid, .form-row {
        grid-template-columns: 1fr;
    }
    .terminal-box {
        flex-direction: column;
        align-items: flex-start;
    }
    .terminal-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .history-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
