/* ===================================== */
/* PREVENT FLASH BEFORE THEME LOAD */
/* ===================================== */

html.theme-loading{
visibility:hidden;
}

/* ===================================== */
/* LIGHT THEME (SOFT LIGHT - IMPROVED) */
/* ===================================== */

:root{
--bg:#eef1f6;          /* soft gray background (less strain) */
--card-bg:#ffffff;     /* keep cards clean */
--text:#111827;        /* strong but not harsh */
--border:#e6e8ee;      /* subtle borders */
--header:#f4f6fb;      /* slightly tinted header */
--sidebar:#f4f6fb;     /* match header */
}

/* DARK THEME (FIXED) */
html.theme-dark{
--bg:#0f172a;
--card-bg:#1e293b;
--text:#e5e7eb;
--border:#334155;
--header:#0f172a;
--sidebar:#0f172a;
} 

/* ===================================== */
/* GLOBAL */
/* ===================================== */

body{
background:var(--bg);
color:var(--text);
transition:.25s ease;
line-height:1.6;
-webkit-font-smoothing:antialiased;
}

/* ===================================== */
/* HEADER */
/* ===================================== */

html.theme-dark .kt-header{
background:var(--header);
border-bottom:1px solid var(--border);
}

html.theme-dark .kt-portlet,
html.theme-dark .kt-widget,
html.theme-dark .card{
background:var(--card-bg);
border:1px solid var(--border);
}

html.theme-dark table{
background:var(--card-bg);
color:var(--text);
}

html.theme-dark th,
html.theme-dark td{
border-color:var(--border);
}

html.theme-dark .kt-aside{
background:var(--sidebar);
}

html.theme-dark .theme-dropdown{
background:#1e293b;
border:1px solid #334155;
}

html.theme-dark .theme-option:hover{
background:#334155;
}
/* ===================================== */
/* CARDS */
/* ===================================== */

body.theme-dark .kt-portlet,
body.theme-dark .kt-widget,
body.theme-dark .card{
background:var(--card-bg);
border:1px solid var(--border);
}

/* soften cards (light mode too) */
.card,
.kt-portlet,
.kt-widget{
box-shadow:0 2px 6px rgba(0,0,0,0.04);
}

/* ===================================== */
/* TABLES */
/* ===================================== */

body.theme-dark table{
background:var(--card-bg);
color:var(--text);
}

body.theme-dark th,
body.theme-dark td{
border-color:var(--border);
}

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

body.theme-dark .kt-aside{
background:var(--sidebar);
}

/* ===================================== */
/* FIX LIGHT MODE VISIBILITY */
/* ===================================== */

body:not(.theme-dark){
color:#1f2937;
}

/* header text */
body:not(.theme-dark) .kt-header,
body:not(.theme-dark) .kt-header *{
color:#1f2937 !important;
}

/* menu text */
body:not(.theme-dark) .kt-menu__link-text{
color:#374151 !important;
font-weight:500;
}

/* icons */
body:not(.theme-dark) .kt-menu__link-icon i,
body:not(.theme-dark) .kt-header__topbar i{
color:#4b5563 !important;
}

/* remove faded look */
body:not(.theme-dark) .kt-menu__link,
body:not(.theme-dark) .kt-header__topbar-item{
opacity:1 !important;
}

/* ===================================== */
/* HOVER STATES */
/* ===================================== */

body:not(.theme-dark) .kt-menu__link:hover{
color:#111827 !important;
}

body:not(.theme-dark) .kt-menu__link:hover i{
color:#111827 !important;
}

body:not(.theme-dark) .kt-header__topbar-item:hover{
color:#111827 !important;
}

/* ===================================== */
/* THEME TOGGLE BUTTON */
/* ===================================== */

.theme-toggle{
position:relative;
margin-right:12px;
}

.theme-toggle-btn{
width:38px;
height:38px;
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
border-radius:6px;
font-size:18px;
transition:.2s;
}

.theme-toggle-btn:hover{
background:rgba(0,0,0,.05);
}

/* ===================================== */
/* DROPDOWN */
/* ===================================== */

.theme-dropdown{
position:absolute;
top:42px;
right:0;
width:180px;
background:white;
border-radius:10px;
box-shadow:0 10px 30px rgba(0,0,0,.15);
border:1px solid #eee;
display:none;
overflow:hidden;
z-index:9999;
}

.theme-toggle.open .theme-dropdown{
display:block;
}

.theme-option{
display:flex;
align-items:center;
justify-content:space-between;
padding:10px 14px;
cursor:pointer;
transition:.15s;
}

.theme-option-left{
display:flex;
gap:8px;
align-items:center;
}

.theme-option:hover{
background:#f1f3f7;
}

.theme-arrow{
opacity:.4;
}

/* ===================================== */
/* DARK DROPDOWN */
/* ===================================== */

body.theme-dark .theme-dropdown{
background:#1e293b;
border:1px solid #334155;
}

body.theme-dark .theme-option:hover{
background:#334155;
}

/* ===================================== */
/* FIX HEADER ALIGNMENT */
/* ===================================== */

.kt-header__topbar-item .theme-toggle{
display:flex;
align-items:center;
}

.kt-header__topbar-item{
display:flex;
align-items:center;
}

/* ===================================== */
/* ICON ALIGNMENT */
/* ===================================== */

.theme-option-left span:first-child{
width:20px;
display:inline-flex;
justify-content:center;
}

/* ===================================== */
/* FORCE ALL TOP TEXT (DASHBOARD, REDEEM, ETC.) TO BLACK */
/* ===================================== */

/* Header + everything inside */
body:not(.theme-dark) .kt-header,
body:not(.theme-dark) .kt-header * {
    color: #000 !important;
}

/* Subheader (Dashboard, Redeem, etc.) */
body:not(.theme-dark) .kt-subheader,
body:not(.theme-dark) .kt-subheader * {
    color: #000 !important;
}

/* Menu links (Redeem, Dashboard, etc.) */
body:not(.theme-dark) .kt-menu__link-text {
    color: #000 !important;
}

/* Breadcrumbs */
body:not(.theme-dark) .kt-subheader__breadcrumbs,
body:not(.theme-dark) .kt-subheader__breadcrumbs * {
    color: #000 !important;
}

/* Icons */
body:not(.theme-dark) .kt-header i,
body:not(.theme-dark) .kt-menu__link-icon i {
    color: #000 !important;
}
body:not(.theme-dark) .kt-header__brand img {
    filter: brightness(0) saturate(100%);
}
/* ===================================== */
/* REDEEM BUTTON (LIGHT MODE FIX) */
/* ===================================== */

/* target redeem buttons */
body:not(.theme-dark) .btn,
body:not(.theme-dark) .btn-primary {

    background-color: #3b82f6 !important; /* blue */
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

/* hover */
body:not(.theme-dark) .btn:hover,
body:not(.theme-dark) .btn-primary:hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
}
/* Coupons subtitle softer text */
.refer-text {
    font-weight: 400;
    color: #64748b !important;
}
html.theme-dark body {
    background: var(--bg);
    color: var(--text);
}

.kt-menu__link-icon svg {
    color: var(--text);
}

