/* Insitu Servicios - Brand Styles based on original React project */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
    /* Los Pelambres / Insitu palette */
    --brand-teal: #006E7E;
    --brand-teal-light: #6AC1BA;
    --brand-teal-dark: #005a67;
    --brand-red: #C62533;
    --brand-gold: #E5A52D;
    --brand-gold-dark: #c98e1f;
    --brand-gray: #636463;
    --brand-dark: #0F172A;
    --brand-dark-light: #1e293b;
    --brand-sky: #38BDF8;

    /* Sidebar dark */
    --sidebar-bg: #0F172A;
    --sidebar-text: #94a3b8;
    --sidebar-hover: rgba(106, 193, 186, 0.1);
    --sidebar-active: #006E7E;

    /* Layout */
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --card-radius: 0.75rem;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

/* Typography */
body {
    font-family: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
}

h1, h2, h3, h4, h5, h6, .font-heading {
    font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif;
}

/* Sidebar */
.sidebar-brand {
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-dark) 100%);
}

.sidebar-nav {
    background-color: var(--sidebar-bg);
}

.sidebar-link {
    color: var(--sidebar-text);
    transition: all 0.2s ease;
    border-radius: 0.5rem;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--brand-teal-light);
}

.sidebar-link.active {
    background-color: rgba(0, 110, 126, 0.15);
    color: var(--brand-teal-light);
    border-left: 3px solid var(--brand-teal);
}

/* Cards */
.card-brand {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    border: 1px solid rgba(0, 110, 126, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px -10px rgba(0, 110, 126, 0.15);
}

/* Buttons */
.btn-teal {
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-dark) 100%);
    color: white;
    transition: all 0.2s ease;
}

.btn-teal:hover {
    background: linear-gradient(135deg, var(--brand-teal-dark) 0%, var(--brand-teal) 100%);
    box-shadow: 0 4px 15px rgba(0, 110, 126, 0.3);
}

.btn-gold {
    background: linear-gradient(135deg, var(--brand-gold) 0%, var(--brand-gold-dark) 100%);
    color: white;
    transition: all 0.2s ease;
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--brand-gold-dark) 0%, var(--brand-gold) 100%);
    box-shadow: 0 4px 15px rgba(229, 165, 45, 0.3);
}

/* Badges */
.badge-teal {
    background-color: rgba(0, 110, 126, 0.1);
    color: var(--brand-teal);
}

.badge-gold {
    background-color: rgba(229, 165, 45, 0.1);
    color: var(--brand-gold-dark);
}

.badge-red {
    background-color: rgba(198, 37, 51, 0.1);
    color: var(--brand-red);
}

/* Gradient backgrounds */
.gradient-teal {
    background: linear-gradient(135deg, var(--brand-teal) 0%, var(--brand-teal-dark) 100%);
}

.gradient-hero {
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-teal) 100%);
}

/* Stats */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand-teal), var(--brand-teal-light));
}

/* Mobile bottom nav */
.mobile-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 110, 126, 0.1);
}

/* Form inputs */
.input-brand {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.input-brand:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(0, 110, 126, 0.1);
    outline: none;
}

/* Tables */
.table-brand th {
    background-color: #f1f5f9;
    color: var(--brand-gray);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-brand tr:hover td {
    background-color: rgba(0, 110, 126, 0.02);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Landing specific */
.hero-pattern {
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.1) 1px, transparent 0);
    background-size: 20px 20px;
}

/* ===== DARK MODE OVERRIDES ===== */
.dark body {
    background-color: #0f172a;
    color: #f1f5f9;
}

.dark .card-brand,
.dark .bg-white {
    background-color: #1e293b;
    border-color: rgba(255, 255, 255, 0.06);
}

.dark .bg-slate-50 {
    background-color: #0f172a;
}

.dark .bg-slate-100 {
    background-color: #1e293b;
}

.dark .text-slate-900,
.dark .text-slate-800 {
    color: #f1f5f9;
}

.dark .text-slate-500,
.dark .text-slate-400 {
    color: #94a3b8;
}

.dark .border-slate-200 {
    border-color: #334155;
}

.dark .border-slate-100 {
    border-color: #1e293b;
}

.dark .input-brand {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}

