/**
 * Draiilio Design System
 * Modern SaaS-oriented CSS Framework
 * WCAG 2.1 AA Compliant
 * No external dependencies - all assets local
 */

/* ===================================
   CSS RESET & BASE
   =================================== */

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

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

body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
}

/* ===================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   =================================== */

:root {
    /* Brand Colors */
    --color-primary: #1d4ed8;
    --color-primary-dark: #1e40af;
    --color-primary-light: #3b82f6;
    --color-secondary: #00d4aa;
    --color-secondary-dark: #00b894;
    --color-accent: #ff6b6b;
    
    /* Neutral Colors */
    --color-white: #FFFFFF;
    --color-black: #000000;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;
    
    /* Semantic Colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-info: #3B82F6;
    
    /* Text Colors */
    --color-text-primary: #111827;
    --color-text-secondary: #4B5563;
    --color-text-tertiary: #6B7280;
    --color-text-inverse: #FFFFFF;
    
    /* Background Colors */
    --color-bg-primary: #f1f5f9;
    --color-bg-secondary: #e8edf3;
    --color-bg-tertiary: #dde3ec;
    --color-bg-dark: #111827;
    
    /* Border Colors */
    --color-border-light: #d1d9e6;
    --color-border-medium: #b8c4d4;
    --color-border-dark: #8fa0b5;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;    /* 4px */
    --space-sm: 0.5rem;     /* 8px */
    --space-md: 1rem;       /* 16px */
    --space-lg: 1.5rem;     /* 24px */
    --space-xl: 2rem;       /* 32px */
    --space-2xl: 3rem;      /* 48px */
    --space-3xl: 4rem;      /* 64px */
    --space-4xl: 6rem;      /* 96px */
    --space-5xl: 8rem;      /* 128px */
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;      /* 12px */
    --font-size-sm: 0.875rem;     /* 14px */
    --font-size-base: 1rem;       /* 16px */
    --font-size-lg: 1.125rem;     /* 18px */
    --font-size-xl: 1.25rem;      /* 20px */
    --font-size-2xl: 1.5rem;      /* 24px */
    --font-size-3xl: 1.875rem;    /* 30px */
    --font-size-4xl: 2.25rem;     /* 36px */
    --font-size-5xl: 3rem;        /* 48px */
    --font-size-6xl: 3.75rem;     /* 60px */
    --font-size-7xl: 4.5rem;      /* 72px */
    
    /* Font Weights */
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Border Radius */
    --radius-sm: 0.25rem;   /* 4px */
    --radius-md: 0.5rem;    /* 8px */
    --radius-lg: 0.75rem;   /* 12px */
    --radius-xl: 1rem;      /* 16px */
    --radius-2xl: 1.5rem;   /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
    
    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    
    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;

    /* Semantic aliases used throughout templates */
    --color-text:    var(--color-text-primary);
    --color-border:  var(--color-border-light);
    --color-surface: var(--color-white);

    /* Sidebar dark theme tokens */
    --sidebar-bg:           #1e293b;
    --sidebar-bg-hover:     rgba(255,255,255,.07);
    --sidebar-bg-active:    rgba(29,78,216,.22);
    --sidebar-border:       #253347;
    --sidebar-text:         #94a3b8;
    --sidebar-text-active:  #e2e8f0;
    --sidebar-label:        #475569;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-xl);
}

h2 {
    font-size: var(--font-size-4xl);
    margin-bottom: var(--space-lg);
}

h3 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--space-md);
}

h4 {
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
}

h5 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
}

h6 {
    font-size: var(--font-size-lg);
    margin-bottom: var(--space-sm);
}

p {
    margin: 0 0 var(--space-md) 0;
    line-height: var(--line-height-relaxed);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

strong, b {
    font-weight: var(--font-weight-bold);
}

em, i {
    font-style: italic;
}

/* ===================================
   LAYOUT UTILITIES
   =================================== */

.container {
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }
.container-xl { max-width: var(--container-xl); }
.container-2xl { max-width: var(--container-2xl); }

.section {
    padding: var(--space-4xl) 0;
}

.section-lg {
    padding: var(--space-5xl) 0;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    /* Matches .form-input: same 1px border + same vertical padding
       → identical outer height so buttons line up with inputs in a row. */
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
}

.btn > * {
    position: relative;
    z-index: 1;
}

.btn:hover::before {
    transform: translateX(0);
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.4);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

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

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    text-decoration: none;
    color: var(--color-white);
}

.btn-primary:active:not(:disabled) {
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: var(--color-white);
    color: var(--color-text-primary);
    border-color: var(--color-border-medium);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--color-gray-100, #f3f4f6);
    border-color: var(--color-border-medium);
    text-decoration: none;
    color: var(--color-text-primary);
}

.btn-secondary:active:not(:disabled) {
    background-color: var(--color-gray-100, #f3f4f6);
}

/* Keep the original glassy hero variant only inside the marketing hero */
.hero .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-primary);
}

