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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    padding-top: calc(var(--navbar-height) + var(--space-2xl));
}

/* macOS Sequoia Background Layers */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 78%, rgba(79, 70, 229, 0.05) 0%, transparent 42%),
        radial-gradient(circle at 78% 22%, rgba(124, 58, 237, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 52% 48%, rgba(20, 184, 166, 0.03) 0%, transparent 38%),
        var(--bg-primary);
    pointer-events: none;
    z-index: -1;
}

/* Sequoia overlay for subtle depth */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(79, 70, 229, 0.02) 0%,
            rgba(124, 58, 237, 0.01) 50%,
            rgba(20, 184, 166, 0.015) 100%);
    pointer-events: none;
    z-index: -1;
}


h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Semantic palette utilities */
.tfd-text-title { color: var(--text-title) !important; }
.tfd-text-body { color: var(--text-body) !important; }
.tfd-text-muted { color: var(--text-muted) !important; }
.tfd-text-soft { color: var(--text-soft) !important; }
.tfd-text-primary { color: var(--primary) !important; }
.tfd-text-secondary { color: var(--secondary) !important; }
.tfd-text-success { color: var(--teal) !important; }
.tfd-text-warning { color: var(--warning) !important; }
.tfd-text-danger { color: var(--error) !important; }
.tfd-text-info { color: var(--accent-secondary) !important; }

.tfd-bg-canvas { background-color: var(--bg-canvas) !important; }
.tfd-bg-surface { background-color: var(--bg-surface) !important; }
.tfd-bg-surface-muted { background-color: var(--bg-surface-muted) !important; }
.tfd-bg-surface-subtle { background-color: var(--bg-surface-subtle) !important; }

.tfd-icon-primary { color: var(--icon-primary) !important; }
.tfd-icon-secondary { color: var(--icon-secondary) !important; }
.tfd-icon-success { color: var(--icon-success) !important; }
.tfd-icon-info { color: var(--accent-secondary) !important; }
.tfd-icon-warning { color: var(--icon-warning) !important; }
.tfd-icon-danger { color: var(--icon-danger) !important; }
.tfd-icon-muted { color: var(--icon-muted) !important; }

.tfd-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(79, 70, 229, 0.08);
    color: var(--icon-primary);
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.tfd-icon-badge.is-success {
    background: rgba(20, 184, 166, 0.10);
    color: var(--icon-success);
    border-color: rgba(20, 184, 166, 0.18);
}

.tfd-icon-badge.is-primary {
    background: rgba(79, 70, 229, 0.10);
    color: var(--icon-primary);
    border-color: rgba(79, 70, 229, 0.18);
}

.tfd-icon-badge.is-info {
    background: rgba(99, 102, 241, 0.10);
    color: var(--accent-secondary);
    border-color: rgba(99, 102, 241, 0.18);
}

.tfd-icon-badge.is-warning {
    background: rgba(245, 158, 11, 0.10);
    color: var(--icon-warning);
    border-color: rgba(245, 158, 11, 0.18);
}

.tfd-icon-badge.is-danger {
    background: rgba(239, 68, 68, 0.10);
    color: var(--icon-danger);
    border-color: rgba(239, 68, 68, 0.18);
}

.tfd-icon-badge.is-secondary {
    background: rgba(124, 58, 237, 0.10);
    color: var(--icon-secondary);
    border-color: rgba(124, 58, 237, 0.18);
}

.tfd-icon-badge.is-neutral {
    background: rgba(15, 23, 42, 0.04);
    color: var(--icon-muted);
    border-color: rgba(148, 163, 184, 0.20);
}

.tfd-icon-badge--sm {
    width: 40px;
    height: 40px;
    border-radius: 14px;
}

.tfd-icon-badge--lg {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 1.15rem;
}

.tfd-heading {
    color: var(--text-title) !important;
    letter-spacing: -0.03em;
}

.tfd-subheading {
    color: var(--text-body) !important;
}

.tfd-kicker {
    color: var(--text-muted) !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    font-size: 0.75rem;
}

