/* =========================================================
SENTRIFOX THEME SYSTEM
========================================================= */

body.theme-ready,
body.theme-ready .sidebar,
body.theme-ready .topbar,
body.theme-ready .page-content,
body.theme-ready .card,
body.theme-ready .stat-card,
body.theme-ready .table-card,
body.theme-ready .chart-card,
body.theme-ready .search-box,
body.theme-ready .theme-btn,
body.theme-ready .icon-btn,
body.theme-ready .profile,
body.theme-ready .sidebar-nav a{
    transition:
            background 0.25s ease,
            color 0.25s ease,
            border-color 0.25s ease,
            box-shadow 0.25s ease,
            transform 0.25s ease;
}

html.theme-preload *,
html.theme-preload *::before,
html.theme-preload *::after{
    transition: none !important;
}

/* =========================================================
LIGHT MODE
========================================================= */

body.light{
    --background:
            linear-gradient(135deg, #eef6ff 0%, #f8fbff 35%, #f5fff9 100%);

    --content-bg:rgba(255,255,255,0.72);
    --topbar-bg:rgba(255,255,255,0.58);
    --sidebar-glass-bg:rgba(255,255,255,0.34);
    --search-bg:rgba(255,255,255,0.52);
    --button-bg:rgba(255,255,255,0.72);
    --button-hover:rgba(255,255,255,0.92);

    --nav-hover:rgba(255,255,255,0.35);
    --nav-active:rgba(255,255,255,0.55);

    --text-primary:#0f172a;
    --text-secondary:#64748b;

    --border-light:rgba(15,23,42,0.10);
    --glass-border:rgba(255,255,255,0.45);

    --shadow-soft:0 18px 40px rgba(15,23,42,0.10);
}

/* =========================================================
DARK MODE
========================================================= */

body.dark{
    --background:
            linear-gradient(135deg, #081120 0%, #0f172a 40%, #111827 100%);

    --content-bg:rgba(15,23,42,0.72);
    --topbar-bg:rgba(15,23,42,0.58);
    --sidebar-glass-bg:rgba(17,24,39,0.38);
    --search-bg:rgba(30,41,59,0.56);
    --button-bg:rgba(30,41,59,0.75);
    --button-hover:rgba(51,65,85,0.95);

    --nav-hover:rgba(255,255,255,0.06);
    --nav-active:rgba(255,255,255,0.10);

    --text-primary:#f8fafc;
    --text-secondary:#94a3b8;

    --border-light:rgba(255,255,255,0.10);
    --glass-border:rgba(255,255,255,0.10);

    --shadow-soft:0 18px 40px rgba(0,0,0,0.35);
}

/* =========================================================
NO-FLICKER THEME ATTRIBUTE SUPPORT
========================================================= */

html[data-theme="light"] body{
    --background:
            linear-gradient(135deg, #eef6ff 0%, #f8fbff 35%, #f5fff9 100%);
    --content-bg:rgba(255,255,255,0.72);
    --topbar-bg:rgba(255,255,255,0.58);
    --sidebar-glass-bg:rgba(255,255,255,0.34);
    --search-bg:rgba(255,255,255,0.52);
    --button-bg:rgba(255,255,255,0.72);
    --button-hover:rgba(255,255,255,0.92);

    --nav-hover:rgba(255,255,255,0.35);
    --nav-active:rgba(255,255,255,0.55);

    --text-primary:#0f172a;
    --text-secondary:#64748b;

    --border-light:rgba(15,23,42,0.10);
    --glass-border:rgba(255,255,255,0.45);

    --shadow-soft:0 18px 40px rgba(15,23,42,0.10);
}

html[data-theme="dark"] body{
    --background:
            linear-gradient(135deg, #081120 0%, #0f172a 40%, #111827 100%);
    --content-bg:rgba(15,23,42,0.72);
    --topbar-bg:rgba(15,23,42,0.58);
    --sidebar-glass-bg:rgba(17,24,39,0.38);
    --search-bg:rgba(30,41,59,0.56);
    --button-bg:rgba(30,41,59,0.75);
    --button-hover:rgba(51,65,85,0.95);

    --nav-hover:rgba(255,255,255,0.06);
    --nav-active:rgba(255,255,255,0.10);

    --text-primary:#f8fafc;
    --text-secondary:#94a3b8;

    --border-light:rgba(255,255,255,0.10);
    --glass-border:rgba(255,255,255,0.10);

    --shadow-soft:0 18px 40px rgba(0,0,0,0.35);
}

/* =========================================================
DARK MODE FIXES
========================================================= */

body.dark .search-box input{
    color:#ffffff;
}

html[data-theme="dark"] body .search-box input{
    color:#ffffff;
}

body.dark .table td{
    border-top:1px solid rgba(255,255,255,0.06);
}

html[data-theme="dark"] body .table td{
    border-top:1px solid rgba(255,255,255,0.06);
}

body.dark .btn-primary{
    background:#02C39A;
}

html[data-theme="dark"] body .btn-primary{
    background:#02C39A;
}

body.dark .btn-primary:hover{
    background:#00A884;
}

html[data-theme="dark"] body .btn-primary:hover{
    background:#00A884;
}