.btn-ghost::before {
    display: none;
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--color-gray-100);
    color: var(--color-primary);
    text-decoration: none;
}

.btn-danger {
    background-color: var(--color-danger, #dc2626);
    color: #fff;
    border-color: transparent;
}

.btn-danger:hover:not(:disabled) {
    background-color: #b91c1c;
    color: #fff;
}

/* Hero CTA specific buttons for better visibility */
.hero .btn-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero .btn-primary:hover:not(:disabled) {
    background-color: var(--color-white);
    color: var(--color-primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.hero .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.hero .btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--color-white);
    color: var(--color-white);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: var(--space-lg) var(--space-2xl);
    font-size: var(--font-size-lg);
}

/* Compact button used in card headers and tables. Keeps the same 1px border
   so it visually aligns when placed alongside other btn or btn-sm elements. */
.btn-sm {
    padding: var(--space-sm) var(--space-lg);
    font-size: var(--font-size-sm);
}

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

.navbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--color-border-light);
    backdrop-filter: blur(8px);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 var(--space-xl);
    max-width: var(--container-2xl);
    margin: 0 auto;
    position: relative; /* anchor for absolute dropdown */
}

.navbar-brand {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.navbar-brand:hover {
    text-decoration: none;
    color: var(--color-primary-dark);
}

/* ---- Nav menu: inline row on desktop, absolute dropdown on mobile ---- */
.navbar-menu {
    display: flex;
    flex: 1;
    align-items: center;
}

.navbar-nav {
    display: flex;
    flex: 1;
    justify-content: center;
    list-style: none;
    gap: var(--space-2xl);
    margin: 0;
    padding: 0;
}

.navbar-nav a {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    padding: var(--space-xs) 0;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

.navbar-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.navbar-nav a.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.navbar-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

/* Right-side: language + auth */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.navbar-link {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-medium);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-block;
}

.navbar-link:hover {
    color: var(--color-primary);
    background-color: var(--color-gray-100);
    text-decoration: none;
}

/* Language switcher dropdown */
.navbar-lang-section {
    position: relative;
}

.pub-lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 300;
    min-width: 160px;
    background: #fff;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px 0;
}

.pub-lang-menu form { margin: 0; }

/* ---- Hamburger Toggle ---- */
.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-md);
    gap: 5px;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}

.navbar-toggle:hover {
    background: var(--color-gray-100);
}

/* Remove the focus box that creates the "square X" look on click */
.navbar-toggle:focus { outline: none; }
.navbar-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--color-gray-800);
    border-radius: 2px;
    transition: transform var(--transition-base), opacity var(--transition-base), width var(--transition-base);
}

.navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    width: 0;
}
.navbar-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .navbar-container {
        height: 56px;
        padding: 0 var(--space-md);
    }

    .navbar-toggle {
        display: flex;
    }

    /* Hide the center+right menu; show as dropdown when .open */
    .navbar-menu {
        display: none;
        position: absolute;
        top: 56px; /* = navbar-container height */
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: white;
        border-top: 1px solid var(--color-border-light);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
        padding: var(--space-md);
        z-index: 200;
        gap: 0;
    }

    .navbar-menu.open {
        display: flex;
    }

    /* Nav links: vertical list */
    .navbar-nav {
        flex-direction: column;
        justify-content: flex-start;
        gap: 0;
        padding-bottom: var(--space-sm);
        margin-bottom: var(--space-sm);
        border-bottom: 1px solid var(--color-border-light);
    }

    .navbar-nav li { width: 100%; }

    .navbar-nav a {
        display: block;
        padding: var(--space-sm) var(--space-md);
        border-radius: var(--radius-md);
        color: var(--color-text-primary);
        font-size: var(--font-size-base);
    }

    .navbar-nav a:hover { background: var(--color-gray-100); }
    .navbar-nav a.active::after { display: none; }
    .navbar-nav a.active { background: var(--color-gray-100); }

    /* Language section: inline in mobile menu */
    .navbar-lang-section {
        padding-bottom: var(--space-sm);
        margin-bottom: var(--space-sm);
        border-bottom: 1px solid var(--color-border-light);
    }

    .pub-lang-menu {
        position: static;
        box-shadow: none;
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        margin-top: var(--space-xs);
    }

    /* Auth actions: full-width column */
    .navbar-actions {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
        padding-top: var(--space-sm);
    }

    .navbar-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .navbar-link {
        display: block;
        text-align: center;
        padding: var(--space-sm) var(--space-md);
    }
}

/* ===================================
   HERO SECTION
   =================================== */

.hero {
    background: linear-gradient(135deg, #0066cc 0%, #00b894 100%);
    color: var(--color-white);
    padding: var(--space-4xl) 0;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    display: grid;
    grid-template-columns: 55% 45%;
    align-items: center;
    gap: var(--space-3xl);
}

.hero h1 {
    color: var(--color-white);
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    margin-bottom: var(--space-lg);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    line-height: 1.15;
}

.hero p {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-2xl);
    opacity: 0.93;
    line-height: 1.7;
    color: var(--color-white);
}

