/**
 * DoneBy Custom Styles
 *
 * Custom CSS for the DoneBy application.
 * Uses Bootstrap 5 utilities where possible.
 *
 * @package DoneBy
 */

/* === CSS Custom Properties (Variables) === */
:root {
    /* Brand colors */
    --hs-primary: #0d6efd;
    --hs-primary-hover: #0b5ed7;

    /* Status colors for tasks */
    --hs-status-todo: #6c757d;
    --hs-status-in-progress: #ffc107;
    --hs-status-completed: #198754;

    /* Priority colors */
    --hs-priority-low: #6c757d;
    --hs-priority-medium: #0dcaf0;
    --hs-priority-high: #fd7e14;
    --hs-priority-urgent: #dc3545;

    /* Layout */
    --hs-sidebar-width: 280px;
}

/* Dark mode overrides */
[data-bs-theme="dark"] {
    /* Adjust any colors that don't work well in dark mode */
    --hs-status-in-progress: #e0a800;
}

/* ==========================================================================
   APP-WIDE COLOR PALETTES
   Override Bootstrap's primary color and accents based on selected palette
   ========================================================================== */

/* Palette 1: Midnight (Default) - Deep blue/indigo */
:root,
[data-palette="midnight"] {
    --bs-primary: #3b82f6;
    --bs-primary-rgb: 59, 130, 246;
    --hs-primary: #3b82f6;
    --hs-primary-hover: #2563eb;
    --hs-accent: #60a5fa;
    --hs-gradient: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #4f46e5 100%);
}

/* Palette 2: Sunset - Warm orange/pink */
[data-palette="sunset"] {
    --bs-primary: #f97316;
    --bs-primary-rgb: 249, 115, 22;
    --hs-primary: #f97316;
    --hs-primary-hover: #ea580c;
    --hs-accent: #fb923c;
    --hs-gradient: linear-gradient(135deg, #9a3412 0%, #be123c 50%, #db2777 100%);
}

/* Palette 3: Ocean - Teal/cyan */
[data-palette="ocean"] {
    --bs-primary: #14b8a6;
    --bs-primary-rgb: 20, 184, 166;
    --hs-primary: #14b8a6;
    --hs-primary-hover: #0d9488;
    --hs-accent: #2dd4bf;
    --hs-gradient: linear-gradient(135deg, #155e75 0%, #0f766e 50%, #047857 100%);
}

/* Palette 4: Ember - Deep red/orange */
[data-palette="ember"] {
    --bs-primary: #ef4444;
    --bs-primary-rgb: 239, 68, 68;
    --hs-primary: #ef4444;
    --hs-primary-hover: #dc2626;
    --hs-accent: #f87171;
    --hs-gradient: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #c2410c 100%);
}

/* Palette 5: Forest - Rich green */
[data-palette="forest"] {
    --bs-primary: #22c55e;
    --bs-primary-rgb: 34, 197, 94;
    --hs-primary: #22c55e;
    --hs-primary-hover: #16a34a;
    --hs-accent: #4ade80;
    --hs-gradient: linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%);
}

/* Apply palette primary color to Bootstrap components */
.btn-primary {
    --bs-btn-bg: var(--hs-primary);
    --bs-btn-border-color: var(--hs-primary);
    --bs-btn-hover-bg: var(--hs-primary-hover);
    --bs-btn-hover-border-color: var(--hs-primary-hover);
    --bs-btn-active-bg: var(--hs-primary-hover);
    --bs-btn-active-border-color: var(--hs-primary-hover);
}

.btn-outline-primary {
    --bs-btn-color: var(--hs-primary);
    --bs-btn-border-color: var(--hs-primary);
    --bs-btn-hover-bg: var(--hs-primary);
    --bs-btn-hover-border-color: var(--hs-primary);
    --bs-btn-active-bg: var(--hs-primary);
    --bs-btn-active-border-color: var(--hs-primary);
}

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

.bg-primary {
    background-color: var(--hs-primary) !important;
}

.border-primary {
    border-color: var(--hs-primary) !important;
}

a {
    color: var(--hs-primary);
}

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

.nav-link.active,
.nav-link:hover {
    color: var(--hs-primary) !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--hs-primary);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--hs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-check-input:checked {
    background-color: var(--hs-primary);
    border-color: var(--hs-primary);
}

.page-link {
    color: var(--hs-primary);
}

.page-item.active .page-link {
    background-color: var(--hs-primary);
    border-color: var(--hs-primary);
}

/* Progress bars */
.progress-bar {
    background-color: var(--hs-primary);
}

/* Navbar brand and active states */
.navbar-brand {
    color: var(--hs-primary) !important;
}

/* Badge primary */
.badge.bg-primary {
    background-color: var(--hs-primary) !important;
}

/* === Palette Switcher in Navbar === */

.palette-switcher-nav {
    position: relative;
}

.palette-switcher-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--bs-navbar-color);
    border-radius: 0.375rem;
    transition: background-color 0.15s ease;
}

.palette-switcher-btn:hover {
    background-color: var(--bs-tertiary-bg);
}

.palette-indicator {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--hs-gradient);
    border: 2px solid var(--bs-border-color);
}

.palette-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    padding: 0.75rem 0.75rem 0.5rem;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    white-space: nowrap;
}

.palette-dropdown.show {
    display: block;
}

.palette-dropdown-header {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
    text-align: center;
}

.palette-options {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
    justify-content: center;
}

.palette-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.3rem 0.4rem;
    background: none;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.palette-option:hover {
    background: var(--bs-tertiary-bg);
}

.palette-option.active {
    border-color: var(--hs-primary);
    background: var(--bs-tertiary-bg);
}

.palette-option-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--bs-border-color);
}

