/* =============================================================
   ERP System — Professional Enterprise Theme
   This stylesheet layers on top of Tailwind CDN.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;450;500;600;700&family=Pacifico&display=swap');

/* ---------- Design Tokens (Light) ---------- */
:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --primary-bg: #eef2ff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #4f46e5;
    --sidebar-active-glass: rgba(79, 70, 229, 0.22);
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #f8fafc;
    --body-bg: #f1f5f9;
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --navbar-bg: rgba(255,255,255,0.95);
    --navbar-border: transparent;
    --success: #059669;
    --success-bg: #d1fae5;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --info: #0284c7;
    --info-bg: #e0f2fe;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
}

/* ---------- Design Tokens (Dark) ---------- */
[data-theme="dark"] {
    --body-bg: #0b1121;
    --card-bg: #1a2332;
    --card-border: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --primary-bg: #1e1b4b;
    --sidebar-bg: #020617;
    --navbar-bg: rgba(11,17,33,0.95);
    --navbar-border: #1e293b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.3), 0 4px 6px -4px rgba(0,0,0,0.2);
}

/* ---------- Base ---------- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--body-bg);
    color: var(--text-primary);
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =============================================================
   PAGE LAYOUT
   ============================================================= */

.erp-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4rem;
    background: var(--navbar-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--navbar-border);
    z-index: 50;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.erp-layout {
    display: flex;
    min-height: 100vh;
    padding-top: 4rem;
}

/* --- Sidebar --- */
#sidebar {
    width: 16rem;
    min-width: 16rem;
    background-color: var(--sidebar-bg) !important;
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, min-width 0.25s ease;
    position: fixed;
    top: 4rem;
    left: 0;
    height: calc(100vh - 4rem);
    z-index: 30;
}

/* --- Toggle button --- */
.navbar-toggle-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1rem;
    flex-shrink: 0;
}
.navbar-toggle-btn:hover {
    background: #eef2ff;
    color: #4f46e5;
}

/* --- Sidebar content --- */
.sidebar-content {
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1;
    min-width: 0;
}
.sidebar-content::-webkit-scrollbar {
    width: 3px;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 999px;
}

/* --- Main content --- */
.erp-main {
    flex: 1;
    min-width: 0;
    padding: 1.5rem;
    background-color: var(--body-bg);
    min-height: calc(100vh - 4rem);
    margin-left: 16rem;
    transition: background-color 0.2s ease, margin-left 0.25s ease;
}

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

/* --- Base sidebar link --- */
#sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 450;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-left: 2px solid transparent;
    border-radius: 0 12px 12px 0;
    margin-right: 0.5rem;
    position: relative;
    z-index: 1;
}
#sidebar a:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.12) 0%, rgba(99,102,241,0.03) 100%);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-active);
}
#sidebar a.active {
    background: linear-gradient(90deg, var(--sidebar-active-glass) 0%, rgba(99,102,241,0.07) 60%, transparent 100%);
    color: #ffffff;
    border-left-color: var(--sidebar-active);
    border-left-width: 3px;
    box-shadow: 0 4px 16px rgba(99,102,241,0.18), inset 0 1px 0 rgba(255,255,255,0.06);
}
#sidebar a i:first-child {
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
#sidebar a.active i:first-child {
    color: var(--sidebar-active);
}

/* --- Section group wrappers --- */
#sidebar .group {
    position: relative;
}

/* --- Section headers (HRMS, CRM, Finance ...) --- */
#sidebar .section-title {
    padding: 0.75rem 1.5rem 0.5rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color 0.15s ease;
}
#sidebar .section-title:hover {
    color: var(--sidebar-text);
}
#sidebar .section-title.has-active {
    color: var(--sidebar-text-active);
}
#sidebar .section-title.has-active i {
    opacity: 1;
    color: var(--sidebar-active);
}
#sidebar .section-title i {
    font-size: 0.65rem;
    opacity: 0.6;
    transition: transform 0.25s ease, opacity 0.2s ease;
}
#sidebar .section-title.open i {
    transform: rotate(180deg);
}