.tfd-section-card {
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: var(--bg-surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.tfd-section-card .card-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
    border-bottom: 1px solid var(--border-soft);
}

.tfd-section-card .card-body {
    color: var(--text-body);
}

.tfd-inline-action-btn {
    min-width: 180px;
    min-height: var(--button-height);
    border-radius: 14px;
    padding-inline: 1rem;
    font-weight: 600;
}

.tfd-inline-action-btn.btn-sm {
    min-width: 0;
    min-height: var(--button-height-sm);
}

/* Navbar - macOS Sequoia Glass Effect */
.navbar {
    background: var(--glass-bg-primary);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border-bottom: 1px solid var(--border-secondary);
    padding: 0 var(--space-3xl);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--navbar-height);
    box-shadow:
        0 1px 0 0 var(--border-tertiary),
        0 2px 8px 0 rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all var(--animation-duration-normal) var(--animation-easing);
    display: flex;
    align-items: center;
}

@media (max-width: 1024px) {
    .navbar {
        padding: 0 var(--space-lg);
    }
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(10, 132, 255, 0.04) 0%,
            rgba(255, 159, 10, 0.02) 25%,
            rgba(191, 90, 242, 0.03) 50%,
            rgba(48, 209, 88, 0.04) 75%,
            rgba(10, 132, 255, 0.02) 100%);
    pointer-events: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.navbar-brand {
    font-weight: 600;
    color: var(--text-primary) !important;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60px;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    transition: all var(--animation-duration-fast) var(--animation-easing);
}

.navbar-brand:hover {
    background: var(--primary-glass);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    color: var(--primary) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px 0 rgba(0, 122, 255, 0.15);
}

.navbar-brand img {
    height: clamp(32px, 8vw, 48px);
    width: auto;
    max-width: 100%;
    border-radius: var(--radius);
    object-fit: contain;
    transition: all 0.3s ease;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.navbar-brand:hover img {
    transform: scale(1.08);
    filter: drop-shadow(0 4px 12px rgba(10, 132, 255, 0.4));
}

/* App Navbar */
.app-navbar__inner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    height: 100%;
    min-width: 0;
    flex-wrap: nowrap;
}

.app-navbar__brand {
    display: flex;
    align-items: center;
    height: 100%;
    flex: 0 0 auto;
}

.app-navbar__brand .navbar-brand {
    height: 100%;
    min-height: auto;
    padding: 0 var(--space-sm);
}

.app-navbar__brand .navbar-brand img {
    height: 38px;
}

.app-navbar__menu {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0 var(--space-sm);
    height: 100%;
    max-width: 100%;
}

.app-navbar__menu::-webkit-scrollbar {
    display: none;
}

.app-navbar__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 auto;
    padding: 0;
    flex-wrap: nowrap;
    height: 100%;
    min-width: max-content;
}

.app-navbar__item {
    display: flex;
    align-items: center;
}

.app-navbar__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--animation-duration-fast) var(--animation-easing),
        color var(--animation-duration-fast) var(--animation-easing),
        transform var(--animation-duration-fast) var(--animation-easing);
    white-space: nowrap;
    height: 100%;
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.app-navbar__link i {
    font-size: var(--font-size-lg);
}

.app-navbar__link span {
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.2;
}

.app-navbar__link:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-1px);
}

.app-navbar__link.is-active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.app-navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
    flex: 0 0 auto;
    height: 100%;
}

.app-navbar--collapsed .app-navbar__menu {
    display: none;
}

.app-navbar--collapsed .app-navbar__toggle {
    display: inline-flex;
}

.app-navbar--collapsed .app-navbar__welcome {
    display: none;
}

.app-navbar__welcome {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
}

.app-navbar__welcome strong {
    color: var(--text-primary);
    font-weight: 600;
}

.app-navbar__actions .nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    border-radius: var(--radius);
    padding: var(--space-xs) var(--space-sm);
    transition: background var(--animation-duration-fast) var(--animation-easing),
        color var(--animation-duration-fast) var(--animation-easing);
    height: 100%;
}

.app-navbar__actions .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
    text-decoration: none;
}

.app-navbar__toggle {
    border: 1px solid var(--border-secondary);
    background: var(--surface-primary);
    width: 44px;
    height: 40px;
    border-radius: var(--radius);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    transition: background var(--animation-duration-fast) var(--animation-easing),
        box-shadow var(--animation-duration-fast) var(--animation-easing);
}

.app-navbar__toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.app-navbar__toggle:hover {
    background: var(--primary-light);
}

.app-navbar__toggle-line {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 999px;
    transition: transform var(--animation-duration-fast) var(--animation-easing),
        opacity var(--animation-duration-fast) var(--animation-easing);
}

.app-navbar__toggle.is-open .app-navbar__toggle-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.app-navbar__toggle.is-open .app-navbar__toggle-line:nth-child(2) {
    opacity: 0;
}