.hero-cta {
    display: flex;
    flex-direction: row;
    gap: var(--space-md);
    flex-wrap: nowrap;
    align-items: center;
}

.hero-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-illustration svg {
    width: 100%;
    max-width: 480px;
    height: auto;
    filter: drop-shadow(0 16px 32px rgba(0, 0, 0, 0.2));
}

/* Hero CTA button overrides */
.hero .btn-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.hero .btn-primary:hover:not(:disabled) {
    background-color: var(--color-white);
    color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    text-decoration: none;
}

.hero .btn-secondary {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

.hero .btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.22);
    border-color: var(--color-white);
    color: var(--color-white);
    transform: translateY(-2px);
    text-decoration: none;
}

@media (max-width: 768px) {
    .hero {
        padding: var(--space-3xl) 0;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--space-xl);
    }

    .hero h1 {
        font-size: var(--font-size-4xl);
    }

    .hero p {
        font-size: var(--font-size-lg);
    }

    .hero-illustration {
        order: -1;
        max-width: 280px;
        margin: 0 auto;
    }

    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
    }

    .hero-cta .btn {
        flex: 1;
        min-width: 140px;
        max-width: 220px;
    }
}

/* ===================================
   CARDS
   =================================== */

.card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

/* .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
} */

.card-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.card-text {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    font-size: var(--font-size-2xl);
}

/* ===================================
   GRID SYSTEM
   =================================== */

.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .grid-cols-3, .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===================================
   APP PAGE LAYOUT WRAPPERS
   Consistent content widths across all backend views.
   Use these on the top-level content div instead of
   inline max-width styles.
   =================================== */

/* Full-width: dashboards, lists, data tables */
.page-layout {}

/* Wide: detail views, multi-section settings, audit logs */
.page-layout--wide { max-width: 1080px; }

/* Form: create / edit forms */
.page-layout--form { max-width: 800px; }

/* Settings: narrow profile / tenant forms */
.page-layout--settings { max-width: 700px; }

/* ===================================
   SETTINGS TWO-COLUMN LAYOUT
   Vertical nav sidebar + content (GitHub/Linear style)
   =================================== */

.settings-shell {
    max-width: 960px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

.settings-nav-panel {
    position: sticky;
    top: calc(56px + var(--space-xl));
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.settings-nav-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-tertiary);
    padding: var(--space-md) var(--space-md) var(--space-xs);
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.13s, color 0.13s;
}

.settings-nav-item:hover {
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    text-decoration: none;
}

.settings-nav-item.active {
    border-left-color: var(--color-primary);
    color: var(--color-primary);
    background: #eff6ff;
    font-weight: 600;
}

.settings-nav-divider {
    height: 1px;
    background: var(--color-border-light);
    margin: var(--space-xs) 0;
}

.settings-layout [id] {
    scroll-margin-top: calc(56px + var(--space-md));
}

/* Smooth scrolling within the settings content column */
.app-content:has(.settings-layout) {
    scroll-behavior: smooth;
}

@media (max-width: 768px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
    .settings-nav-panel {
        position: static;
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
    }
    .settings-nav-title { display: none; }
    .settings-nav-divider { display: none; }
    .settings-nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        flex: 1;
        justify-content: center;
    }
    .settings-nav-item.active {
        border-bottom-color: var(--color-primary);
        border-left-color: transparent;
    }
}

/* ===================================
   FEATURES SECTION
   =================================== */

.features {
    background-color: var(--color-bg-secondary);
}

.feature-item {
    text-align: center;
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-2xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
    position: relative;
    transition: all var(--transition-base);
}

.feature-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-2xl);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-secondary));
    z-index: -1;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.card:hover .feature-icon::after {
    opacity: 1;
}

.card:hover .feature-icon {
    transform: scale(1.1) rotate(5deg);
}

.feature-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

/* SVG Icon Styles */
/* Bootstrap Icons inside feature-icon */
.feature-icon .bi {
    font-size: 2rem;
    color: white;
    line-height: 1;
}

.feature-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-sm);
}

.feature-description {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ===================================
   BLOG STYLES
   =================================== */

.blog-header {
    background: linear-gradient(135deg, #0066cc 0%, #00d4aa 100%);
    color: var(--color-white);
    padding: var(--space-3xl) 0;
    text-align: center;
}

.blog-header h1 {
    color: var(--color-white);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-2xl);
    margin: var(--space-3xl) 0;
}

.blog-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--color-border-light);
}

.blog-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
}

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

.blog-card-meta {
    display: flex;
    gap: var(--space-md);
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin-bottom: var(--space-md);
}

.blog-card-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-md);
    color: var(--color-text-primary);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-title a:hover {
    color: var(--color-primary);
}

.blog-card-excerpt {
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-md);
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border-light);
}

.read-more {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.read-more:hover {
    gap: var(--space-sm);
}

/* Blog Post Single */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-3xl) var(--space-md);
}

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

.blog-post-title {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--space-lg);
}