.dark .table-brand th {
    background-color: #1e293b;
    color: #94a3b8;
}

.dark .table-brand tr:hover td {
    background-color: rgba(106, 193, 186, 0.05);
}

.dark .mobile-nav {
    background: rgba(15, 23, 42, 0.95);
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* ===== SIDEBAR MINI TOOLTIP ===== */
.sidebar-tooltip {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: #0f172a;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 50;
}

.sidebar-tooltip::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #0f172a;
}

.group:hover .sidebar-tooltip {
    opacity: 1;
    visibility: visible;
}

.dark .sidebar-tooltip {
    background: #334155;
}
.dark .sidebar-tooltip::before {
    border-right-color: #334155;
}

/* ===== SKELETONS ===== */
.skeleton-pulse {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

@keyframes skeletonPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.dark .skeleton-shimmer {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== STAGGER ANIMATIONS ===== */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

/* ===== PAGE LOADER ===== */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

#page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.dark #page-loader {
    background: rgba(15, 23, 42, 0.85);
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: var(--brand-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.dark .loader-spinner {
    border-color: #334155;
    border-top-color: var(--brand-teal-light);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.animate-slide-up {
    animation: slideUp 0.5s ease forwards;
}

.animate-slide-left {
    animation: slideInLeft 0.5s ease forwards;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease forwards;
}

/* ===== HOVER UTILITIES ===== */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -8px rgba(0, 110, 126, 0.18);
}

.dark .card-hover:hover {
    box-shadow: 0 12px 40px -8px rgba(0, 0, 0, 0.35);
}

/* ===== SIDEBAR FOUC PREVENTION ===== */
html.sidebar-initial-collapsed #app-sidebar {
    width: 72px;
}
html.sidebar-initial-collapsed #app-main {
    margin-left: 72px;
}
html.sidebar-initial-collapsed #app-sidebar .sidebar-brand-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* ===== SCROLLBAR DARK ===== */
.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ===== FORM INPUTS / SELECTS GLOBAL DARK ===== */
.dark select,
.dark input:not([type="checkbox"]):not([type="radio"]),
.dark textarea {
    background-color: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
}
.dark select option {
    background-color: #1e293b;
    color: #f1f5f9;
}
.dark input::placeholder,
.dark textarea::placeholder {
    color: #64748b;
}

/* ===== FULLCALENDAR DARK ===== */
.dark .fc {
    --fc-page-bg-color: transparent;
    --fc-border-color: #334155;
    --fc-button-text-color: #f1f5f9;
    --fc-button-bg-color: #1e293b;
    --fc-button-border-color: #334155;
    --fc-button-hover-bg-color: #334155;
    --fc-button-hover-border-color: #475569;
    --fc-button-active-bg-color: #334155;
    --fc-event-bg-color: #006E7E;
    --fc-neutral-text-color: #f1f5f9;
    --fc-list-event-hover-bg-color: rgba(106, 193, 186, 0.05);
}
.dark .fc .fc-toolbar-title {
    color: #f1f5f9;
}
.dark .fc .fc-col-header-cell-cushion,
.dark .fc .fc-daygrid-day-number,
.dark .fc .fc-list-day-text,
.dark .fc .fc-list-day-side-text {
    color: #f1f5f9;
}
.dark .fc .fc-day-today {
    background-color: rgba(0, 110, 126, 0.15) !important;
}
.dark .fc-theme-standard td,
.dark .fc-theme-standard th {
    border-color: #334155;
}

/* ===== MOBILE-FIRST UTILITIES ===== */

/* Safe area for iPhone notch */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}
.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Remove tap highlight on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent pull-to-refresh and overscroll bounce */
body {
    overscroll-behavior-y: none;
}

/* Minimum touch target 48px (WCAG 2.5.5) */
.touch-48 {
    min-height: 48px;
    min-width: 48px;
}

/* Inputs must be 16px to prevent iOS zoom */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="url"],
textarea,
select {
    font-size: 16px;
}

/* Mobile bottom nav spacer */
.pb-nav {
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

/* Card list for mobile data display */
.data-card {
    background: var(--card-bg);
    border: 1px solid #e2e8f0;
    border-radius: var(--card-radius);
    padding: 1rem;
    transition: all 0.2s ease;
}

.data-card:hover {
    background: #f8fafc;
}

.dark .data-card {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.06);
}