.palette-option-label {
    font-size: 0.55rem;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Swatch gradients for each palette */
.swatch-midnight { background: linear-gradient(135deg, #1e3a8a, #4f46e5); }
.swatch-sunset { background: linear-gradient(135deg, #9a3412, #db2777); }
.swatch-ocean { background: linear-gradient(135deg, #155e75, #047857); }
.swatch-ember { background: linear-gradient(135deg, #7f1d1d, #c2410c); }
.swatch-forest { background: linear-gradient(135deg, #14532d, #15803d); }

/* === Layout === */

/* Make body fill viewport height for sticky footer */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Main content grows to push footer down */
main {
    flex: 1;
}

/* === Forms === */

/* Better focus states for accessibility */
.form-control:focus,
.form-select:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* === Task Cards === */

.task-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.task-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Status badges */
.badge-status-todo {
    background-color: var(--hs-status-todo);
}

.badge-status-in-progress {
    background-color: var(--hs-status-in-progress);
    color: #000;
}

.badge-status-completed {
    background-color: var(--hs-status-completed);
}

/* Priority badges */
.badge-priority-low {
    background-color: var(--hs-priority-low);
}

.badge-priority-medium {
    background-color: var(--hs-priority-medium);
    color: #000;
}

.badge-priority-high {
    background-color: var(--hs-priority-high);
    color: #000;
}

.badge-priority-urgent {
    background-color: var(--hs-priority-urgent);
}

/* === Category Colors === */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* === Dashboard Widgets === */

.widget-card {
    border: none;
    border-radius: 0.5rem;
}

.widget-card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .widget-card .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* === Utility Classes === */

/* Text truncation */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cursor pointer for clickable elements */
.cursor-pointer {
    cursor: pointer;
}

/* Hover effect for text links */
.link-hover-primary:hover {
    color: var(--bs-primary) !important;
}

/* === Drag-and-Drop Reordering === */

/* Drag handle styling */
.drag-handle {
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.drag-handle:hover {
    color: var(--bs-primary) !important;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Spin animation for loading state */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Sortable ghost (placeholder) styling */
.sortable-ghost {
    opacity: 0.4;
}

/* Chosen item while dragging */
.sortable-chosen {
    background-color: var(--bs-light) !important;
}

[data-bs-theme="dark"] .sortable-chosen {
    background-color: var(--bs-dark) !important;
}

/* Prevent text selection on interactive elements */
.no-select {
    user-select: none;
}

/* === Responsive Adjustments === */

@media (max-width: 767.98px) {
    .filter-bar {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-bar > * {
        width: 100%;
    }

    .btn {
        min-height: 44px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .btn-sm {
        min-height: 38px;
    }

    .dropdown-item {
        padding: 0.75rem 1rem;
    }

    .list-group-item {
        padding: 1rem;
    }

    .status-toggle {
        width: 40px !important;
        height: 40px !important;
    }

    .task-actions .btn {
        min-width: 44px;
        min-height: 44px;
    }

    .task-item .small {
        font-size: 0.8rem;
    }

    .col-lg-4 .card {
        margin-bottom: 1rem;
    }

    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 1rem;
    }

    .filter-label-mobile-hide {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* === Floating Action Button (Mobile) === */

.fab-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1030;
    display: none;
}

.fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

@media (max-width: 767.98px) {
    .fab-container {
        display: block;
    }

    main {
        padding-bottom: 5rem;
    }
}

/* === Animation === */

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

.alert {
    animation: fadeIn 0.3s ease;
}

/* === Toast Notifications === */

#flash-toast-container {
    z-index: 1090;
}

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

.flash-toast {
    animation: toastSlideIn 0.3s ease;
    min-width: 280px;
    max-width: 350px;
}

.flash-toast + .flash-toast {
    margin-top: 0.5rem;
}

/* === Skeleton Loading === */

@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

:root {
    --skeleton-base: #e9ecef;
    --skeleton-shine: #f8f9fa;
}

[data-bs-theme="dark"] {
    --skeleton-base: #343a40;
    --skeleton-shine: #495057;
}

.skeleton-text { height: 1em; margin-bottom: 0.5em; display: block; }
.skeleton-text:last-child { width: 70%; }
.skeleton-text-sm { height: 0.75em; }
.skeleton-text-lg { height: 1.5em; }
.skeleton-heading { height: 2em; width: 60%; margin-bottom: 1rem; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-avatar-sm { width: 32px; height: 32px; }
.skeleton-avatar-lg { width: 64px; height: 64px; }
.skeleton-btn { height: 38px; width: 100px; border-radius: 6px; }
.skeleton-btn-lg { height: 48px; width: 140px; }
.skeleton-card { padding: 1rem; }
.skeleton-card-body { display: flex; flex-direction: column; gap: 0.5rem; }
.skeleton-table-row { display: flex; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--bs-border-color); }
.skeleton-table-row > * { flex: 1; }
.skeleton-chart { height: 200px; border-radius: 8px; }
.skeleton-stat { text-align: center; padding: 1rem; }
.skeleton-stat-value { height: 2.5rem; width: 60%; margin: 0 auto 0.5rem; }
.skeleton-stat-label { height: 0.875rem; width: 80%; margin: 0 auto; }
.skeleton-badge { height: 1.25em; width: 60px; border-radius: 50rem; display: inline-block; }
.skeleton-img { width: 100%; aspect-ratio: 16/9; border-radius: 8px; }
.skeleton-img-square { aspect-ratio: 1; }
.skeleton-container.loaded .skeleton, .skeleton-container.loaded [class*="skeleton-"] { display: none; }
.skeleton-container .skeleton-content { display: none; }
.skeleton-container.loaded .skeleton-content { display: block; }
.skeleton-inline { display: inline-block; vertical-align: middle; }

/* === Print Styles === */

@media print {
    .navbar, footer, .btn, .no-print { display: none !important; }
    main { padding: 0 !important; }
}


/* ==========================================================================
   LANDING PAGE - FRESH BUILD
   ========================================================================== */

/* === Color Palettes === */

/* Palette 1: Midnight (Default) - Deep blue/indigo */
:root,
[data-palette="midnight"] {
    --lp-bg-dark: #0f172a;
    --lp-bg-medium: #1e293b;
    --lp-bg-light: #f1f5f9;
    --lp-accent: #3b82f6;
    --lp-accent-light: #60a5fa;
    --lp-gradient: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #4f46e5 100%);
    --lp-gradient-subtle: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    --lp-text-on-dark: #f8fafc;
    --lp-text-on-light: #0f172a;
    --lp-text-muted: #94a3b8;
    --lp-card-bg: rgba(255, 255, 255, 0.05);
    --lp-card-border: rgba(255, 255, 255, 0.1);
}

/* Palette 2: Sunset - Warm orange/pink */
[data-palette="sunset"] {
    --lp-bg-dark: #1c1917;
    --lp-bg-medium: #292524;
    --lp-bg-light: #fef7f0;
    --lp-accent: #f97316;
    --lp-accent-light: #fb923c;
    --lp-gradient: linear-gradient(135deg, #9a3412 0%, #be123c 50%, #db2777 100%);
    --lp-gradient-subtle: linear-gradient(180deg, #292524 0%, #1c1917 100%);
    --lp-text-on-dark: #fef7f0;
    --lp-text-on-light: #1c1917;
    --lp-text-muted: #a8a29e;
    --lp-card-bg: rgba(255, 255, 255, 0.05);
    --lp-card-border: rgba(255, 255, 255, 0.1);
}

/* Palette 3: Ocean - Teal/cyan */
[data-palette="ocean"] {
    --lp-bg-dark: #042f2e;
    --lp-bg-medium: #134e4a;
    --lp-bg-light: #ecfeff;
    --lp-accent: #14b8a6;
    --lp-accent-light: #2dd4bf;
    --lp-gradient: linear-gradient(135deg, #155e75 0%, #0f766e 50%, #047857 100%);
    --lp-gradient-subtle: linear-gradient(180deg, #134e4a 0%, #042f2e 100%);
    --lp-text-on-dark: #ecfeff;
    --lp-text-on-light: #042f2e;
    --lp-text-muted: #5eead4;
    --lp-card-bg: rgba(255, 255, 255, 0.08);
    --lp-card-border: rgba(255, 255, 255, 0.15);
}

/* Palette 4: Ember - Deep red/orange */
[data-palette="ember"] {
    --lp-bg-dark: #1a0a0a;
    --lp-bg-medium: #2d1515;
    --lp-bg-light: #fef2f2;
    --lp-accent: #ef4444;
    --lp-accent-light: #f87171;
    --lp-gradient: linear-gradient(135deg, #7f1d1d 0%, #991b1b 50%, #c2410c 100%);
    --lp-gradient-subtle: linear-gradient(180deg, #2d1515 0%, #1a0a0a 100%);
    --lp-text-on-dark: #fef2f2;
    --lp-text-on-light: #1a0a0a;
    --lp-text-muted: #fca5a5;
    --lp-card-bg: rgba(255, 255, 255, 0.06);
    --lp-card-border: rgba(255, 255, 255, 0.12);
}

/* Palette 5: Forest - Rich green */
[data-palette="forest"] {
    --lp-bg-dark: #052e16;
    --lp-bg-medium: #14532d;
    --lp-bg-light: #f0fdf4;
    --lp-accent: #22c55e;
    --lp-accent-light: #4ade80;
    --lp-gradient: linear-gradient(135deg, #14532d 0%, #166534 50%, #15803d 100%);
    --lp-gradient-subtle: linear-gradient(180deg, #14532d 0%, #052e16 100%);
    --lp-text-on-dark: #f0fdf4;
    --lp-text-on-light: #052e16;
    --lp-text-muted: #86efac;
    --lp-card-bg: rgba(255, 255, 255, 0.08);
    --lp-card-border: rgba(255, 255, 255, 0.15);
}

/* === Landing Page Base === */

.lp-page {
    background: var(--lp-bg-dark);
    color: var(--lp-text-on-dark);
}

/* === Section Styles === */

.lp-section {
    position: relative;
    overflow: hidden;
}

.lp-section-dark {
    background: var(--lp-bg-dark);
    color: var(--lp-text-on-dark);
}

.lp-section-gradient {
    background: var(--lp-gradient);
    color: var(--lp-text-on-dark);
}

.lp-section-medium {
    background: var(--lp-bg-medium);
    color: var(--lp-text-on-dark);
}

.lp-section-light {
    background: var(--lp-bg-light);
    color: var(--lp-text-on-light);
}

/* === Hero Section === */

.lp-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--lp-gradient);
    position: relative;
    padding: 6rem 0;
}

.lp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 40%);
}

.lp-hero-content {
    position: relative;
    z-index: 1;
}

/* Hero slogan — playful brand line shown as a pill above the headline.
   Translucent white so it reads on every palette's hero gradient. */
.lp-slogan {
    display: inline-block;
    font-size: clamp(0.95rem, 1.5vw, 1.1rem);
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 1.25rem;
}

.lp-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.lp-hero .lead {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    opacity: 0.9;
    max-width: 540px;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.lp-hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.lp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.lp-btn-primary {
    background: #fff;
    color: var(--lp-bg-dark);
}

.lp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    color: var(--lp-bg-dark);
}

.lp-btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
}

.lp-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

/* Hero Mockup */
.lp-hero-visual {
    position: relative;
}

.lp-mockup {
    background: var(--lp-card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--lp-card-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 40px 80px rgba(0,0,0,0.4);
}

.lp-mockup-header {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--lp-card-border);
}

.lp-mockup-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lp-text-muted);
    opacity: 0.5;
}

.lp-mockup-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lp-mockup-card {
    flex: 1;
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-card-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.lp-mockup-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--lp-accent-light);
}

.lp-mockup-card-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.lp-mockup-task {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-card-border);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.lp-mockup-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid var(--lp-text-muted);
    flex-shrink: 0;
}

.lp-mockup-checkbox.done {
    background: var(--lp-accent);
    border-color: var(--lp-accent);
}

.lp-mockup-task-text {
    flex: 1;
    font-size: 0.9rem;
}

.lp-mockup-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    background: var(--lp-accent);
    color: #fff;
    font-weight: 600;
}

/* === Features Section === */

.lp-features {
    padding: 8rem 0;
}

.lp-section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 5rem;
}

.lp-section-label {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--lp-accent-light);
    margin-bottom: 1rem;
}

.lp-section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.lp-section-subtitle {
    font-size: 1.15rem;
    opacity: 0.8;
    line-height: 1.6;
}

.lp-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.lp-feature-card {
    background: var(--lp-card-bg);
    border: 1px solid var(--lp-card-border);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.3s ease;
}

.lp-feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--lp-accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.lp-feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--lp-accent), var(--lp-accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.lp-feature-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.lp-feature-card p {
    opacity: 0.8;
    line-height: 1.6;
    margin: 0;
}

/* === Showcase Section (alternating) === */

.lp-showcase {
    padding: 6rem 0;
}

.lp-showcase-row {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 6rem;
}

.lp-showcase-row:last-child {
    margin-bottom: 0;
}

.lp-showcase-row.reverse {
    flex-direction: row-reverse;
}

.lp-showcase-content {
    flex: 1;
}

.lp-showcase-visual {
    flex: 1;
}

.lp-showcase-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.lp-showcase-content p {
    font-size: 1.1rem;
    opacity: 0.85;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.lp-check-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lp-check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.lp-check-list i {
    color: var(--lp-accent-light);
    font-size: 1.2rem;
    margin-top: 0.1rem;
}

/* === Stats Section === */

.lp-stats {
    padding: 5rem 0;
}

.lp-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.lp-stat {
    text-align: center;
    padding: 2rem;
}

.lp-stat-icon {
    font-size: 2.5rem;
    color: var(--lp-accent-light);
    margin-bottom: 1rem;
}

.lp-stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lp-stat-desc {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* === How It Works === */

.lp-steps {
    padding: 8rem 0;
}

.lp-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    position: relative;
}

.lp-steps-grid::before {
    content: '';
    position: absolute;
    top: 50px;
    left: calc(16.67% + 1.5rem);
    right: calc(16.67% + 1.5rem);
    height: 2px;
    background: var(--lp-card-border);
}

.lp-step {
    text-align: center;
    position: relative;
}

.lp-step-number {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--lp-gradient);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.lp-step h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.lp-step p {
    opacity: 0.8;
    line-height: 1.6;
}

/* === Testimonial/Quote === */

.lp-quote {
    padding: 6rem 0;
    text-align: center;
}

.lp-quote blockquote {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.5;
    max-width: 900px;
    margin: 0 auto 1.5rem;
    opacity: 0.95;
}

.lp-quote cite {
    font-size: 1rem;
    opacity: 0.7;
    font-style: normal;
}

/* === CTA Section === */

.lp-cta {
    padding: 8rem 0;
    text-align: center;
}

.lp-cta h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.lp-cta p {
    font-size: 1.2rem;
    opacity: 0.85;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.lp-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* === Palette Switcher === */

.lp-palette-toggle {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--lp-accent);
    color: #fff;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lp-palette-toggle:hover {
    transform: scale(1.1);
}

.lp-palette-panel {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 1001;
    background: var(--lp-bg-medium);
    border: 1px solid var(--lp-card-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    display: none;
}

.lp-palette-panel.open {
    display: block;
}

.lp-palette-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--lp-card-border);
}

.lp-palette-header span {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lp-palette-close {
    background: none;
    border: none;
    color: var(--lp-text-on-dark);
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.7;
}

.lp-palette-close:hover {
    opacity: 1;
}

.lp-palette-grid {
    display: flex;
    gap: 1rem;
}

.lp-palette-swatch {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.lp-palette-swatch:hover {
    transform: scale(1.1);
}

.lp-palette-swatch.active {
    border-color: #fff;
}

.lp-palette-swatch.active::after {
    content: '\2713';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.25rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.lp-swatch-midnight { background: linear-gradient(135deg, #1e3a8a, #4f46e5); }
.lp-swatch-sunset { background: linear-gradient(135deg, #9a3412, #db2777); }
.lp-swatch-ocean { background: linear-gradient(135deg, #155e75, #047857); }
.lp-swatch-ember { background: linear-gradient(135deg, #7f1d1d, #c2410c); }
.lp-swatch-forest { background: linear-gradient(135deg, #14532d, #15803d); }

.lp-palette-name {
    font-size: 0.7rem;
    text-align: center;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* === Responsive === */

@media (max-width: 991.98px) {
    .lp-hero {
        min-height: auto;
        padding: 5rem 0;
    }

    .lp-showcase-row,
    .lp-showcase-row.reverse {
        flex-direction: column;
        gap: 3rem;
    }

    .lp-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lp-steps-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .lp-steps-grid::before {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .lp-hero h1 {
        font-size: 2.25rem;
    }

    .lp-features,
    .lp-steps,
    .lp-cta {
        padding: 5rem 0;
    }

    .lp-section-header {
        margin-bottom: 3rem;
    }

    .lp-feature-grid {
        grid-template-columns: 1fr;
    }

    .lp-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .lp-stat {
        padding: 1.5rem;
    }

    .lp-palette-toggle {
        bottom: 1rem;
        left: 1rem;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .lp-palette-panel {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
    }

    .lp-palette-grid {
        justify-content: center;
    }
}


/* ==========================================================================
   APP-WIDE THEMED STYLES
   Bold, immersive design with gradient backgrounds and glass effects
   ========================================================================== */

/* === App Background Variables (Dark Mode - Default) === */

:root,
[data-palette="midnight"] {
    --app-bg-primary: #0f172a;
    --app-bg-secondary: #1e293b;
    --app-bg-tertiary: #334155;
    --app-bg-surface: rgba(255, 255, 255, 0.05);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.08);
    --app-border: rgba(255, 255, 255, 0.1);
    --app-border-light: rgba(255, 255, 255, 0.05);
    --app-text: #f8fafc;
    --app-text-muted: #94a3b8;
    --app-shadow: rgba(0, 0, 0, 0.4);
    --app-glow: rgba(59, 130, 246, 0.3);
}

[data-palette="sunset"] {
    --app-bg-primary: #1c1917;
    --app-bg-secondary: #292524;
    --app-bg-tertiary: #44403c;
    --app-bg-surface: rgba(255, 255, 255, 0.05);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.08);
    --app-border: rgba(255, 255, 255, 0.1);
    --app-border-light: rgba(255, 255, 255, 0.05);
    --app-text: #fef7f0;
    --app-text-muted: #a8a29e;
    --app-shadow: rgba(0, 0, 0, 0.4);
    --app-glow: rgba(249, 115, 22, 0.3);
}

[data-palette="ocean"] {
    --app-bg-primary: #042f2e;
    --app-bg-secondary: #134e4a;
    --app-bg-tertiary: #1e6e68;
    --app-bg-surface: rgba(255, 255, 255, 0.08);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.12);
    --app-border: rgba(255, 255, 255, 0.15);
    --app-border-light: rgba(255, 255, 255, 0.08);
    --app-text: #ecfeff;
    --app-text-muted: #5eead4;
    --app-shadow: rgba(0, 0, 0, 0.4);
    --app-glow: rgba(20, 184, 166, 0.3);
}

[data-palette="ember"] {
    --app-bg-primary: #1a0a0a;
    --app-bg-secondary: #2d1515;
    --app-bg-tertiary: #451a1a;
    --app-bg-surface: rgba(255, 255, 255, 0.06);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.1);
    --app-border: rgba(255, 255, 255, 0.12);
    --app-border-light: rgba(255, 255, 255, 0.06);
    --app-text: #fef2f2;
    --app-text-muted: #fca5a5;
    --app-shadow: rgba(0, 0, 0, 0.4);
    --app-glow: rgba(239, 68, 68, 0.3);
}

[data-palette="forest"] {
    --app-bg-primary: #052e16;
    --app-bg-secondary: #14532d;
    --app-bg-tertiary: #166534;
    --app-bg-surface: rgba(255, 255, 255, 0.08);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.12);
    --app-border: rgba(255, 255, 255, 0.15);
    --app-border-light: rgba(255, 255, 255, 0.08);
    --app-text: #f0fdf4;
    --app-text-muted: #86efac;
    --app-shadow: rgba(0, 0, 0, 0.4);
    --app-glow: rgba(34, 197, 94, 0.3);
}

/* === Light Mode Variants (Inverted Bold Style) === */

[data-bs-theme="light"],
[data-bs-theme="light"][data-palette="midnight"] {
    --app-bg-primary: #f8fafc;
    --app-bg-secondary: #f1f5f9;
    --app-bg-tertiary: #e2e8f0;
    --app-bg-surface: rgba(255, 255, 255, 0.8);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.95);
    --app-border: rgba(0, 0, 0, 0.1);
    --app-border-light: rgba(0, 0, 0, 0.05);
    --app-text: #0f172a;
    --app-text-muted: #64748b;
    --app-shadow: rgba(0, 0, 0, 0.1);
    --app-glow: rgba(59, 130, 246, 0.2);
}

[data-bs-theme="light"][data-palette="sunset"] {
    --app-bg-primary: #fef7f0;
    --app-bg-secondary: #fef3e2;
    --app-bg-tertiary: #fed7aa;
    --app-bg-surface: rgba(255, 255, 255, 0.8);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.95);
    --app-border: rgba(0, 0, 0, 0.1);
    --app-border-light: rgba(0, 0, 0, 0.05);
    --app-text: #1c1917;
    --app-text-muted: #78716c;
    --app-shadow: rgba(0, 0, 0, 0.1);
    --app-glow: rgba(249, 115, 22, 0.2);
}

[data-bs-theme="light"][data-palette="ocean"] {
    --app-bg-primary: #ecfeff;
    --app-bg-secondary: #cffafe;
    --app-bg-tertiary: #a5f3fc;
    --app-bg-surface: rgba(255, 255, 255, 0.8);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.95);
    --app-border: rgba(0, 0, 0, 0.1);
    --app-border-light: rgba(0, 0, 0, 0.05);
    --app-text: #042f2e;
    --app-text-muted: #0f766e;
    --app-shadow: rgba(0, 0, 0, 0.1);
    --app-glow: rgba(20, 184, 166, 0.2);
}

[data-bs-theme="light"][data-palette="ember"] {
    --app-bg-primary: #fef2f2;
    --app-bg-secondary: #fee2e2;
    --app-bg-tertiary: #fecaca;
    --app-bg-surface: rgba(255, 255, 255, 0.8);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.95);
    --app-border: rgba(0, 0, 0, 0.1);
    --app-border-light: rgba(0, 0, 0, 0.05);
    --app-text: #1a0a0a;
    --app-text-muted: #991b1b;
    --app-shadow: rgba(0, 0, 0, 0.1);
    --app-glow: rgba(239, 68, 68, 0.2);
}

[data-bs-theme="light"][data-palette="forest"] {
    --app-bg-primary: #f0fdf4;
    --app-bg-secondary: #dcfce7;
    --app-bg-tertiary: #bbf7d0;
    --app-bg-surface: rgba(255, 255, 255, 0.8);
    --app-bg-surface-hover: rgba(255, 255, 255, 0.95);
    --app-border: rgba(0, 0, 0, 0.1);
    --app-border-light: rgba(0, 0, 0, 0.05);
    --app-text: #052e16;
    --app-text-muted: #166534;
    --app-shadow: rgba(0, 0, 0, 0.1);
    --app-glow: rgba(34, 197, 94, 0.2);
}

/* === App Body & Layout === */

.app-body {
    background: var(--app-bg-primary);
    color: var(--app-text);
    min-height: 100vh;
}

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--app-bg-primary);
}

.app-main {
    flex: 1;
    background: var(--app-bg-secondary);
    color: var(--app-text);
}

.app-main .container {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* === App Navbar === */

.app-navbar {
    background: var(--hs-gradient) !important;
    border-bottom: 1px solid var(--app-border);
    box-shadow: 0 4px 20px var(--app-shadow);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 700;
}

.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    transition: color 0.2s ease;
}

.app-navbar .nav-link:hover,
.app-navbar .nav-link.active {
    color: #fff !important;
}

.app-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

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

.app-navbar .dropdown-menu {
    background: var(--app-bg-secondary);
    border: 1px solid var(--app-border);
    box-shadow: 0 10px 40px var(--app-shadow);
}

.app-navbar .dropdown-item {
    color: var(--app-text);
}

.app-navbar .dropdown-item:hover,
.app-navbar .dropdown-item:focus {
    background: var(--app-bg-surface-hover);
    color: var(--app-text);
}

.app-navbar .dropdown-item.active {
    background: var(--hs-primary);
    color: #fff;
}

.app-navbar .dropdown-divider {
    border-color: var(--app-border);
}

.app-navbar .btn.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
}

.app-navbar .btn.nav-link:hover {
    color: #fff !important;
}

.app-navbar .palette-indicator {
    border-color: rgba(255, 255, 255, 0.3);
}

/* Light mode navbar adjustments */
[data-bs-theme="light"] .app-navbar .dropdown-menu {
    background: var(--app-bg-surface);
    backdrop-filter: blur(10px);
}

/* === App Footer === */

.app-footer {
    background: var(--app-bg-primary);
    border-top: 1px solid var(--app-border);
    color: var(--app-text-muted);
    padding: 1.5rem 0;
}

.app-footer a {
    color: var(--app-text-muted);
}

.app-footer a:hover {
    color: var(--hs-primary);
}

/* === Glass Card === */

.glass-card {
    background: var(--app-bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px var(--app-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px var(--app-shadow);
    border-color: var(--app-border);
}

.glass-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--app-border-light);
    color: var(--app-text);
}

.glass-card .card-body {
    color: var(--app-text);
}

.glass-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--app-border-light);
}

/* Glass card text colors */
.glass-card .text-body-secondary,
.glass-card .text-muted {
    color: var(--app-text-muted) !important;
}

/* === Page Header with Gradient === */

.app-page-header {
    background: var(--hs-gradient);
    margin: -2rem -0.75rem 2rem -0.75rem;
    padding: 2.5rem 1.5rem;
    color: #fff;
    border-radius: 0 0 24px 24px;
    position: relative;
    overflow: hidden;
}

.app-page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
}

.app-page-header h1,
.app-page-header h2,
.app-page-header .h1,
.app-page-header .h2 {
    color: #fff;
    position: relative;
    z-index: 1;
}

.app-page-header p {
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    z-index: 1;
}

.app-page-header .breadcrumb {
    position: relative;
    z-index: 1;
}

.app-page-header .breadcrumb-item,
.app-page-header .breadcrumb-item a {
    color: rgba(255, 255, 255, 0.7);
}

.app-page-header .breadcrumb-item.active {
    color: #fff;
}

.app-page-header .btn {
    position: relative;
    z-index: 1;
}

/* Theme-aware button styling for gradient header */
.app-page-header .btn-light {
    background: var(--app-bg-surface);
    border-color: var(--app-border);
    color: var(--app-text);
    font-weight: 500;
}

.app-page-header .btn-light:hover,
.app-page-header .btn-light:focus {
    background: var(--app-bg-secondary);
    color: var(--app-text);
    border-color: var(--app-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Dark mode: swap default/hover so darker by default, lighter on hover */
[data-bs-theme="dark"] .app-page-header .btn-light {
    background: var(--app-bg-secondary);
}

[data-bs-theme="dark"] .app-page-header .btn-light:hover,
[data-bs-theme="dark"] .app-page-header .btn-light:focus {
    background: var(--app-bg-surface);
}

@media (min-width: 576px) {
    .app-page-header {
        margin: -2rem -1.5rem 2rem -1.5rem;
        padding: 3rem 2rem;
    }
}

/* === Stat Cards === */

.stat-card {
    background: var(--app-bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--hs-primary);
}

.stat-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--hs-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: #fff;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--hs-accent);
    line-height: 1.2;
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--app-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === Widget Cards === */

.widget-card.glass-card {
    border-radius: 20px;
}

.widget-card .card-header {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.widget-card .card-body {
    padding: 1.5rem;
}

/* === Form Styling === */

.app-main .form-control,
.app-main .form-select {
    background: var(--app-bg-surface);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-main .form-control:focus,
.app-main .form-select:focus {
    background: var(--app-bg-surface-hover);
    border-color: var(--hs-primary);
    box-shadow: 0 0 0 3px var(--app-glow);
    color: var(--app-text);
}

.app-main .form-control::placeholder {
    color: var(--app-text-muted);
}

/* Select dropdown option styling for dark mode */
.app-main .form-select option {
    background: var(--app-bg-secondary);
    color: var(--app-text);
}

[data-bs-theme="light"] .app-main .form-select option {
    background: #fff;
    color: #212529;
}

.app-main .form-label {
    color: var(--app-text);
    font-weight: 500;
}

.app-main .form-text {
    color: var(--app-text-muted);
}

.app-main .input-group-text {
    background: var(--app-bg-tertiary);
    border: 1px solid var(--app-border);
    color: var(--app-text-muted);
}

/* Form check styling */
.app-main .form-check-input {
    background-color: var(--app-bg-surface);
    border-color: var(--app-border);
}

.app-main .form-check-input:checked {
    background-color: var(--hs-primary);
    border-color: var(--hs-primary);
}

.app-main .form-check-label {
    color: var(--app-text);
}

/* === Table Styling === */

.app-main .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--app-text);
    --bs-table-border-color: var(--app-border-light);
}

.app-main .table thead th {
    background: var(--app-bg-tertiary);
    color: var(--app-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--app-border);
}

.app-main .table tbody tr {
    transition: background-color 0.15s ease;
}

.app-main .table tbody tr:hover {
    background: var(--app-bg-surface-hover);
}

/* Breaker panel: disable full row hover, highlight left or right side only */
.breaker-panel .table tbody tr:hover {
    background: transparent;
}

/* Left side hover - when any of first 3 cells is hovered, highlight all 3 */
.breaker-panel .table tbody tr:has(td:nth-child(-n+3):hover) td:nth-child(-n+3) {
    background: var(--app-bg-surface-hover);
}

/* Right side hover - when any of cells 4-6 is hovered, highlight all 3 */
.breaker-panel .table tbody tr:has(td:nth-child(n+4):hover) td:nth-child(n+4) {
    background: var(--app-bg-surface-hover);
}

/* Breaker panel sizing - allow expansion for longer names */
.breaker-panel {
    width: fit-content;
    min-width: 500px;
    max-width: 1350px;
}

.circuit-grid .table {
    width: 100%;
}

/* Breaker label cells - expand for content, truncate at max */
.breaker-left,
.breaker-right {
    white-space: nowrap;
    max-width: 330px;
}

/* Allow the inner flex container to truncate properly */
.breaker-left > div,
.breaker-right > div {
    min-width: 0;
    max-width: 100%;
}

/* Truncate long label text with ellipsis */
.breaker-left span[title],
.breaker-right span[title] {
    display: inline-block;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.app-main .table td {
    vertical-align: middle;
    color: var(--app-text);
}

/* Glass table variant */
.table-glass {
    background: var(--app-bg-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--app-border);
}

/* === List Group Styling === */

.app-main .list-group {
    border-radius: 12px;
    overflow: hidden;
}

.app-main .list-group-item {
    background: var(--app-bg-surface);
    border-color: var(--app-border-light);
    color: var(--app-text);
    transition: background-color 0.15s ease;
}

.app-main .list-group-item:hover {
    background: var(--app-bg-surface-hover);
}

.app-main .list-group-item.active {
    background: var(--hs-primary);
    border-color: var(--hs-primary);
}

/* === Button Enhancements === */

.app-main .btn-primary {
    background: var(--hs-gradient);
    border: none;
    box-shadow: 0 4px 15px var(--app-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-main .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--app-glow);
}

.app-main .btn-outline-secondary {
    border-color: var(--app-border);
    color: var(--app-text);
}

.app-main .btn-outline-secondary:hover {
    background: var(--app-bg-surface);
    border-color: var(--app-border);
    color: var(--app-text);
}

/* === Badge Enhancements === */

.gradient-badge {
    background: var(--hs-gradient);
    color: #fff;
    border: none;
}

/* === Alert Styling === */

.app-main .alert {
    border: 1px solid var(--app-border);
    border-radius: 12px;
}

.app-main .alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.app-main .alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.app-main .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.app-main .alert-info {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

/* === Pagination === */

.app-main .pagination {
    gap: 0.25rem;
}

.app-main .page-link {
    background: var(--app-bg-surface);
    border: 1px solid var(--app-border);
    color: var(--app-text);
    border-radius: 8px;
}

.app-main .page-link:hover {
    background: var(--app-bg-surface-hover);
    border-color: var(--app-border);
    color: var(--hs-primary);
}

.app-main .page-item.active .page-link {
    background: var(--hs-gradient);
    border-color: transparent;
}

/* === Modal Styling === */

.modal-content {
    background: var(--app-bg-secondary);
    border: 1px solid var(--app-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px var(--app-shadow);
}

.modal-header {
    border-bottom-color: var(--app-border);
    color: var(--app-text);
}

.modal-body {
    color: var(--app-text);
}

.modal-footer {
    border-top-color: var(--app-border);
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="light"] .btn-close {
    filter: none;
}

/* === Task List Item === */

.task-item-glass {
    background: var(--app-bg-surface);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.task-item-glass:hover {
    background: var(--app-bg-surface-hover);
    transform: translateX(4px);
    border-color: var(--hs-primary);
}

/* === Empty State === */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--app-text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--app-text);
    margin-bottom: 0.5rem;
}

/* === Filter Section === */

.filter-section {
    background: var(--app-bg-surface);
    border: 1px solid var(--app-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* === Auth Pages (Login/Register) === */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hs-gradient);
    padding: 2rem;
    position: relative;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255,255,255,0.05) 0%, transparent 40%);
}

.auth-card {
    background: var(--app-bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--app-border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

.auth-card .form-control {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--app-border);
    color: #fff;
    padding: 0.875rem 1rem;
    border-radius: 10px;
}

.auth-card .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--hs-accent);
    box-shadow: 0 0 0 3px var(--app-glow);
}

.auth-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.auth-card .form-label {
    color: rgba(255, 255, 255, 0.9);
}

.auth-card h1,
.auth-card h2 {
    color: #fff;
}

.auth-card p {
    color: rgba(255, 255, 255, 0.7);
}

.auth-card a {
    color: var(--hs-accent);
}

.auth-card .btn-primary {
    background: #fff;
    color: var(--app-bg-primary);
    border: none;
    padding: 0.875rem 2rem;
    font-weight: 600;
    border-radius: 10px;
}

.auth-card .btn-primary:hover {
    background: rgba(255, 255, 255, 0.9);
    color: var(--app-bg-primary);
}

/* Light mode auth adjustments */
[data-bs-theme="light"] .auth-card .form-control {
    background: rgba(0, 0, 0, 0.05);
    color: var(--app-text);
}

[data-bs-theme="light"] .auth-card .form-control::placeholder {
    color: var(--app-text-muted);
}

[data-bs-theme="light"] .auth-card .form-label {
    color: #fff;
}

/* === Progress Bar === */

.app-main .progress {
    background: var(--app-bg-tertiary);
    border-radius: 10px;
    overflow: hidden;
}

.app-main .progress-bar {
    background: var(--hs-gradient);
}

/* === Dropdown in App === */

.app-main .dropdown-menu {
    background: var(--app-bg-secondary);
    border: 1px solid var(--app-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px var(--app-shadow);
}

.app-main .dropdown-item {
    color: var(--app-text);
    padding: 0.625rem 1rem;
    transition: background-color 0.15s ease;
}

.app-main .dropdown-item:hover {
    background: var(--app-bg-surface-hover);
    color: var(--app-text);
}

.app-main .dropdown-item.active,
.app-main .dropdown-item:active {
    background: var(--hs-primary);
    color: #fff;
}

.app-main .dropdown-divider {
    border-color: var(--app-border);
}

/* === Text Colors in App === */

.app-main {
    color: var(--app-text);
}

.app-main .text-body-secondary,
.app-main .text-muted {
    color: var(--app-text-muted) !important;
}

.app-main h1, .app-main h2, .app-main h3,
.app-main h4, .app-main h5, .app-main h6,
.app-main .h1, .app-main .h2, .app-main .h3,
.app-main .h4, .app-main .h5, .app-main .h6 {
    color: var(--app-text);
}

/* === Responsive App Styles === */

@media (max-width: 767.98px) {
    .app-page-header {
        margin: -1rem -0.75rem 1.5rem -0.75rem;
        padding: 1.5rem 1rem;
        border-radius: 0 0 16px 16px;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card-value {
        font-size: 1.5rem;
    }

    .glass-card {
        border-radius: 12px;
    }

    .auth-card {
        padding: 2rem;
        border-radius: 20px;
    }
}

/* === Utility Classes === */

.bg-app-primary { background: var(--app-bg-primary); }
.bg-app-secondary { background: var(--app-bg-secondary); }
.bg-app-tertiary { background: var(--app-bg-tertiary); }
.bg-app-surface { background: var(--app-bg-surface); }
.text-app { color: var(--app-text); }
.text-app-muted { color: var(--app-text-muted); }
.border-app { border-color: var(--app-border) !important; }


/* ==========================================================================
   MOBILE APP SHELL
   Styles for the PWA/mobile experience: fixed bottom nav, "More" offcanvas
   sheet, stacked-card tables, and general app-chrome polish.

   IMPORTANT: All rules that affect layout are either:
     (a) inside a max-width media query so they never fire at ≥992px, or
     (b) scoped to .has-app-shell (added by JS only when the bottom nav is
         present) so guest pages without the shell are unaffected.

   Design tokens used throughout — no hardcoded colors — so light/dark mode
   and palette switching work automatically without extra overrides here.
   ========================================================================== */

/* === Global Mobile Polish === */

/*
 * Prevent iOS from auto-scaling text when the device rotates.
 * This is safe to apply globally — it only affects Safari's zoom behavior.
 */
html {
    -webkit-text-size-adjust: 100%;
}

/* ==========================================================================
   APP-SHELL CHROME (≤991.98px — the breakpoint where the bottom nav appears)
   ========================================================================== */

@media (max-width: 991.98px) {

    /* --- Hamburger suppression (app-shell pages only) ---
     *
     * When .has-app-shell is on <body> the bottom tab bar replaces the
     * collapsed navbar. We hide the hamburger toggler and the collapsible
     * menu so the top navbar acts as a slim branded header.
     *
     * Guest pages (no .has-app-shell) keep their hamburger untouched.
     */
    .has-app-shell .navbar-toggler {
        display: none;
    }

    /*
     * !important is required here to override Bootstrap's own
     * .navbar-collapse show/hide logic, which also uses !important internally
     * via the collapse JS classes. Without it the menu can flash visible.
     */
    .has-app-shell .navbar-collapse {
        display: none !important;
    }

    /*
     * Shift the navbar down on devices with a notch/status-bar cutout
     * (e.g. iPhone with Face ID). env(safe-area-inset-top) is 0 on devices
     * without a notch, so this rule is harmless elsewhere.
     */
    .has-app-shell .app-navbar {
        padding-top: env(safe-area-inset-top);
    }

    /* --- Footer ---
     *
     * The decorative app footer is redundant on mobile — navigation is
     * handled by the bottom tab bar. Hide it to reclaim vertical space.
     */
    .app-footer {
        display: none;
    }

    /* --- Main content bottom padding ---
     *
     * The bottom nav is 56px tall plus the iOS safe-area inset. We need
     * enough padding so the last piece of content is not obscured by the
     * fixed bar. The 0.5rem adds a comfortable visual gap above the bar.
     *
     * Scoped to .has-app-shell so guest pages (no bottom nav) are unaffected.
     * The old FAB-only `padding-bottom: 5rem` rule at ≤767.98px is left intact
     * for non-shell pages; on shell pages this rule wins because it is declared
     * later in the file (same specificity, source order wins in CSS).
     */
    .has-app-shell .app-main,
    .has-app-shell main {
        padding-bottom: calc(56px + env(safe-area-inset-bottom) + 0.5rem);
    }

    /* --- Floating Action Button lift ---
     *
     * The FAB must sit ABOVE the bottom nav, not behind it. We reposition
     * its bottom offset so it clears the nav height + safe area + breathing
     * room. The existing FAB rule (display: block) at ≤767.98px still fires;
     * we only override the bottom value here.
     */
    .has-app-shell .fab-container {
        bottom: calc(56px + env(safe-area-inset-bottom) + 1rem);
    }

}

/* ==========================================================================
   BOTTOM TAB BAR
   ========================================================================== */

/*
 * The nav itself is always in the DOM but carries Bootstrap's d-lg-none so
 * Bootstrap hides it at ≥992px via display:none. These rules only need to
 * set up the visual appearance — we don't need to add another media query
 * wrapper because Bootstrap's utility handles the show/hide.
 *
 * However, the fixed positioning would still consume z-index stack space even
 * when hidden, so Bootstrap's d-lg-none is the correct gate.
 */

.app-bottom-nav {
    /* Fixed to the bottom edge of the viewport, full width */
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030; /* Same level as Bootstrap's navbar — sits above content */

    /* Flex row: children (tab items) share equal width */
    display: flex;
    flex-direction: row;
    align-items: stretch;

    /* Surface: use the secondary background token so it matches the navbar */
    background-color: var(--app-bg-secondary);
    border-top: 1px solid var(--app-border);
    box-shadow: 0 -4px 20px var(--app-shadow);

    /*
     * iOS safe-area: env(safe-area-inset-bottom) is the height of the home
     * indicator bar. Adding it as padding-bottom pushes the tab content up
     * so it is never obscured by the gesture bar.
     */
    padding-bottom: env(safe-area-inset-bottom);
}

.app-bottom-nav-item {
    /* Each item gets equal share of the full bar width */
    flex: 1;

    /* Stack icon above label, both centred */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;

    /* Minimum touch target height recommended by Apple HIG and Google MD */
    min-height: 56px;

    /* Default (inactive) colour uses the muted token */
    color: var(--app-text-muted);
    text-decoration: none;

    /* Smooth colour transition on active/tap */
    transition: color 0.15s ease;

    /*
     * Reset <button> appearance so the "More" trigger button looks identical
     * to the anchor tabs. We target the element directly so specificity stays
     * low and is easy to override if needed.
     */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;

    /* Suppress the blue flash on tap in mobile WebKit/Blink */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Active tab — colour snaps to the palette primary accent */
.app-bottom-nav-item.active,
.app-bottom-nav-item:active {
    color: var(--hs-primary);
}

/* Hover (pointer devices / iPad with mouse) */
.app-bottom-nav-item:hover {
    color: var(--hs-primary);
}

.app-bottom-nav-icon {
    /*
     * 1.25rem gives a recognisable icon size without crowding the label.
     * Using font-size rather than width/height keeps this compatible with
     * Bootstrap Icons (which are inline SVG or icon-font glyphs).
     */
    font-size: 1.25rem;
    line-height: 1;
}

.app-bottom-nav-label {
    font-size: 0.7rem;
    line-height: 1;
    /* Prevent label from wrapping — one-line only */
    white-space: nowrap;
    /* Inherit current color so active/inactive state is automatic */
    color: inherit;
}

/* ==========================================================================
   "MORE" SHEET (Bootstrap offcanvas-bottom)
   ========================================================================== */

/*
 * Bootstrap's offcanvas handles show/hide and the backdrop. We only need to
 * override its visual appearance to match the app shell design.
 *
 * The element carries d-lg-none (hidden at ≥992px by Bootstrap utility),
 * plus Bootstrap's own offcanvas positioning logic.
 */

.app-more-sheet {
    /*
     * Rounded top corners give the native bottom-sheet feel.
     * Bootstrap's offcanvas-bottom anchors the element at the bottom of the
     * screen; border-radius on top-left/top-right only is correct here.
     */
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;

    /*
     * Cap height at 85vh so the sheet never covers the full screen, leaving
     * the user with a sense of the page behind it.
     */
    max-height: 85vh;

    /* Surface background using the token — adapts to light/dark/palette */
    background-color: var(--app-bg-secondary);
    border: 1px solid var(--app-border);
    border-bottom: none; /* No bottom border — it's flush with the screen edge */

    /*
     * iOS safe-area: push content above the home indicator.
     * The offcanvas body inside also gets -webkit-overflow-scrolling for
     * momentum scrolling on older iOS versions.
     */
    padding-bottom: env(safe-area-inset-bottom);
}

/*
 * The offcanvas header (drag handle / title / close button area).
 * Bootstrap renders this as .offcanvas-header inside .app-more-sheet.
 */
.app-more-sheet .offcanvas-header {
    border-bottom: 1px solid var(--app-border-light);
    color: var(--app-text);
    padding: 1rem 1.25rem 0.75rem;
}

.app-more-sheet .offcanvas-title {
    color: var(--app-text);
    font-weight: 600;
}

/*
 * The scrollable content area of the offcanvas.
 * overflow-y: auto lets the sheet scroll if content exceeds max-height.
 * -webkit-overflow-scrolling: touch enables momentum (inertia) scrolling
 * on iOS — without it, scrolling feels sluggish and non-native.
 */
.app-more-sheet .offcanvas-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1.25rem;
    color: var(--app-text);
}

/* --- Section titles inside the More sheet ---
 *
 * Small, uppercase, letter-spaced labels that group items visually.
 * These mirror the pattern used in the palette dropdown header.
 */
.app-more-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--app-text-muted);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

/* No top margin on the very first section title — avoids double-gap */
.app-more-section-title:first-child {
    margin-top: 0;
}

/* --- List-group rows inside the More sheet ---
 *
 * Bootstrap's .list-group-item already has good defaults; we only need to
 * align the colour tokens and suppress the tap highlight.
 */
.app-more-sheet .list-group-item {
    background-color: var(--app-bg-surface);
    border-color: var(--app-border-light);
    color: var(--app-text);
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    transition: background-color 0.15s ease;
}

.app-more-sheet .list-group-item:hover,
.app-more-sheet .list-group-item:active {
    background-color: var(--app-bg-surface-hover, var(--app-bg-surface));
}

/* --- Palette row inside the More sheet ---
 *
 * Reuse the existing .palette-option chip styles (defined ~line 243).
 * We only need to arrange them in a flex row with wrapping — the chips
 * themselves already have the correct swatch/label layout.
 */
.app-more-palettes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    /* Align chips from the left; they will wrap naturally on very small screens */
    justify-content: flex-start;
}

/*
 * Inside the More sheet the palette chips need slightly larger touch targets
 * than they have in the desktop dropdown. Boost padding a little.
 */
.app-more-palettes .palette-option {
    padding: 0.4rem 0.6rem;
    min-width: 52px; /* Ensure each chip is comfortably tappable */
}

/* Make the swatch circle slightly larger for finger-friendliness */
.app-more-palettes .palette-option-swatch {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   STACKED-CARD TABLES (≤767.98px only)
   Transforms .table-app-stack from a horizontal grid into a vertical
   card-per-row layout that fits any screen width without horizontal scrolling.
   ========================================================================== */

@media (max-width: 767.98px) {

    /*
     * Setting width: 100% on the table element collapses any extra width the
     * table may have claimed, which eliminates the horizontal scrollbar that
     * .table-responsive would otherwise show for display:block content.
     */
    .table-app-stack {
        width: 100%;
    }

    /* Hide the column headers — the data-label attribute on each <td>
     * becomes the inline label, so we don't need the <thead> row. */
    .table-app-stack thead {
        display: none;
    }

    /* --- Each body row becomes a card --- */
    .table-app-stack tbody tr {
        display: block;
        background-color: var(--app-bg-surface);
        border: 1px solid var(--app-border);
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;

        /*
         * Small vertical padding inside the card; horizontal padding is
         * applied at the <td> level so hairline dividers span the full width.
         */
        padding: 0.25rem 0.75rem;

        /* Subtle lift to separate cards visually from the page background */
        box-shadow: 0 2px 8px var(--app-shadow);
    }

    /* --- Each cell becomes a labelled row --- */
    .table-app-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;

        /*
         * Override any .text-end / .text-center utility classes that are fine
         * on desktop but break the label-value layout on mobile.
         * !important is unavoidable here because Bootstrap utility classes
         * themselves use !important on text-align.
         */
        text-align: left !important;

        /* Remove the table's default cell border — we draw our own hairline */
        border: none;

        /* Vertical rhythm inside each card row */
        padding: 0.5rem 0;

        /* Hairline separator between rows, but not after the last one */
        border-bottom: 1px solid var(--app-border-light);
    }

    .table-app-stack tbody td:last-child {
        border-bottom: none;
    }

    /* --- Inline label via CSS attribute selector ---
     *
     * Each <td> carries data-label="Column Name". The ::before pseudo-element
     * renders that string as a bold muted label on the left side.
     * The value (cell content) floats to the right via justify-content: space-between.
     */
    .table-app-stack tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--app-text-muted);
        white-space: nowrap;
        flex-shrink: 0; /* Never let the label get squeezed by long values */
    }

    /*
     * Action cells (edit/delete buttons) carry data-label="" (empty string).
     * Suppress the ::before content entirely so no blank space appears on the
     * left — the buttons simply cluster to the right.
     */
    .table-app-stack tbody td[data-label=""]::before {
        content: none;
    }

    /* --- Action cell layout ---
     *
     * .app-stack-actions replaces the label with a right-aligned flex row of
     * buttons. The min touch target ensures buttons are comfortably tappable.
     */
    .app-stack-actions {
        justify-content: flex-end;
        gap: 0.5rem;
    }

    .app-stack-actions .btn {
        /* Enforce minimum 40px touch target on action buttons */
        min-width: 40px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* --- Footer / totals row ---
     *
     * <tfoot> usually contains a colspan row with a grand total. We render it
     * as a simple bold card so it reads cleanly without the colspan spanning
     * display:block content (colspan has no effect once the table is broken
     * into block layout).
     */
    .table-app-stack tfoot tr {
        display: block;
        background-color: var(--app-bg-surface);
        border: 1px solid var(--app-border);
        border-radius: 0.75rem;
        margin-bottom: 0.75rem;
        padding: 0.25rem 0.75rem;
    }

    /*
     * The tfoot <th> (colspan total cell) becomes a single flex row.
     * Because colspan is meaningless in block layout, it just renders as a
     * full-width cell, which is exactly what we want for a total line.
     */
    .table-app-stack tfoot th {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        font-weight: 700;
        color: var(--app-text);
    }

}

/* ==========================================================================
   END OF MOBILE APP SHELL SECTION
   ========================================================================== */