.app-navbar__toggle.is-open .app-navbar__toggle-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.app-sidebar__backdrop {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--animation-duration-fast) var(--animation-easing);
    z-index: 1020;
}

.app-sidebar__backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.app-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    bottom: 0;
    width: var(--app-sidebar-collapsed);
    background: var(--surface-primary);
    border-right: 1px solid var(--border-secondary);
    box-shadow: 2px 0 12px rgba(15, 23, 42, 0.08);
    padding: var(--space-md) var(--space-xs);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    z-index: 1025;
    overflow: hidden;
    transition: width var(--animation-duration-fast) var(--animation-easing),
        box-shadow var(--animation-duration-fast) var(--animation-easing);
}

body.app-sidebar--visible .app-sidebar {
    display: flex;
}

.app-sidebar.is-expanded {
    width: var(--app-sidebar-expanded);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
}

@media (hover: hover) {
    .app-sidebar:not(.is-expanded):hover {
        width: var(--app-sidebar-expanded);
        box-shadow: 8px 0 24px rgba(15, 23, 42, 0.12);
    }
}

.app-sidebar__nav {
    flex: 1;
    overflow-y: auto;
}

.app-sidebar__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin: 0;
    padding: 0;
}

.app-sidebar__item {
    width: 100%;
}

.app-sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--animation-duration-fast) var(--animation-easing),
        color var(--animation-duration-fast) var(--animation-easing);
}

.app-sidebar:not(.is-expanded) .app-sidebar__link {
    justify-content: center;
    gap: 0;
}

.app-sidebar__link i {
    font-size: var(--font-size-lg);
    width: 22px;
    text-align: center;
}

.app-sidebar__label {
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity var(--animation-duration-fast) var(--animation-easing),
        transform var(--animation-duration-fast) var(--animation-easing);
    white-space: nowrap;
    max-width: 0;
    overflow: hidden;
}

.app-sidebar__link.is-active,
.app-sidebar__link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.app-sidebar.is-expanded .app-sidebar__label {
    opacity: 1;
    transform: translateX(0);
    max-width: 200px;
}

.app-sidebar.is-expanded .app-sidebar__link {
    justify-content: flex-start;
}

@media (hover: hover) {
    .app-sidebar:not(.is-expanded):hover .app-sidebar__label {
        opacity: 1;
        transform: translateX(0);
        max-width: 200px;
    }

    .app-sidebar:not(.is-expanded):hover .app-sidebar__link {
        justify-content: flex-start;
    }
}

body.app-sidebar--expanded {
    overflow: hidden;
}

@media (min-width: 1201px) {
    body.app-sidebar--expanded {
        overflow: auto;
    }
}

body.app-sidebar--visible .main-content {
    padding-left: calc(var(--space-3xl) + var(--app-sidebar-collapsed));
}

@media (max-width: 768px) {
    body.app-sidebar--visible .main-content {
        padding-left: calc(var(--space-lg) + var(--app-sidebar-collapsed));
    }
}

@media (max-width: 1200px) {
    .navbar {
        padding: 0 var(--space-lg);
    }

    .app-navbar__menu {
        display: none;
    }

    .app-navbar__toggle {
        display: inline-flex;
    }

    .app-navbar__welcome {
        display: none;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        padding: var(--space-sm);
        min-height: auto;
    }

    .app-sidebar {
        padding: var(--space-sm);
    }
}

@media (min-width: 1201px) {
    .app-sidebar__backdrop {
        display: none;
    }
}

.sidebar .nav-link {
    color: var(--text-secondary);
    padding: var(--space-md) var(--space-lg);
    margin: var(--space-xs) var(--space-md);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    font-size: var(--font-size-sm);
}

.sidebar .nav-link:hover {
    color: var(--primary);
    background: var(--primary-lighter);
    transform: translateX(2px);
}

.sidebar .nav-link.active {
    color: var(--primary);
    background: var(--primary-lighter);
    font-weight: 600;
    border-right: 3px solid var(--primary);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: var(--font-size-lg);
    opacity: 0.8;
}

.sidebar .nav-link.active i {
    opacity: 1;
}

/* Main Content - Full Width for macOS Style */
.main-content {
    min-height: 100vh;
    padding: 0 var(--space-3xl) var(--space-3xl) var(--space-3xl);
    /* Removed top padding as it's handled by body padding-top */
    background: transparent;
}