/* --- Dropdown items (hidden by default, animated on open) --- */
#sidebar .dropdown-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin 0.25s ease;
    opacity: 0;
    display: block;
}
#sidebar .group.open .dropdown-items {
    max-height: 600px;
    opacity: 1;
}
#sidebar .dropdown-items a {
    padding-left: 2.75rem;
    font-size: 0.8125rem;
    border-left: 2px solid transparent;
    position: relative;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
    border-radius: 0 10px 10px 0;
    margin-right: 0.25rem;
}
#sidebar .group.open .dropdown-items a {
    opacity: 1;
    transform: translateY(0);
}
#sidebar .group.open .dropdown-items a:nth-child(1) { transition-delay: 0.02s; }
#sidebar .group.open .dropdown-items a:nth-child(2) { transition-delay: 0.04s; }
#sidebar .group.open .dropdown-items a:nth-child(3) { transition-delay: 0.06s; }
#sidebar .group.open .dropdown-items a:nth-child(4) { transition-delay: 0.08s; }
#sidebar .group.open .dropdown-items a:nth-child(5) { transition-delay: 0.10s; }
#sidebar .group.open .dropdown-items a:nth-child(6) { transition-delay: 0.12s; }
#sidebar .group.open .dropdown-items a:nth-child(7) { transition-delay: 0.14s; }
#sidebar .group.open .dropdown-items a:nth-child(8) { transition-delay: 0.16s; }
#sidebar .group.open .dropdown-items a:nth-child(9) { transition-delay: 0.18s; }
#sidebar .group.open .dropdown-items a:nth-child(10) { transition-delay: 0.20s; }
#sidebar .dropdown-items a::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #1e293b;
    opacity: 0;
    transition: opacity 0.15s ease;
}
#sidebar .group.open .dropdown-items a::before {
    opacity: 1;
}
#sidebar .dropdown-items a:hover {
    background: linear-gradient(90deg, rgba(99,102,241,0.1) 0%, rgba(99,102,241,0.02) 100%);
    border-left-color: var(--sidebar-active);
    color: var(--sidebar-text-active);
}
#sidebar .dropdown-items a.active {
    background: linear-gradient(90deg, var(--sidebar-active-glass) 0%, rgba(99,102,241,0.06) 60%, transparent 100%);
    color: #ffffff;
    border-left-color: var(--sidebar-active);
    border-left-width: 3px;
    box-shadow: 0 2px 10px rgba(99,102,241,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
}
#sidebar .dropdown-items a.active i:first-child {
    color: var(--sidebar-active);
}

/* =============================================================
   SIDEBAR COLLAPSED STATE
   ============================================================= */
#sidebar.collapsed {
    width: 4rem;
    min-width: 4rem;
}
#sidebar.collapsed .sidebar-content a span,
#sidebar.collapsed .sidebar-content .section-title span,
#sidebar.collapsed .sidebar-content .section-title i {
    display: none;
}
#sidebar.collapsed .sidebar-content a {
    justify-content: center;
    padding: 0.75rem 0;
    border-left: none;
    border-radius: 0;
    margin-right: 0;
    box-shadow: none !important;
    background: none !important;
}
#sidebar.collapsed .sidebar-content a i:first-child {
    width: auto;
    font-size: 1.15rem;
}
#sidebar.collapsed .section-title {
    justify-content: center;
    padding: 1rem 0;
}
#sidebar.collapsed .section-title i {
    display: none !important;
}
#sidebar.collapsed .group.open .dropdown-items {
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

/* =============================================================
   MOBILE SIDEBAR
   ============================================================= */
@media (max-width: 767px) {
    #sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 4rem;
        left: 0;
        bottom: 0;
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        backdrop-filter: blur(2px);
        z-index: 39;
    }
}

/* =============================================================
   DESKTOP SIDEBAR
   ============================================================= */
@media (min-width: 768px) {
    #sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 4rem;
        height: calc(100vh - 4rem);
        border-right: 1px solid rgba(255,255,255,0.04);
    }
}

/* =============================================================
   DARK THEME COMPOSITION OVERRIDES
   Tailwind utility classes don't re-evaluate in dark mode,
   so we override common patterns here.
   ============================================================= */