.dark .data-card:hover {
    background: #1e293b;
}

/* Horizontal scroll snap for mobile carousels/grids */
.snap-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.snap-start {
    scroll-snap-align: start;
}

/* Better focus states for mobile */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
}

/* Floating action button for mobile */
.fab-mobile {
    position: fixed;
    bottom: calc(1rem + env(safe-area-inset-bottom) + 64px);
    right: 1rem;
    z-index: 40;
}
@media (min-width: 1024px) {
    .fab-mobile {
        bottom: calc(1rem + env(safe-area-inset-bottom));
    }
}

/* ===============================
   Micro-interacciones y UX
   =============================== */

/* Active states for buttons */
button:active, .btn-teal:active, .btn-gold:active, a.touch-target:active {
    transform: scale(0.97);
    transition: transform 0.1s ease;
}

/* Focus visible for accessibility */
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--brand-teal);
    outline-offset: 2px;
    border-radius: 0.375rem;
}

/* Smooth transitions for all interactive elements */
button, a, input, select, textarea {
    transition: all 0.15s ease;
}

/* Table row hover enhancement */
table tbody tr {
    transition: background-color 0.15s ease;
}

/* Card hover lift */
.card-brand:active {
    transform: translateY(0);
    box-shadow: 0 4px 20px -5px rgba(0, 110, 126, 0.1);
}

/* Input focus animation */
input:focus, select:focus, textarea:focus {
    box-shadow: 0 0 0 3px rgba(0, 110, 126, 0.1);
}

/* Toast entrance animation */
@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading skeleton shimmer */
@keyframes skeletonShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

.dark .skeleton-shimmer {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
}

/* Ripple effect for touch targets */
.touch-target {
    position: relative;
    overflow: hidden;
}

.touch-target::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.touch-target:active::after {
    width: 150%;
    height: 150%;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Disabled state */
button:disabled, .disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Status badges pulse */
@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status-pulse {
    animation: statusPulse 2s ease-in-out infinite;
}

/* ============================================
   VISUAL THEMES: GLASS, MATE, GRADIENT
   ============================================ */

/* --- Common card selectors --- */
.theme-glass [class*="bg-white"][class*="rounded-2xl"],
.theme-glass [class*="bg-white"][class*="rounded-xl"],
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-xl"],
.theme-mate [class*="bg-white"][class*="rounded-2xl"],
.theme-mate [class*="bg-white"][class*="rounded-xl"],
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-xl"],
.theme-gradient [class*="bg-white"][class*="rounded-2xl"],
.theme-gradient [class*="bg-white"][class*="rounded-xl"],
.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    transition: all 0.3s ease;
}