.blog-post-meta {
    display: flex;
    gap: var(--space-lg);
    justify-content: center;
    flex-wrap: wrap;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
}

.blog-post-content {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
}

.blog-post-content h2 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-lg);
}

.blog-post-content h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: var(--space-xl) 0;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--space-lg);
    margin: var(--space-xl) 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

.blog-post-content code {
    background-color: var(--color-gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}

.blog-post-content pre {
    background-color: var(--color-gray-900);
    color: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: var(--space-xl) 0;
}

.blog-post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* ===================================
   FOOTER
   =================================== */

.footer {
    background-color: var(--color-gray-900);
    color: var(--color-gray-300);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
    margin-bottom: var(--space-2xl);
}

.footer-section h3 {
    color: var(--color-white);
    margin-bottom: var(--space-md);
    font-size: var(--font-size-lg);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-links a {
    color: var(--color-gray-300);
}

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

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-gray-700);
    color: var(--color-gray-400);
}

/* ===================================
   TESTIMONIALS
   =================================== */

.testimonials {
    background-color: var(--color-white);
}

.testimonial-card {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
}

.testimonial-quote {
    font-size: var(--font-size-lg);
    line-height: var(--line-height-relaxed);
    color: var(--color-text-primary);
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

.testimonial-info h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.testimonial-info p {
    font-size: var(--font-size-sm);
    color: var(--color-text-tertiary);
    margin: 0;
}

/* ===================================
   CTA SECTION
   =================================== */

.cta-section {
    background: linear-gradient(135deg, #0066cc 0%, #00d4aa 100%);
    color: var(--color-white);
    padding: var(--space-4xl) 0;
    text-align: center;
    border-radius: var(--radius-2xl);
    margin: var(--space-4xl) var(--space-md);
}

.cta-section h2 {
    color: var(--color-white);
    margin-bottom: var(--space-lg);
}

.cta-section p {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-2xl);
    opacity: 0.95;
}

/* CTA section specific button styles */
.cta-section .btn-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
    border-color: var(--color-white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.cta-section .btn-primary:hover:not(:disabled) {
    background-color: var(--color-white);
    color: var(--color-primary-dark);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.cta-section .btn-secondary {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.cta-section .btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--color-white);
    color: var(--color-white);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ===================================
   FORMS
   =================================== */

.form-group {
    margin-bottom: var(--space-lg);
}

.form-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
}

.form-field .form-label {
    margin-bottom: 0;
}

.form-help {
    display: block;
    color: #5f6b7a;
    font-size: 0.78rem;
    line-height: 1.4;
}

/* Common helper paragraph pattern directly under inputs/selects/textareas. */
form input + p.text-secondary,
form select + p.text-secondary,
form textarea + p.text-secondary {
    color: #5f6b7a !important;
    font-size: 0.78rem !important;
    line-height: 1.4;
}

/* Final safety net: normalize helper-like secondary copy anywhere inside forms. */
form .text-secondary {
    color: #5f6b7a !important;
    font-size: 0.78rem !important;
    line-height: 1.4;
}

/* Apply helper text tone and size consistently across all form UIs. */
form small,
form .form-hint,
form .form-help {
    color: #5f6b7a !important;
    font-size: 0.78rem !important;
    line-height: 1.4;
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-md);
    font-size: var(--font-size-base);
    background: var(--color-white);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input-sm,
.form-select-sm {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    font-size: var(--font-size-sm);
    background: var(--color-white);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input-sm:focus,
.form-select-sm:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Inline search forms: keep submit buttons and fields at identical height. */
form[role="search"] {
    --inline-form-control-height: 3.3rem;
}

form[role="search"] .form-input,
form[role="search"] .form-select,
form[role="search"] button[type="submit"].btn,
form[role="search"] .btn[type="submit"] {
    min-height: var(--inline-form-control-height);
}

form[role="search"] button[type="submit"].btn-sm,
form[role="search"] .btn.btn-sm[type="submit"] {
    padding-top: calc((var(--inline-form-control-height) - var(--font-size-sm) - 2px) / 2);
    padding-bottom: calc((var(--inline-form-control-height) - var(--font-size-sm) - 2px) / 2);
}

/* ===================================
   MODAL
   =================================== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.modal-backdrop.modal--visible {
    opacity: 1;
}

.modal-backdrop.modal--hidden {
    pointer-events: none;
    opacity: 0;
}

.modal {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 460px;
    transform: translateY(10px);
    transition: transform 0.18s ease;
}

.modal-backdrop.modal--visible .modal {
    transform: translateY(0);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.modal__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
}

.modal__close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.modal__close:hover { color: var(--color-text-primary); }

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

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border-top: 1px solid var(--color-border);
}

/* ===================================
   TOAST NOTIFICATIONS
   =================================== */

#toast-container {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    max-width: 360px;
}

.toast.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.toast.toast--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ===================================
   UTILITIES
   =================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-white { color: var(--color-white); }

.bg-primary { background-color: var(--color-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-white { background-color: var(--color-white); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }
.mb-3xl { margin-bottom: var(--space-3xl); }

.pt-0 { padding-top: 0; }
.pt-sm { padding-top: var(--space-sm); }
.pt-md { padding-top: var(--space-md); }
.pt-lg { padding-top: var(--space-lg); }
.pt-xl { padding-top: var(--space-xl); }

.pb-0 { padding-bottom: 0; }
.pb-sm { padding-bottom: var(--space-sm); }
.pb-md { padding-bottom: var(--space-md); }
.pb-lg { padding-bottom: var(--space-lg); }
.pb-xl { padding-bottom: var(--space-xl); }

/* ===================================
   RESPONSIVE TYPOGRAPHY
   =================================== */

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    h1 {
        font-size: var(--font-size-4xl);
    }
    
    h2 {
        font-size: var(--font-size-3xl);
    }
    
    .hero h1 {
        font-size: var(--font-size-4xl);
    }
    
    .blog-post-title {
        font-size: var(--font-size-3xl);
    }
    
    /* Mobile Navigation */
    .navbar-nav {
        gap: var(--space-md);
    }
    
    .navbar-container {
        padding: var(--space-md) var(--space-md);
    }
    
    .hero {
        padding: var(--space-3xl) 0;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .section {
        padding: var(--space-2xl) 0;
    }
    
    .section-lg {
        padding: var(--space-3xl) 0;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-md);
    text-decoration: none;
    z-index: 9999;
}

.skip-to-main:focus {
    top: 0;
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --color-border-light: #000000;
        --color-border-medium: #000000;
    }
}

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===================================
   FAQ SECTION
   =================================== */

.faq-section {
    background-color: var(--color-bg-secondary);
}

.faq-container {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-item:hover {
    box-shadow: var(--shadow-md);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: var(--space-lg) var(--space-xl);
    background: none;
    border: none;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color var(--transition-fast);
}

.faq-question:hover {
    color: var(--color-primary);
}

.faq-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    transition: transform var(--transition-base);
    flex-shrink: 0;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer-content {
    padding: 0 var(--space-xl) var(--space-lg);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

/* ===================================
   TEAM MEMBERS SECTION
   =================================== */

.team-member-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    border: 1px solid var(--color-border-light);
}

.team-member-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.team-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    margin: 0 auto var(--space-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-member-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-xs);
    color: var(--color-text-primary);
}

.team-member-role {
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-md);
}

.team-member-contact {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

.team-social {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
}

.social-link {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    text-decoration: none;
}

.social-link:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
}

/* ===================================
   INTEGRATIONS SECTION
   =================================== */

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-3xl);
}