/* Cards - macOS Sequoia Style */
.card {
    border: 1px solid var(--border-secondary);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    background: var(--surface-primary);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 0, 0, 0.06),
            transparent);
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(10, 132, 255, 0.01) 0%,
            rgba(255, 159, 10, 0.005) 50%,
            rgba(48, 209, 88, 0.01) 100%);
    pointer-events: none;
    border-radius: 18px;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--border-primary);
}

.card-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid var(--border-tertiary);
    padding: 20px;
    border-radius: 18px 18px 0 0 !important;
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    position: relative;
    backdrop-filter: blur(10px);
}

.card-body {
    padding: 20px;
    color: var(--text-secondary);
    position: relative;
}

/* Buttons - macOS Light Mode */
.btn {
    border-radius: var(--radius);
    font-weight: 500;
    padding: var(--space-md) var(--space-xl);
    transition: all var(--animation-duration-normal) var(--animation-easing);
    border: var(--border-width) solid var(--border-secondary);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-sm);
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    color: var(--text-primary);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    transition: left var(--animation-duration-slow) var(--animation-easing);
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    border-color: var(--border-primary);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 132, 255, 0.4);
}

.btn-secondary {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(48, 209, 88, 0.3);
}

.btn-secondary:hover {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(48, 209, 88, 0.4);
}

.btn-success {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(48, 209, 88, 0.3);
}

.btn-success:hover {
    background: var(--secondary-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(48, 209, 88, 0.4);
}

.btn-info {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(191, 90, 242, 0.3);
}

.btn-info:hover {
    background: var(--accent-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(191, 90, 242, 0.4);
}

.btn-warning {
    background: var(--warning-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 159, 10, 0.3);
}

.btn-warning:hover {
    background: var(--warning-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 159, 10, 0.4);
}

.btn-danger {
    background: var(--error-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(255, 55, 95, 0.3);
}

.btn-danger:hover {
    background: var(--error-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 55, 95, 0.4);
}

/* Additional Sequoia buttons */
.btn-teal {
    background: var(--teal-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(102, 212, 207, 0.3);
}

.btn-teal:hover {
    background: var(--teal-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 212, 207, 0.4);
}

.btn-purple {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(191, 90, 242, 0.3);
}

.btn-purple:hover {
    background: var(--accent-gradient);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(191, 90, 242, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn-gradient {
    background: linear-gradient(90deg, #4F46E5, #7C3AED, #6366F1, #14B8A6, #0F766E);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.btn-gradient:hover {
    background: linear-gradient(90deg, #4F46E5, #7C3AED, #6366F1, #14B8A6, #0F766E);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.28);
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--bg-primary);
}

/* Corporate Trust global polish */
body {
    background:
        radial-gradient(circle at 15% 15%, rgba(79, 70, 229, 0.06) 0%, transparent 28%),
        radial-gradient(circle at 85% 10%, rgba(124, 58, 237, 0.05) 0%, transparent 26%),
        radial-gradient(circle at 50% 90%, rgba(20, 184, 166, 0.04) 0%, transparent 30%),
        var(--bg-primary);
}

body::before,
body::after {
    opacity: 1;
}

.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.table-responsive,
.nav-tabs .nav-link,
.pagination .page-link,
.alert,
.form-control,
.form-select,
.btn {
    border-color: var(--border-secondary);
}

.card,
.modal-content,
.dropdown-menu,
.list-group-item,
.table-responsive {
    background: var(--surface-primary);
    box-shadow: var(--shadow-md);
}

.card,
.modal-content {
    border-radius: var(--radius-xl);
}

.card-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(255, 255, 255, 1));
}

.btn,
.form-control,
.form-select,
.nav-tabs .nav-link,
.pagination .page-link {
    border-radius: var(--radius-md);
}

.btn {
    transition: transform var(--animation-duration-fast) var(--animation-easing), box-shadow var(--animation-duration-fast) var(--animation-easing), background-color var(--animation-duration-fast) var(--animation-easing), border-color var(--animation-duration-fast) var(--animation-easing);
}

.btn:hover {
    transform: translateY(-1px);
}

.form-control:focus,
.form-select:focus,
.btn:focus,
.nav-link:focus,
.page-link:focus {
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.16);
}

.navbar,
.app-navbar {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: var(--glass-backdrop);
}

.app-navbar__link.is-active,
.app-navbar__link:hover,
.app-sidebar__link.is-active,
.app-sidebar__link:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}

.app-sidebar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: var(--glass-backdrop);
    border-right: 1px solid var(--border-secondary);
}

@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;
    }
}