/* --- GLASS --- */
.theme-glass [class*="bg-white"][class*="rounded-2xl"],
.theme-glass [class*="bg-white"][class*="rounded-xl"],
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.40) !important;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    border-radius: 1.25rem;
    transition: all 0.3s ease;
}
.theme-glass [class*="bg-white"][class*="rounded-2xl"]:hover,
.theme-glass [class*="bg-white"][class*="rounded-xl"]:hover,
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.theme-glass [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    background: rgba(255, 255, 255, 0.50);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}
.dark.theme-glass [class*="bg-white"][class*="rounded-2xl"],
.dark.theme-glass [class*="bg-white"][class*="rounded-xl"],
.dark.theme-glass [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.dark.theme-glass [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: rgba(15, 23, 42, 0.50);
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.40), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transition: all 0.3s ease;
}
.dark.theme-glass [class*="bg-white"][class*="rounded-2xl"]:hover,
.dark.theme-glass [class*="bg-white"][class*="rounded-xl"]:hover,
.dark.theme-glass [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.dark.theme-glass [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.50), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.theme-glass #app-sidebar,
.theme-glass header {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: none !important;
}
.dark.theme-glass #app-sidebar,
.dark.theme-glass header {
    background: rgba(15, 23, 42, 0.70);
    border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
}

/* --- MATE --- */
.theme-mate [class*="bg-white"][class*="rounded-2xl"],
.theme-mate [class*="bg-white"][class*="rounded-xl"],
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background-color: #f8fafc !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    border-radius: 1rem;
    transition: all 0.2s ease;
}
.theme-mate [class*="bg-white"][class*="rounded-2xl"]:hover,
.theme-mate [class*="bg-white"][class*="rounded-xl"]:hover,
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.theme-mate [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.dark.theme-mate [class*="bg-white"][class*="rounded-2xl"],
.dark.theme-mate [class*="bg-white"][class*="rounded-xl"],
.dark.theme-mate [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.dark.theme-mate [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background-color: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20) !important;
}
.dark.theme-mate [class*="bg-white"][class*="rounded-2xl"]:hover,
.dark.theme-mate [class*="bg-white"][class*="rounded-xl"]:hover,
.dark.theme-mate [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.dark.theme-mate [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.30) !important;
}

.theme-mate #app-sidebar,
.theme-mate header {
    background: #f1f5f9 !important;
    border-right: 1px solid #e2e8f0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
}
.dark.theme-mate #app-sidebar,
.dark.theme-mate header {
    background: #0f172a !important;
    border-right: 1px solid #1e293b !important;
    border-bottom: 1px solid #1e293b !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

.theme-mate .card-hover:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

/* --- GRADIENT --- */
.theme-gradient [class*="bg-white"][class*="rounded-2xl"],
.theme-gradient [class*="bg-white"][class*="rounded-xl"],
.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: linear-gradient(145deg, #ffffff 0%, #f0f9ff 100%);
    border: 1px solid rgba(0, 110, 126, 0.08) !important;
    box-shadow: 0 4px 20px -4px rgba(0, 110, 126, 0.10) !important;
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}
.theme-gradient [class*="bg-white"][class*="rounded-2xl"]::before,
.theme-gradient [class*="bg-white"][class*="rounded-xl"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}
.dark.theme-gradient [class*="bg-white"][class*="rounded-2xl"],
.dark.theme-gradient [class*="bg-white"][class*="rounded-xl"],
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(0, 110, 126, 0.15) !important;
    box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.30) !important;
    position: relative;
    overflow: hidden;
}
.dark.theme-gradient [class*="bg-white"][class*="rounded-2xl"]::before,
.dark.theme-gradient [class*="bg-white"][class*="rounded-xl"]::before,
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-2xl"]::before,
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-xl"]::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    opacity: 0.5;
}
.theme-gradient [class*="bg-white"][class*="rounded-2xl"]:hover,
.theme-gradient [class*="bg-white"][class*="rounded-xl"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(0, 110, 126, 0.15) !important;
    transition: all 0.3s ease;
}
.dark.theme-gradient [class*="bg-white"][class*="rounded-2xl"]:hover,
.dark.theme-gradient [class*="bg-white"][class*="rounded-xl"]:hover,
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.dark.theme-gradient [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.40) !important;
    transition: all 0.3s ease;
}

.theme-gradient #app-sidebar,
.theme-gradient header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
    border-right: 1px solid rgba(0, 110, 126, 0.10) !important;
    border-bottom: 1px solid rgba(0, 110, 126, 0.10) !important;
    box-shadow: none !important;
}
.dark.theme-gradient #app-sidebar,
.dark.theme-gradient header {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-right: 1px solid rgba(0, 110, 126, 0.12) !important;
    border-bottom: 1px solid rgba(0, 110, 126, 0.12) !important;
    box-shadow: none !important;
}

.theme-gradient body {
    background: linear-gradient(180deg, #f0f9ff 0%, #f0fdf4 50%, #fff1f2 100%) !important;
    background-attachment: fixed;
}
.dark.theme-gradient body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    background-attachment: fixed;
}

/* --- LIQUID --- */
.theme-liquid [class*="bg-white"][class*="rounded-2xl"],
.theme-liquid [class*="bg-white"][class*="rounded-xl"],
.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.7) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
    border-radius: 1rem;
    transition: all 0.3s ease;
}
.theme-liquid [class*="bg-white"][class*="rounded-2xl"]:hover,
.theme-liquid [class*="bg-white"][class*="rounded-xl"]:hover,
.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}
.dark.theme-liquid [class*="bg-white"][class*="rounded-2xl"],
.dark.theme-liquid [class*="bg-white"][class*="rounded-xl"],
.dark.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-2xl"],
.dark.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-xl"] {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.7) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s ease;
}
.dark.theme-liquid [class*="bg-white"][class*="rounded-2xl"]:hover,
.dark.theme-liquid [class*="bg-white"][class*="rounded-xl"]:hover,
.dark.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-2xl"]:hover,
.dark.theme-liquid [class*="dark:bg-slate-800"][class*="rounded-xl"]:hover {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 41, 59, 0.8) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.theme-liquid #app-sidebar,
.theme-liquid header {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.5) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}
.dark.theme-liquid #app-sidebar,
.dark.theme-liquid header {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 41, 59, 0.6) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