.integration-card {
    background: var(--color-white);
    border: 2px solid var(--color-border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    min-height: 140px;
    transition: all var(--transition-base);
    cursor: pointer;
}

.integration-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.integration-logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-3xl);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
}

.integration-name {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
}

/* ===================================
   STATS/METRICS SECTION
   =================================== */

.stats-section {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: var(--color-white);
    padding: var(--space-3xl) 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-2xl);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-sm);
    line-height: 1;
}

.stat-label {
    font-size: var(--font-size-lg);
    opacity: 0.95;
}

/* ===================================
   ENHANCED PRICING
   =================================== */

.pricing-section {
    position: relative;
}

.pricing-card {
    position: relative;
}

.pricing-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-3xl);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    background: var(--color-gray-300);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: background-color var(--transition-base);
}
.toggle-switch:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.toggle-switch.active {
    background: var(--color-primary);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(22px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: -12px;
    background: var(--color-accent);
    color: var(--color-white);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
}

/* ===================================
   NEWSLETTER SECTION
   =================================== */

.newsletter-section {
    background: var(--color-white);
    padding: var(--space-3xl);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-form {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.newsletter-form input {
    flex: 1;
}

@media (max-width: 768px) {
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form .btn {
        width: 100%;
    }
}

/* ===================================
   VISUAL ENHANCEMENTS
   =================================== */

/* Subtle background pattern */
.pattern-bg {
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(0, 102, 204, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 212, 170, 0.03) 0%, transparent 50%);
}

/* Decorative blob shapes */
.decorative-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    pointer-events: none;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--color-primary);
    top: -200px;
    right: -100px;
}

.blob-2 {
    width: 300px;
    height: 300px;
    background: var(--color-secondary);
    bottom: -150px;
    left: -100px;
}

/* Cards that should not lift on hover */
.card--static {
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}
.card--static:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,.09);
    transform: none;
}

/* Stat card — dashboard summary tiles */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    transition: all var(--transition-base);
    text-decoration: none;
    color: inherit;
}
.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    text-decoration: none;
}
.stat-card__icon {
    font-size: 1.75rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
}
.stat-card__value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: var(--space-xs);
}
.stat-card__label {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

/* Section heading with optional action */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}
.section-header h2,
.section-header h3 {
    margin: 0;
}

/* Keep dashboard split headers equal height so action buttons do not offset card stacks. */
.dashboard-split-column {
    display: flex;
    flex-direction: column;
}