/* Form Controls */
.form-control,
.form-select {
    border: var(--border-width) solid var(--border-secondary);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    transition: all 0.2s ease;
    background: var(--surface-primary);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-lighter);
    outline: none;
}

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

/* Tables - macOS Light Mode */
.table {
    margin-bottom: 0;
    border-radius: var(--window-border-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
    background: var(--surface-primary);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: var(--border-width) solid var(--border-secondary);
}

.table th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: var(--border-width) solid var(--border-tertiary);
    font-weight: 600;
    padding: var(--space-xl) var(--space-lg);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
}

.table td {
    padding: var(--space-lg);
    border-bottom: var(--border-width) solid var(--border-tertiary);
    vertical-align: middle;
    background: transparent;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: background-color var(--animation-duration-fast) var(--animation-easing);
}

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table-responsive {
    border-radius: var(--window-border-radius);
    box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.3);
}

/* Alerts */
.alert {
    border: var(--border-width) solid transparent;
    border-radius: var(--radius);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    font-size: var(--font-size-sm);
}

/* ===========================
   Minimalist Modern Overrides
   =========================== */
body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body::before,
body::after {
    opacity: 1;
    background:
        radial-gradient(circle at 15% 85%, rgba(0, 82, 255, 0.05) 0%, transparent 42%),
        radial-gradient(circle at 85% 15%, rgba(77, 124, 255, 0.05) 0%, transparent 42%),
        var(--bg-primary);
}

h1,
h2 {
    font-family: var(--font-family-display);
    letter-spacing: -0.03em;
    color: var(--title-color) !important;
}

h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6,
.card-header h6,
.card-header h5,
.card-header h4 {
    font-family: var(--font-family);
    letter-spacing: -0.01em;
    color: var(--title-color) !important;
}

h1,
.h1 {
    font-size: var(--font-size-display);
    line-height: 1.08;
    font-weight: 600;
}

h2,
.h2 {
    font-size: var(--font-size-page-title);
    line-height: 1.15;
    font-weight: 600;
}

h3,
.h3 {
    font-size: var(--font-size-section-title);
    line-height: 1.2;
    font-weight: 600;
}

h4,
.h4 {
    font-size: 1.125rem;
    line-height: 1.25;
    font-weight: 600;
}