.theme-liquid body {
    background: linear-gradient(180deg, #f0f9ff 0%, #f0fdf4 50%, #fff1f2 100%) !important;
    background-attachment: fixed;
}
.dark.theme-liquid body {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%) !important;
    background-attachment: fixed;
}

/* ===== ACCESSIBILITY UTILITIES ===== */

/* High contrast */
html.a11y-high-contrast body {
    color: #000 !important;
    background-color: #fff !important;
}
html.a11y-high-contrast.dark body {
    color: #fff !important;
    background-color: #000 !important;
}
html.a11y-high-contrast * {
    border-color: #000 !important;
}
html.a11y-high-contrast.dark * {
    border-color: #fff !important;
}
html.a11y-high-contrast .bg-brand-500,
html.a11y-high-contrast .bg-brand-600,
html.a11y-high-contrast .btn-teal,
html.a11y-high-contrast .sidebar-link.active {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
}
html.a11y-high-contrast.dark .bg-brand-500,
html.a11y-high-contrast.dark .bg-brand-600,
html.a11y-high-contrast.dark .btn-teal,
html.a11y-high-contrast.dark .sidebar-link.active {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}
html.a11y-high-contrast .text-slate-500,
html.a11y-high-contrast .text-slate-400,
html.a11y-high-contrast .text-muted-foreground {
    color: #333 !important;
}
html.a11y-high-contrast.dark .text-slate-500,
html.a11y-high-contrast.dark .text-slate-400,
html.a11y-high-contrast.dark .text-muted-foreground {
    color: #ccc !important;
}

/* Reduce motion */
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}
html.a11y-reduce-motion .animate-fade-in,
html.a11y-reduce-motion .animate-slide-up,
html.a11y-reduce-motion .animate-slide-left,
html.a11y-reduce-motion .animate-scale-in,
html.a11y-reduce-motion .skeleton-shimmer,
html.a11y-reduce-motion .status-pulse,
html.a11y-reduce-motion .loader-spinner {
    animation: none !important;
}

/* Focus visible enhancement */
html.a11y-focus-visible button:focus-visible,
html.a11y-focus-visible a:focus-visible,
html.a11y-focus-visible input:focus-visible,
html.a11y-focus-visible select:focus-visible,
html.a11y-focus-visible textarea:focus-visible {
    outline: 4px solid #000 !important;
    outline-offset: 4px !important;
    border-radius: 0.25rem !important;
}
html.a11y-focus-visible.dark button:focus-visible,
html.a11y-focus-visible.dark a:focus-visible,
html.a11y-focus-visible.dark input:focus-visible,
html.a11y-focus-visible.dark select:focus-visible,
html.a11y-focus-visible.dark textarea:focus-visible {
    outline: 4px solid #fff !important;
}

/* Loose spacing */
html.a11y-loose-spacing body {
    line-height: 1.7 !important;
}
html.a11y-loose-spacing .p-4,
html.a11y-loose-spacing .p-6 {
    padding: 1.5rem !important;
}
html.a11y-loose-spacing .space-y-3 > * + * {
    margin-top: 1rem !important;
}
html.a11y-loose-spacing .space-y-4 > * + * {
    margin-top: 1.25rem !important;
}
html.a11y-loose-spacing .space-y-6 > * + * {
    margin-top: 2rem !important;
}
html.a11y-loose-spacing .gap-3 {
    gap: 1rem !important;
}
html.a11y-loose-spacing .gap-4 {
    gap: 1.25rem !important;
}
html.a11y-loose-spacing input,
html.a11y-loose-spacing select,
html.a11y-loose-spacing textarea {
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
}
html.a11y-loose-spacing button {
    min-height: 44px !important;
}