.dashboard-split-column .section-header {
    min-height: 2.5rem;
}

.dashboard-split-card {
    height: 6.75rem;
    display: flex;
    align-items: center;
}

.dashboard-split-card > div {
    width: 100%;
}

.dashboard-split-card.text-center {
    justify-content: center;
}

/* Panel — card without the hover lift */
.panel {
    background: var(--color-white);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    overflow: hidden;
}
.panel__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: #f8fafc;
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 600;
    font-size: var(--font-size-sm);
}
.panel__body {
    padding: var(--space-lg);
}
.panel__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
}
.panel__row:last-child { border-bottom: none; }
.panel__row:hover { background: #f8fafc; }

/* ===================================
   ACCESSIBILITY & WCAG 2.2 / BFSG
   =================================== */

/* Skip navigation — WCAG 2.4.1 Block Title Bypass */
.skip-link {
    position: absolute;
    top: -9999px;
    left: 0;
    z-index: 99999;
    background: var(--color-primary);
    color: var(--color-white) !important;
    padding: var(--space-sm) var(--space-xl);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) 0;
    border: 2px solid var(--color-primary-dark);
}
.skip-link:focus {
    top: 0;
    outline: 3px solid var(--color-primary-dark);
    outline-offset: 2px;
}

/* Screen-reader only — visually hidden but available to assistive tech */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* sr-only that becomes visible on focus (for skip links inside elements) */
.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* WCAG 2.2 SC 2.4.11 Focus Appearance — minimum 3:1 contrast, solid 3 px outline */
*:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}
/* Remove default outline only when focus-visible is supported  */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Alert / notification components — replace ad-hoc inline-styled divs */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-normal);
}
.alert > i { flex-shrink: 0; font-size: 1rem; margin-top: 1px; }
.alert-success  { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.alert-danger,
.alert-error    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert-warning  { background: #fef9c3; color: #78350f; border-color: #fde68a; }
.alert-info     { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }

/* Full-width flash banners rendered by partials/flash.blade.php.
   Visual style mirrors the admin "Under Construction" notice: thin,
   edge-to-edge, centered text, semantic colour fill. */
.flash-banners {
    display: flex;
    flex-direction: column;
}
.flash-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    border-bottom: 1px solid transparent;
}
.flash-banner i { font-size: 1rem; line-height: 1; }
.flash-banner--success { background: #d1fae5; color: #065f46; border-bottom-color: #6ee7b7; }
.flash-banner--danger  { background: #fee2e2; color: #991b1b; border-bottom-color: #fca5a5; }
.flash-banner--warning { background: #fef9c3; color: #78350f; border-bottom-color: #fde68a; }
.flash-banner--info    { background: #dbeafe; color: #1e3a8a; border-bottom-color: #93c5fd; }

/* Badge component — WCAG AA contrast verified */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    vertical-align: middle;
}
.badge-blue   { background: #eff6ff; color: #1d4ed8; }
.badge-green  { background: #f0fdf4; color: #15803d; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-gray   { background: #f1f5f9; color: #334155; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #f5f3ff; color: #4c1d95; }

/* Accessible data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table caption {
    text-align: left;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    padding: 0 var(--space-md) var(--space-sm);
    caption-side: top;
}
.data-table thead th {
    padding: var(--space-sm) var(--space-md);
    text-align: left;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-secondary);
    background: #f1f5f9;
    border-top: 1px solid var(--color-border-light);
    border-bottom: 2px solid var(--color-border-medium);
}
.data-table tbody td {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--color-border-light);
    vertical-align: middle;
}
.data-table tbody tr:hover td {
    background: #f8fafc;
}

/* Required field marker — visual asterisk, aria-hidden in HTML */
.field-required {
    color: #dc2626;
    font-weight: bold;
    margin-left: 2px;
}

/* Respect prefers-reduced-motion — WCAG 2.5.3 / BFSG */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .card:hover { box-shadow: var(--shadow-md); transform: none; }
    .btn:hover  { transform: none; }
    html        { scroll-behavior: auto; }
}

/* =====================================================================
   ENTERPRISE / MATURITY OVERRIDES
   --------------------------------------------------------------------
   Cosmetic tightening of the original design system to give the V1
   template a calmer, more business-app feel. No functional changes:
   only colours, radii, shadows, hover states and a couple of
   component skins are re-tuned. Loaded last so it overrides the
   earlier rules.
   ===================================================================== */

:root {
    /* Brand: tone the primary blue down a bit */
    --color-primary:        #2547a3;
    --color-primary-dark:   #1c3680;
    --color-primary-light:  #3d62c4;

    /* Neutral backgrounds (less blue-ish) */
    --color-bg-primary:     #f6f7f9;
    --color-bg-secondary:   #eef0f4;
    --color-bg-tertiary:    #e2e6ec;
    --color-border-light:   #dfe3ea;
    --color-border-medium:  #c7cdd8;

    /* Smaller corner radii throughout */
    --radius-sm:  3px;
    --radius-md:  4px;
    --radius-lg:  6px;
    --radius-xl:  8px;
    --radius-2xl: 10px;

    /* Subtle, neutral shadows (no colored glow) */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-md: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
    --shadow-lg: 0 2px 4px rgba(15, 23, 42, .06), 0 4px 8px rgba(15, 23, 42, .04);
    --shadow-xl: 0 4px 12px rgba(15, 23, 42, .08);

    /* Sidebar tokens */
    --sidebar-bg:           #0f1d33;
    --sidebar-bg-hover:     rgba(255, 255, 255, .04);
    --sidebar-bg-active:    rgba(255, 255, 255, .06);
    --sidebar-border:       #1b2941;
    --sidebar-text:         #aab3c2;
    --sidebar-text-active:  #ffffff;
    --sidebar-label:        #5b6b87;
}

body {
    background: var(--color-bg-primary);
}

/* ---------- Buttons: flat, no sweep, no lift, no colored glow ---------- */
.btn {
    border-width: 1px;
    border-radius: var(--radius-lg);
    padding: 8px 16px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
    transition: background .12s, color .12s, border-color .12s;
}
.btn::before { content: none !important; }
.btn:hover { transform: none; }
.btn:active { transform: none; }

.btn-primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
    color: #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
    transform: none;
}
.btn-primary:active:not(:disabled) {
    background: var(--color-primary-dark);
    box-shadow: none;
    transform: none;
}

.btn-secondary {
    background: #fff;
    color: var(--color-text-primary);
    border-color: var(--color-border-medium);
    backdrop-filter: none;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    border-color: var(--color-border-medium);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
    transform: none;
}
.btn-secondary:active:not(:disabled) {
    background: var(--color-bg-tertiary);
    transform: none;
    box-shadow: none;
}

.btn-ghost { color: var(--color-text-secondary); }
.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
}

.btn-lg { padding: 10px 20px; font-size: var(--font-size-base); }
.btn-sm { padding: 7px 14px; font-size: var(--font-size-sm); }

/* ---------- Focus states: calm, business-style ring ---------- */
.btn:focus { outline: none; box-shadow: 0 1px 0 rgba(15, 23, 42, .04); }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 71, 163, .35);
}
.btn-primary:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 71, 163, .45);
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus,
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 71, 163, .15) !important;
}
a:focus-visible {
    outline: 2px solid rgba(37, 71, 163, .55);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Hero CTA: keep contrast on gradient hero, but no scale/lift */
.hero .btn-primary,
.hero .btn-secondary { transition: background .12s, color .12s, border-color .12s; }
.hero .btn-primary:hover:not(:disabled),
.hero .btn-secondary:hover:not(:disabled) { transform: none; }

/* ---------- Cards: smaller radius, single light border, flat shadow ---------- */
.card {
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
}

.card-icon {
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    box-shadow: none;
    width: 40px;
    height: 40px;
    font-size: var(--font-size-lg);
}
.card-icon .bi { color: var(--color-primary); font-size: 1.25rem; }

/* Feature icons (landing page): keep the gradient, but no scale/rotate hover */
.card:hover .feature-icon { transform: none; }
.card:hover .feature-icon::after { opacity: 0; }

/* ---------- Public Navbar: solid, no blur, no underline-bar ---------- */
.navbar {
    background: #fff;
    backdrop-filter: none;
}
.navbar-nav a.active::after { display: none; }
.navbar-nav a.active {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

/* ---------- Sidebar (app): active = left accent bar, calm hover ---------- */
.sidebar-nav a {
    border-radius: var(--radius-md);
    position: relative;
}
.sidebar-nav a.active {
    background: var(--sidebar-bg-active);
    color: var(--sidebar-text-active);
    box-shadow: none;
}
.sidebar-nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: #5e87e6;
    border-radius: 1px;
}

.sidebar-brand {
    font-weight: 600;
    letter-spacing: 0;
}
.sidebar-brand .brand-mono {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #3d62c4, var(--color-primary));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ---------- App topbar: solid, no shadow ---------- */
.app-topbar {
    background: #fff;
    box-shadow: none;
    border-bottom: 1px solid var(--color-border-light);
}

.topbar-tenant {
    border-radius: var(--radius-md);
    padding: 4px 10px;
    background: #fff;
    border-color: var(--color-border-light);
}

/* ---------- Notification trigger / badge: rectangular, calmer ---------- */
.notification-trigger {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    border-color: var(--color-border-light);
}
.notification-badge {
    background: #b91c1c;
    border-radius: 8px;
    min-width: 16px;
    height: 16px;
    font-size: 10px;
    box-shadow: 0 0 0 2px #fff;
}
.notification-panel {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.notification-item { border-radius: var(--radius-md); }
.notification-item.is-unread { background: #eef2f7; border-color: #c8d4e6; }

/* ---------- Pricing badge ---------- */
.pricing-badge { border-radius: var(--radius-md); text-transform: none; font-weight: 600; }

/* ---------- Settings nav active: keep accent bar, neutral background ---------- */
.settings-nav-item.active {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
}

/* ---------- Headlines feel calmer in app context ---------- */
.app-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -.005em;
    margin-bottom: .25rem;
}
.app-content h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.app-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .25rem;
}

/* ---------- Hero gradient: keep, but a touch deeper / more neutral ---------- */
.hero {
    background: linear-gradient(135deg, #1f3a8a 0%, #2547a3 60%, #1c3680 100%);
}

/* ---------- Forms: less juvenile radii ---------- */
input, select, textarea, .form-input, .form-select, .form-textarea {
    border-radius: var(--radius-md) !important;
}

/* ---------- Form validation states ---------------------------------------
   Blade forms attach `is-invalid` to inputs and render `<p class="form-error">`
   for messages, but the design system had no rules for either, so errors
   were invisible. Centralize the styling here. */
.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--color-error, #ef4444) !important;
    background-color: #fff5f5;
}
.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus,
input.is-invalid:focus,
select.is-invalid:focus,
textarea.is-invalid:focus {
    border-color: var(--color-error, #ef4444) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18) !important;
    outline: none;
}

/* Native HTML5 validation: highlight required-but-empty fields after the
   user interacts with them (or after a submit attempt). :user-invalid is
   supported in Chrome 119+, Safari 16.5+, Firefox 88+. */
.form-input:user-invalid,
.form-select:user-invalid,
.form-textarea:user-invalid,
input:user-invalid,
select:user-invalid,
textarea:user-invalid {
    border-color: var(--color-error, #ef4444) !important;
    background-color: #fff5f5;
}
.form-input:user-invalid:focus,
.form-select:user-invalid:focus,
.form-textarea:user-invalid:focus,
input:user-invalid:focus,
select:user-invalid:focus,
textarea:user-invalid:focus {
    border-color: var(--color-error, #ef4444) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .18) !important;
    outline: none;
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0 0;
    color: var(--color-error, #ef4444);
    font-size: var(--font-size-sm);
    line-height: 1.35;
    font-weight: 500;
}
.form-error::before {
    content: "\F33A"; /* bi-exclamation-circle */
    font-family: "bootstrap-icons";
    font-weight: normal;
    flex-shrink: 0;
    line-height: 1.35;
}

.form-hint {
    margin: 4px 0 0;
    color: var(--color-text-secondary);
    font-size: var(--font-size-xs);
    line-height: 1.4;
}

/* Highlight the field label of an invalid input when wrapped in a common
   parent. Pure-CSS pattern: any label inside a container that holds an
   .is-invalid input picks up the error color. */
.form-group:has(.is-invalid) .form-label,
.form-field:has(.is-invalid) .form-label,
[data-form-field]:has(.is-invalid) .form-label {
    color: var(--color-error, #ef4444);
}


/* ---------- Toggle / pricing / pill helpers: calm down ---------- */
.toggle-slider { box-shadow: none; }

/* Public navbar uses the same monogram square */
.navbar-brand .brand-mono {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #3d62c4, var(--color-primary));
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.navbar-brand { color: var(--color-text-primary); font-weight: 600; }
.navbar-brand:hover { color: var(--color-text-primary); }

/* ---------- Inline pill badges across views ----------
   Many older blade templates use inline style="border-radius:999px"
   for status/tag chips. Re-shape them at the document level so we
   don't have to touch every view. */
[style*="border-radius:999px"],
[style*="border-radius: 999px"] {
    border-radius: var(--radius-md) !important;
}

/* Auth & onboarding brand also gets the monogram square */
.auth-brand .brand-mono,
.ob-brand .brand-mono {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: linear-gradient(180deg, #3d62c4, var(--color-primary));
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.ob-brand { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Global mobile fallbacks ---------------------------------------
   Many Blade views ship hard-coded inline grids (1fr 1fr, 1fr 1fr 1fr …) and
   tables that overflow on phones. Re-shape them centrally so we don't have
   to touch every template. */
@media (max-width: 760px) {
    /* Collapse any inline 2/3/4-column grid to a single column */
    [style*="grid-template-columns:1fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns:repeat(2"],
    [style*="grid-template-columns: repeat(2"],
    [style*="grid-template-columns:repeat(3"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns:repeat(4"],
    [style*="grid-template-columns: repeat(4"] {
        grid-template-columns: 1fr !important;
    }

    /* Wide tables become horizontally scrollable instead of overflowing */
    .data-table,
    table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Generic content tightening on phones */
    .card { padding: var(--space-md); }
    h1 { font-size: 1.25rem !important; }
    h2 { font-size: 1.05rem !important; }
}

/* ---------- Auth pages: harmonised submit button + plain back link ---------- */
.auth-submit {
    padding: 14px 16px !important;
    font-size: var(--font-size-base) !important;
    border-radius: var(--radius-md) !important;
}

.auth-back-link {
    transition: color .12s;
}
.auth-back-link:hover {
    color: var(--color-text-primary) !important;
    text-decoration: none;
}
.auth-back-link .bi {
    font-size: .85em;
}