h5,
.h5 {
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

h6,
.h6 {
    font-size: 0.9rem;
    line-height: 1.35;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

p,
label,
input,
select,
textarea,
button,
.form-control,
.form-select,
.table td,
.table th {
    font-family: var(--font-family);
}

body,
p,
li,
.form-label,
.form-text,
.table td {
    font-size: var(--font-size-body);
}

p,
li {
    line-height: 1.6;
}

small,
.small,
.text-muted,
.form-text {
    font-size: var(--font-size-caption) !important;
    color: var(--subtitle-color) !important;
}

.card-header h5,
.card-header h6 {
    color: var(--title-color) !important;
    font-weight: 700;
}

.text-muted,
.form-text {
    color: var(--text-tertiary) !important;
}

.navbar {
    background: rgba(255, 255, 255, 0.86);
    border-bottom: 1px solid var(--border-secondary);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.navbar::before {
    background: linear-gradient(90deg, rgba(0, 82, 255, 0.06), rgba(77, 124, 255, 0.02));
}

.app-navbar__link.is-active,
.app-navbar__link:hover,
.app-sidebar__link.is-active,
.app-sidebar__link:hover {
    background: rgba(0, 82, 255, 0.08);
    color: var(--primary);
}

.main-content {
    padding-top: 0;
}

.card {
    border: 1px solid var(--border-secondary);
    background: var(--surface-primary);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    border-radius: 16px;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

.card-header {
    background: linear-gradient(90deg, #f8fafc, #eef2ff);
    border-bottom: 1px solid var(--border-secondary);
    border-radius: 16px 16px 0 0 !important;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid var(--border-secondary);
}

.btn-primary,
.btn-success,
.btn-info {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.24);
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover {
    filter: brightness(1.06);
    box-shadow: 0 12px 24px rgba(79, 70, 229, 0.3);
}

.btn-outline-primary {
    border-color: rgba(79, 70, 229, 0.24);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
}

.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--border-secondary);
    background: #fff;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.table {
    border-radius: 14px;
    border: 1px solid var(--border-secondary);
    box-shadow: none;
}

.table th {
    background: #f8fafc;
    color: #0f172a;
    border-bottom: 2px solid #0f172a;
    letter-spacing: 0.06em;
}

.table td {
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

.table tbody tr:hover {
    background: #f8fbff;
}

.badge {
    border-radius: 999px;
    font-weight: 600;
}

.bg-primary,
.badge.bg-primary {
    background: var(--primary-gradient) !important;
}

/* Contrast safeguards for colored surfaces */
.bg-primary,
.bg-primary *,
.btn-primary,
.btn-primary *,
.btn-success,
.btn-success *,
.btn-info,
.btn-info *,
.badge.bg-primary,
.badge.bg-primary * {
    color: var(--on-primary) !important;
}

.bg-success,
.bg-success *,
.badge.bg-success,
.badge.bg-success * {
    color: var(--on-secondary) !important;
}

.bg-warning,
.bg-warning *,
.badge.bg-warning,
.badge.bg-warning * {
    color: var(--on-warning) !important;
}

.bg-danger,
.bg-danger *,
.badge.bg-danger,
.badge.bg-danger * {
    color: var(--on-error) !important;
}

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

.text-secondary {
    color: #475569 !important;
}

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

.badge {
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.badge.bg-light,
.badge.text-dark,
.bg-light,
.bg-light * {
    color: var(--on-muted) !important;
}

.alert {
    border-radius: 14px;
    border-color: var(--border-secondary);
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Badges */
.badge {
    font-weight: 500;
    border-radius: var(--radius-xl);
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out;
}

/* ===========================
   Cross-page UI normalization
   =========================== */
.breadcrumb {
    background: transparent !important;
    margin-bottom: 0.5rem !important;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--subtitle-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.breadcrumb-item.active {
    color: var(--title-color) !important;
    font-weight: 600;
}

.main-content .row.mb-4:first-child h1.h4,
.main-content .row.mb-3:first-child h1.h4 {
    font-size: var(--font-size-page-title) !important;
    margin-bottom: 0.2rem;
}

.main-content .row.mb-4:first-child p.small,
.main-content .row.mb-3:first-child p.small {
    color: var(--subtitle-color) !important;
    font-size: var(--font-size-caption) !important;
}

/* Unify colorful card headers used in show/edit/create pages */
.card-header.bg-primary,
.card-header.bg-success,
.card-header.bg-info,
.card-header.bg-warning,
.card-header.bg-danger,
.card-header.bg-secondary,
.card-header.bg-light,
.card-header.bg-white {
    background: linear-gradient(90deg, #f8fafc, #eef2ff) !important;
    color: var(--title-color) !important;
    border-bottom: 1px solid var(--border-secondary) !important;
}

.card-header.bg-primary *,
.card-header.bg-success *,
.card-header.bg-info *,
.card-header.bg-warning *,
.card-header.bg-danger *,
.card-header.bg-secondary *,
.card-header.bg-light *,
.card-header.bg-white * {
    color: var(--title-color) !important;
}

.card-header .text-white,
.card-header .text-dark {
    color: var(--title-color) !important;
}

.table-responsive {
    border-radius: 14px;
    border: 1px solid var(--border-secondary);
    background: #fff;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}

.table thead th {
    font-weight: 700;
}

.form-label {
    color: var(--title-color) !important;
    font-weight: 600 !important;
}

.form-control::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.btn-sm {
    border-radius: 10px;
    font-size: 0.82rem;
    padding: 0.42rem 0.72rem;
    font-weight: 600;
}

.btn-group .btn {
    min-width: 38px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rounded-circle.bg-primary.bg-opacity-10,
.rounded-circle.bg-success.bg-opacity-10,
.rounded-circle.bg-info.bg-opacity-10,
.rounded-circle.bg-warning.bg-opacity-10,
.rounded-circle.bg-danger.bg-opacity-10 {
    border: 1px solid rgba(79, 70, 229, 0.14);
}

/* Normalize section spacing in listing/edit/create/show pages */
.main-content .card + .card {
    margin-top: 1rem;
}

/* Preserve semantic action colors while keeping readability */
.btn-success:not(.btn-outline-success) {
    background: var(--secondary-gradient);
    box-shadow: 0 8px 18px rgba(20, 184, 166, 0.24);
}

.btn-info:not(.btn-outline-info) {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

.btn-warning:not(.btn-outline-warning) {
    background: var(--warning-gradient);
    color: #1f2937;
    box-shadow: 0 8px 18px rgba(245, 158, 11, 0.2);
}

.btn-danger:not(.btn-outline-danger) {
    background: var(--error-gradient);
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
}