/* --- Cards --- */
[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-white\/95,
[data-theme="dark"] div[class*="bg-white"]:not(.erp-navbar):not(#sidebar *) {
    background-color: var(--card-bg) !important;
    border-color: var(--card-border) !important;
}

/* --- Text --- */
[data-theme="dark"] .text-gray-800,
[data-theme="dark"] .text-gray-900,
[data-theme="dark"] .text-slate-800,
[data-theme="dark"] .text-slate-900 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .text-gray-600,
[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-slate-600,
[data-theme="dark"] .text-slate-700 {
    color: #94a3b8 !important;
}
[data-theme="dark"] .text-gray-500,
[data-theme="dark"] .text-slate-500,
[data-theme="dark"] .text-slate-400 {
    color: #64748b !important;
}

/* --- Table --- */
[data-theme="dark"] .bg-gray-50 {
    background-color: #1e293b !important;
}
[data-theme="dark"] .divide-gray-200 > * + * {
    border-color: #1e293b !important;
}
[data-theme="dark"] .border-slate-100,
[data-theme="dark"] .border-gray-200 {
    border-color: #1e293b !important;
}

/* --- Forms --- */
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
[data-theme="dark"] input::placeholder {
    color: #475569 !important;
}
[data-theme="dark"] .bg-slate-50 {
    background-color: #0f172a !important;
}

/* --- Navbar brand text --- */
[data-theme="dark"] .erp-navbar .text-slate-800 {
    color: #f1f5f9 !important;
}
[data-theme="dark"] .erp-navbar .text-slate-700 {
    color: #94a3b8 !important;
}

/* --- Border overrides --- */
[data-theme="dark"] .border-slate-200 {
    border-color: #1e293b !important;
}
[data-theme="dark"] .border-r {
    border-color: #1e293b !important;
}

/* --- Shadow overrides for dark --- */
[data-theme="dark"] .shadow-sm,
[data-theme="dark"] .shadow,
[data-theme="dark"] .shadow-md,
[data-theme="dark"] .shadow-lg,
[data-theme="dark"] .rounded-xl,
[data-theme="dark"] .rounded-lg {
    box-shadow: var(--shadow-sm) !important;
}

/* --- Hover table rows --- */
[data-theme="dark"] .hover\:bg-gray-50:hover {
    background-color: #1e293b !important;
}

/* --- Badge/bg colors --- */
[data-theme="dark"] .bg-indigo-50 { background-color: rgba(79,70,229,0.15) !important; }
[data-theme="dark"] .bg-emerald-50 { background-color: rgba(5,150,105,0.15) !important; }
[data-theme="dark"] .bg-amber-50 { background-color: rgba(217,119,6,0.15) !important; }
[data-theme="dark"] .bg-rose-50 { background-color: rgba(220,38,38,0.15) !important; }
[data-theme="dark"] .bg-violet-50 { background-color: rgba(139,92,246,0.15) !important; }
[data-theme="dark"] .bg-cyan-50 { background-color: rgba(6,182,212,0.15) !important; }
[data-theme="dark"] .bg-blue-100 { background-color: rgba(59,130,246,0.2) !important; }
[data-theme="dark"] .bg-green-100 { background-color: rgba(5,150,105,0.2) !important; }
[data-theme="dark"] .bg-red-100 { background-color: rgba(220,38,38,0.2) !important; }
[data-theme="dark"] .bg-gray-100 { background-color: rgba(100,116,139,0.15) !important; }
[data-theme="dark"] .text-blue-800 { color: #93c5fd !important; }
[data-theme="dark"] .text-green-800 { color: #6ee7b7 !important; }
[data-theme="dark"] .text-red-800 { color: #fca5a5 !important; }
[data-theme="dark"] .text-gray-800 { color: #e2e8f0 !important; }

/* --- Chart bg adaptation --- */
[data-theme="dark"] canvas {
    filter: brightness(0.9);
}

/* =============================================================
   CANDY THEME DESIGN TOKENS
   Warm gray bg, pink foreground — Candy Crush UI feel
   ============================================================= */
[data-theme="candy"] {
    --body-bg: #f0ece8;
    --card-bg: #faf8f6;
    --card-border: #e8e0dc;
    --text-primary: #2d2323;
    --text-secondary: #7a6e6e;
    --text-muted: #a89a9a;
    --primary: #d6336c;
    --primary-light: #f06292;
    --primary-dark: #b71c5a;
    --primary-bg: #fce4ec;
    --sidebar-bg: #2d1520;
    --sidebar-hover: #4a1f30;
    --sidebar-active: #e91e63;
    --sidebar-active-glass: rgba(233, 30, 99, 0.22);
    --sidebar-text: #d4a0b8;
    --sidebar-text-active: #fef1f5;
    --navbar-bg: rgba(45,21,32,0.97);
    --navbar-border: #4a1f30;
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --warning: #ef6c00;
    --warning-bg: #fff3e0;
    --info: #0277bd;
    --info-bg: #e1f5fe;
    --shadow-sm: 0 1px 3px rgba(45,35,35,0.06), 0 1px 2px rgba(45,35,35,0.04);
    --shadow-md: 0 4px 6px rgba(45,35,35,0.07), 0 2px 4px rgba(45,35,35,0.05);
    --shadow-lg: 0 10px 15px rgba(45,35,35,0.08), 0 4px 6px rgba(45,35,35,0.04);
}

/* =============================================================
   KITO THEME DESIGN TOKENS
   Dark high-contrast bg, white text, orange primary
   ============================================================= */
[data-theme="kito"] {
    --body-bg: #0a0a0f;
    --card-bg: #14141e;
    --card-border: #1e1e2a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b8;
    --text-muted: #707078;
    --primary: #f97316;
    --primary-light: #fb923c;
    --primary-dark: #ea580c;
    --primary-bg: #1c1408;
    --sidebar-bg: #050508;
    --sidebar-hover: #14141e;
    --sidebar-active: #f97316;
    --sidebar-active-glass: rgba(249, 115, 22, 0.22);
    --sidebar-text: #808088;
    --sidebar-text-active: #ffffff;
    --navbar-bg: rgba(10,10,15,0.97);
    --navbar-border: #1e1e2a;
    --success: #22c55e;
    --success-bg: #052e16;
    --danger: #ef4444;
    --danger-bg: #2d0a0a;
    --warning: #f97316;
    --warning-bg: #1c1408;
    --info: #38bdf8;
    --info-bg: #082b3e;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.5);
}

/* =============================================================
   CANDY THEME COMPOSITION OVERRIDES
   Mirror the dark theme pattern exactly — candy palette
   ============================================================= */

/* --- Cards --- */
[data-theme="candy"] .bg-white,
[data-theme="candy"] .bg-white\/95,
[data-theme="candy"] div[class*="bg-white"]:not(.erp-navbar):not(#sidebar *) {
    background-color: var(--card-bg) !important;
    border-color: var(--card-border) !important;
}

/* --- Text --- */
[data-theme="candy"] .text-gray-800,
[data-theme="candy"] .text-gray-900,
[data-theme="candy"] .text-slate-800,
[data-theme="candy"] .text-slate-900 {
    color: #2d2323 !important;
}
[data-theme="candy"] .text-gray-600,
[data-theme="candy"] .text-gray-700,
[data-theme="candy"] .text-slate-600,
[data-theme="candy"] .text-slate-700 {
    color: #7a6e6e !important;
}
[data-theme="candy"] .text-gray-500,
[data-theme="candy"] .text-slate-500,
[data-theme="candy"] .text-slate-400 {
    color: #a89a9a !important;
}

/* --- Table --- */
[data-theme="candy"] .bg-gray-50 {
    background-color: #e8e0dc !important;
}
[data-theme="candy"] .divide-gray-200 > * + * {
    border-color: #e8e0dc !important;
}
[data-theme="candy"] .border-slate-100,
[data-theme="candy"] .border-gray-200 {
    border-color: #e8e0dc !important;
}

/* --- Forms --- */
[data-theme="candy"] input,
[data-theme="candy"] select,
[data-theme="candy"] textarea {
    background-color: #fefcfb !important;
    border-color: #e8e0dc !important;
    color: var(--text-primary) !important;
}
[data-theme="candy"] input::placeholder {
    color: var(--text-muted) !important;
}
[data-theme="candy"] .bg-slate-50 {
    background-color: #f0ece8 !important;
}

/* --- Navbar candy theme overrides --- */
[data-theme="candy"] .erp-navbar .text-slate-800 {
    color: #fef1f5 !important;
}
[data-theme="candy"] .erp-navbar .text-slate-700 {
    color: #d4a0b8 !important;
}
[data-theme="candy"] .erp-navbar .text-slate-600 {
    color: #d4a0b8 !important;
}
[data-theme="candy"] .erp-navbar .text-slate-500 {
    color: #d4a0b8 !important;
}
[data-theme="candy"] .erp-navbar .text-slate-400 {
    color: #a89a9a !important;
}
[data-theme="candy"] .erp-navbar .text-indigo-600 {
    color: #f06292 !important;
}
[data-theme="candy"] .erp-navbar .text-indigo-700 {
    color: #fbcfe8 !important;
}
[data-theme="candy"] .erp-navbar .text-indigo-500 {
    color: #f06292 !important;
}

/* Navbar backgrounds */
[data-theme="candy"] .erp-navbar .bg-indigo-100 {
    background-color: #4a1f30 !important;
}
[data-theme="candy"] .erp-navbar .bg-indigo-50 {
    background-color: #4a1f30 !important;
}
[data-theme="candy"] .erp-navbar .bg-white {
    background-color: #2d1520 !important;
    border-color: #4a1f30 !important;
}

/* Navbar hover states */
[data-theme="candy"] .erp-navbar .hover\:text-red-600:hover {
    color: #f06292 !important;
}
[data-theme="candy"] .erp-navbar .hover\:bg-red-50:hover {
    background-color: #4a1f30 !important;
}
[data-theme="candy"] .erp-navbar .hover\:text-yellow-500:hover {
    color: #f48fb1 !important;
}
[data-theme="candy"] .erp-navbar .hover\:bg-yellow-50:hover {
    background-color: #4a1f30 !important;
}
[data-theme="candy"] .erp-navbar .hover\:text-indigo-600:hover {
    color: #f06292 !important;
}
[data-theme="candy"] .erp-navbar .hover\:bg-indigo-50:hover {
    background-color: #4a1f30 !important;
}
[data-theme="candy"] .erp-navbar .hover\:bg-slate-50:hover {
    background-color: #4a1f30 !important;
}

/* Navbar toggle button */
[data-theme="candy"] .navbar-toggle-btn {
    color: #d4a0b8 !important;
}
[data-theme="candy"] .navbar-toggle-btn:hover {
    background: #4a1f30 !important;
    color: #fef1f5 !important;
}

/* --- Border overrides --- */
[data-theme="candy"] .border-slate-200 {
    border-color: #e8e0dc !important;
}
[data-theme="candy"] .border-r {
    border-color: #e8e0dc !important;
}

/* --- Shadow overrides for candy --- */
[data-theme="candy"] .shadow-sm,
[data-theme="candy"] .shadow,
[data-theme="candy"] .shadow-md,
[data-theme="candy"] .shadow-lg,
[data-theme="candy"] .rounded-xl,
[data-theme="candy"] .rounded-lg {
    box-shadow: var(--shadow-sm) !important;
}

/* --- Hover table rows --- */
[data-theme="candy"] .hover\:bg-gray-50:hover {
    background-color: #e8e0dc !important;
}

/* --- Badge/bg colors with pink/warm tints --- */
[data-theme="candy"] .bg-indigo-50 { background-color: #fce4ec !important; }
[data-theme="candy"] .bg-emerald-50 { background-color: #e8f5e9 !important; }
[data-theme="candy"] .bg-amber-50 { background-color: #fff3e0 !important; }
[data-theme="candy"] .bg-rose-50 { background-color: #fce4ec !important; }
[data-theme="candy"] .bg-violet-50 { background-color: #f3e5f5 !important; }
[data-theme="candy"] .bg-cyan-50 { background-color: #e0f7fa !important; }
[data-theme="candy"] .bg-blue-100 { background-color: #fce4ec !important; }
[data-theme="candy"] .bg-green-100 { background-color: #e8f5e9 !important; }
[data-theme="candy"] .bg-red-100 { background-color: #ffebee !important; }
[data-theme="candy"] .bg-gray-100 { background-color: #f0ece8 !important; }
[data-theme="candy"] .text-blue-800 { color: #d6336c !important; }
[data-theme="candy"] .text-green-800 { color: #2e7d32 !important; }
[data-theme="candy"] .text-red-800 { color: #c62828 !important; }
[data-theme="candy"] .text-gray-800 { color: #2d2323 !important; }

/* --- Chart bg adaptation --- */
[data-theme="candy"] canvas {
    filter: none;
}

/* =============================================================
   CANDY THEME: CURSIVE HEADINGS
   Pacifico font for candy-crush style headings
   ============================================================= */
[data-theme="candy"] h1,
[data-theme="candy"] h2,
[data-theme="candy"] h3,
[data-theme="candy"] .text-2xl,
[data-theme="candy"] .text-xl {
    font-family: 'Pacifico', cursive !important;
    font-weight: 400 !important;
}

/* =============================================================
   CANDY THEME: SHINY BUBBLE BUTTONS
   Pill-shaped, pink gradient, glossy highlight — candy-crush feel
   Covers <button>, <input type="submit/button">, and <a> anchors
   styled as buttons (those with bg-* + text-white classes).
   ============================================================= */
[data-theme="candy"] .erp-main button:not([id*="themeCard"]):not(.no-bubble),
[data-theme="candy"] .erp-main input[type="submit"],
[data-theme="candy"] .erp-main input[type="button"],
[data-theme="candy"] .erp-main a[href][class*="bg-"][class*="text-white"]:not(.no-bubble) {
    border-radius: 999px !important;
    font-family: 'Pacifico', cursive;
    font-weight: 500 !important;
    background: linear-gradient(135deg, #d6336c, #e91e63) !important;
    color: #fff !important;
    border: none !important;
    box-shadow:
        0 4px 15px rgba(214,51,108,.35),
        inset 0 2px 0 rgba(255,255,255,.28) !important;
    transition: all .25s cubic-bezier(.34,1.56,.64,1) !important;
    position: relative;
    overflow: hidden;
    letter-spacing: .02em;
    text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
/* Glossy bubble shine overlay */
[data-theme="candy"] .erp-main button:not([id*="themeCard"]):not(.no-bubble)::after,
[data-theme="candy"] .erp-main input[type="submit"]::after,
[data-theme="candy"] .erp-main input[type="button"]::after,
[data-theme="candy"] .erp-main a[href][class*="bg-"][class*="text-white"]:not(.no-bubble)::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.3) 0%, transparent 100%);
    border-radius: 999px 999px 50% 50%;
    pointer-events: none;
}
/* Hover: lift & grow like a bubble */
[data-theme="candy"] .erp-main button:not([id*="themeCard"]):not(.no-bubble):hover,
[data-theme="candy"] .erp-main input[type="submit"]:hover,
[data-theme="candy"] .erp-main input[type="button"]:hover,
[data-theme="candy"] .erp-main a[href][class*="bg-"][class*="text-white"]:not(.no-bubble):hover {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow:
        0 8px 25px rgba(214,51,108,.45),
        inset 0 2px 0 rgba(255,255,255,.38) !important;
    background: linear-gradient(135deg, #e91e63, #f06292) !important;
}
/* Click: squish down */
[data-theme="candy"] .erp-main button:not([id*="themeCard"]):not(.no-bubble):active,
[data-theme="candy"] .erp-main input[type="submit"]:active,
[data-theme="candy"] .erp-main input[type="button"]:active,
[data-theme="candy"] .erp-main a[href][class*="bg-"][class*="text-white"]:not(.no-bubble):active {
    transform: translateY(0) scale(.97) !important;
    box-shadow:
        0 2px 8px rgba(214,51,108,.3),
        inset 0 2px 4px rgba(0,0,0,.1) !important;
}

/* =============================================================
   KITO THEME COMPOSITION OVERRIDES
   Dark high-contrast bg, white text, orange primary buttons
   ============================================================= */

/* --- Cards --- */
[data-theme="kito"] .bg-white,
[data-theme="kito"] .bg-white\/95,
[data-theme="kito"] div[class*="bg-white"]:not(.erp-navbar):not(#sidebar *) {
    background-color: var(--card-bg) !important;
    border-color: var(--card-border) !important;
}

/* --- Text --- */
[data-theme="kito"] .text-gray-800,
[data-theme="kito"] .text-gray-900,
[data-theme="kito"] .text-slate-800,
[data-theme="kito"] .text-slate-900 {
    color: #ffffff !important;
}
[data-theme="kito"] .text-gray-600,
[data-theme="kito"] .text-gray-700,
[data-theme="kito"] .text-slate-600,
[data-theme="kito"] .text-slate-700 {
    color: #b0b0b8 !important;
}
[data-theme="kito"] .text-gray-500,
[data-theme="kito"] .text-slate-500,
[data-theme="kito"] .text-slate-400 {
    color: #707078 !important;
}

/* --- Table --- */
[data-theme="kito"] .bg-gray-50 {
    background-color: #1e1e2a !important;
}
[data-theme="kito"] .divide-gray-200 > * + * {
    border-color: #1e1e2a !important;
}
[data-theme="kito"] .border-slate-100,
[data-theme="kito"] .border-gray-200 {
    border-color: #1e1e2a !important;
}

/* --- Forms --- */
[data-theme="kito"] input,
[data-theme="kito"] select,
[data-theme="kito"] textarea {
    background-color: #0a0a0f !important;
    border-color: #2a2a38 !important;
    color: #ffffff !important;
}
[data-theme="kito"] input::placeholder {
    color: #505058 !important;
}
[data-theme="kito"] .bg-slate-50 {
    background-color: #0a0a0f !important;
}

/* --- Navbar overrides --- */
[data-theme="kito"] .erp-navbar .text-slate-800 {
    color: #ffffff !important;
}
[data-theme="kito"] .erp-navbar .text-slate-700 {
    color: #b0b0b8 !important;
}
[data-theme="kito"] .erp-navbar .text-slate-600 {
    color: #b0b0b8 !important;
}
[data-theme="kito"] .erp-navbar .text-slate-500 {
    color: #b0b0b8 !important;
}
[data-theme="kito"] .erp-navbar .text-slate-400 {
    color: #707078 !important;
}
[data-theme="kito"] .erp-navbar .text-indigo-600 {
    color: #fb923c !important;
}
[data-theme="kito"] .erp-navbar .text-indigo-700 {
    color: #ffffff !important;
}
[data-theme="kito"] .erp-navbar .text-indigo-500 {
    color: #fb923c !important;
}
[data-theme="kito"] .erp-navbar .bg-indigo-100 {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .erp-navbar .bg-indigo-50 {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .erp-navbar .bg-white {
    background-color: #14141e !important;
    border-color: #1e1e2a !important;
}
[data-theme="kito"] .erp-navbar .hover\:text-red-600:hover {
    color: #fb923c !important;
}
[data-theme="kito"] .erp-navbar .hover\:bg-red-50:hover {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .erp-navbar .hover\:text-yellow-500:hover {
    color: #fb923c !important;
}
[data-theme="kito"] .erp-navbar .hover\:bg-yellow-50:hover {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .erp-navbar .hover\:text-indigo-600:hover {
    color: #fb923c !important;
}
[data-theme="kito"] .erp-navbar .hover\:bg-indigo-50:hover {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .erp-navbar .hover\:bg-slate-50:hover {
    background-color: #1c1408 !important;
}
[data-theme="kito"] .navbar-toggle-btn {
    color: #b0b0b8 !important;
}
[data-theme="kito"] .navbar-toggle-btn:hover {
    background: #1c1408 !important;
    color: #fb923c !important;
}

/* --- Border overrides --- */
[data-theme="kito"] .border-slate-200 {
    border-color: #1e1e2a !important;
}
[data-theme="kito"] .border-r {
    border-color: #1e1e2a !important;
}

/* --- Shadow overrides --- */
[data-theme="kito"] .shadow-sm,
[data-theme="kito"] .shadow,
[data-theme="kito"] .shadow-md,
[data-theme="kito"] .shadow-lg,
[data-theme="kito"] .rounded-xl,
[data-theme="kito"] .rounded-lg {
    box-shadow: var(--shadow-sm) !important;
}

/* --- Hover table rows --- */
[data-theme="kito"] .hover\:bg-gray-50:hover {
    background-color: #1e1e2a !important;
}

/* --- Badge/bg colors with orange-tinted dark variants --- */
[data-theme="kito"] .bg-indigo-50 { background-color: rgba(249,115,22,0.12) !important; }
[data-theme="kito"] .bg-emerald-50 { background-color: rgba(34,197,94,0.12) !important; }
[data-theme="kito"] .bg-amber-50 { background-color: rgba(249,115,22,0.12) !important; }
[data-theme="kito"] .bg-rose-50 { background-color: rgba(239,68,68,0.12) !important; }
[data-theme="kito"] .bg-violet-50 { background-color: rgba(168,85,247,0.12) !important; }
[data-theme="kito"] .bg-cyan-50 { background-color: rgba(34,211,238,0.12) !important; }
[data-theme="kito"] .bg-blue-100 { background-color: rgba(249,115,22,0.15) !important; }
[data-theme="kito"] .bg-green-100 { background-color: rgba(34,197,94,0.15) !important; }
[data-theme="kito"] .bg-red-100 { background-color: rgba(239,68,68,0.15) !important; }
[data-theme="kito"] .bg-gray-100 { background-color: rgba(112,112,120,0.12) !important; }
[data-theme="kito"] .text-blue-800 { color: #fb923c !important; }
[data-theme="kito"] .text-green-800 { color: #4ade80 !important; }
[data-theme="kito"] .text-red-800 { color: #fca5a5 !important; }
[data-theme="kito"] .text-gray-800 { color: #e2e2e8 !important; }

/* --- Chart --- */
[data-theme="kito"] canvas {
    filter: brightness(0.85);
}

/* --- KITO: Orange primary buttons --- */
[data-theme="kito"] .bg-indigo-600,
[data-theme="kito"] .bg-indigo-700,
[data-theme="kito"] .bg-blue-600,
[data-theme="kito"] .bg-blue-700,
[data-theme="kito"] .bg-green-600,
[data-theme="kito"] .bg-green-700,
[data-theme="kito"] .bg-red-600,
[data-theme="kito"] .bg-red-700,
[data-theme="kito"] .bg-emerald-600,
[data-theme="kito"] .bg-emerald-700,
[data-theme="kito"] .bg-amber-600,
[data-theme="kito"] .bg-amber-700,
[data-theme="kito"] .bg-rose-600,
[data-theme="kito"] .bg-rose-700,
[data-theme="kito"] .bg-sky-600,
[data-theme="kito"] .bg-sky-700,
[data-theme="kito"] .bg-violet-600,
[data-theme="kito"] .bg-violet-700 {
    background-color: #f97316 !important;
}
[data-theme="kito"] .hover\:bg-indigo-700:hover,
[data-theme="kito"] .hover\:bg-blue-700:hover,
[data-theme="kito"] .hover\:bg-green-700:hover,
[data-theme="kito"] .hover\:bg-red-700:hover,
[data-theme="kito"] .hover\:bg-emerald-700:hover,
[data-theme="kito"] .hover\:bg-amber-700:hover,
[data-theme="kito"] .hover\:bg-rose-700:hover,
[data-theme="kito"] .hover\:bg-sky-700:hover,
[data-theme="kito"] .hover\:bg-violet-700:hover {
    background-color: #ea580c !important;
}

