/* ============================================================
   MULAEARN brand theme v2 — teal/cyan (from logo icon) + charcoal
   Loaded after styles.min.css; overrides the template palette.
   Palette: teal #14b8a6 · cyan #45efe0 · charcoal #14171a
   ============================================================ */

:root,
[data-theme-mode="light"] {
    --primary-rgb: 20, 184, 166;      /* teal (logo icon) */
    --secondary-rgb: 69, 239, 224;    /* bright cyan */
    --body-bg-rgb: 243, 247, 247;
    --default-body-bg-color: #f3f7f7;
}

/* ---------------- Header: white with colorful icon chips ---------------- */
.app-header {
    background: #ffffff;
    border-bottom: 0;
    box-shadow: 0 6px 18px -12px rgba(15, 118, 110, 0.35);
    border-image: linear-gradient(90deg, #14b8a6, #0ea5e9, #6366f1, #ec4899) 1;
    border-bottom: 3px solid;
}
.app-header .header-link {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline: 4px;
}
.app-header .ml-menu-btn {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: #ffffff !important;
    font-size: 1.05rem;
}
.app-header .ml-menu-btn i { color: #ffffff !important; }
.app-header .header-theme-mode .header-link {
    background: rgba(99, 102, 241, 0.12);
}
.app-header .header-theme-mode .header-link-icon {
    color: #6366f1 !important;
}
.app-header .header-search .header-link {
    background: rgba(14, 165, 233, 0.12);
}
.app-header .switcher-icon {
    background: rgba(236, 72, 153, 0.12);
}
.app-header .switcher-icon .header-link-icon,
.app-header .switcher-icon i {
    color: #ec4899 !important;
}
.app-header .header-link:hover {
    transform: translateY(-1px);
}
/* Keep everything on one horizontal line, vertically centered */
.app-header .main-header-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
}
.app-header .header-content-left,
.app-header .header-content-right {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}
.app-header .header-element {
    display: flex;
    align-items: center;
}
/* Center the logo in the header (mobile) */
.app-header .horizontal-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
}
.app-header .horizontal-logo img,
.app-header .horizontal-logo .header-logo img {
    height: auto !important;
    max-height: 40px;
    width: auto;
    /* never let the centered logo reach the side chips, whatever the phone width */
    max-width: calc(100vw - 252px);
    object-fit: contain;
    display: none;
}
@media (max-width: 420px) {
    .app-header .horizontal-logo img,
    .app-header .horizontal-logo .header-logo img { max-height: 30px; }
    .app-header .header-link { width: 32px; height: 32px; margin-inline: 2px; font-size: .9rem; }
    .app-header .ml-menu-btn { font-size: .95rem; }
    .app-header .header-search .header-link .iti__flag { transform: scale(1.1); }
}
/* Header is white — always show the dark-text logo (mobile) */
.app-header .horizontal-logo .header-logo img {
    display: none !important;
}
.app-header .horizontal-logo .header-logo .toggle-dark {
    display: block !important;
}

/* ---------------- Sidebar: white ---------------- */
.app-sidebar,
[data-menu-styles="light"] .app-sidebar,
[data-menu-styles="dark"] .app-sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e6eeee;
    box-shadow: 0 0 24px -14px rgba(17, 65, 60, 0.25);
}
.app-sidebar .main-sidebar-header,
[data-menu-styles="light"] .app-sidebar .main-sidebar-header,
[data-menu-styles="dark"] .app-sidebar .main-sidebar-header {
    background: #ffffff !important;
    border-bottom: 1px solid #e6eeee;
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-sidebar .main-sidebar-header img {
    height: 40px;
    width: auto;
}
/* Sidebar is white — always show the dark-text logo */
.app-sidebar .main-sidebar-header .header-logo img {
    display: none !important;
}
.app-sidebar .main-sidebar-header .header-logo .desktop-dark {
    display: block !important;
}
/* Profile banner at the top of the sidebar */
.ml-side-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 12px 10px;
    max-width: 216px; /* sidebar is 240px; nav scroll-container is wider */
    padding: 14px;
    border-radius: 16px;
    background:
        radial-gradient(220px 120px at 100% -20%, rgba(253, 224, 71, 0.30), transparent 60%),
        linear-gradient(115deg, #2563eb 0%, #7c3aed 55%, #ec4899 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px -12px rgba(124, 58, 237, 0.55);
}
.ml-side-profile .ml-side-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    color: #ffffff;
    flex-shrink: 0;
}
.ml-side-profile .ml-side-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.ml-side-profile .ml-side-name {
    font-weight: 800;
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.ml-side-profile .ml-side-sub {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.85);
}
.ml-side-profile .ml-side-sub i { color: #fde047; }
.ml-side-profile .iti__flag {
    flex-shrink: 0;
    margin-left: auto;
    align-self: center;
    border-radius: 2px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

/* Menu items: bold labels + vivid gradient icon chips */
.app-sidebar .side-menu__item {
    color: #24313a;
    border-radius: 12px;
    margin: 3px 10px;
    padding-block: 0.45rem;
}
.app-sidebar .side-menu__label {
    color: inherit;
    font-weight: 700;
    font-size: 0.9rem;
}
.app-sidebar .side-menu__icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    fill: #ffffff;
    font-size: 1rem;
    margin-top: 0 !important;
    margin-inline-end: 10px;
    background: linear-gradient(135deg, #2dd4bf, #0d9488);
    box-shadow: 0 6px 12px -6px rgba(13, 148, 136, 0.6);
    flex-shrink: 0;
}
/* Cycle 8 vivid chip colors down the menu */
.app-sidebar .main-menu > li:nth-of-type(8n+1) .side-menu__icon { background: linear-gradient(135deg, #2dd4bf, #0d9488); box-shadow: 0 6px 12px -6px rgba(13,148,136,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+2) .side-menu__icon { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 6px 12px -6px rgba(79,70,229,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+3) .side-menu__icon { background: linear-gradient(135deg, #fb923c, #ea580c); box-shadow: 0 6px 12px -6px rgba(234,88,12,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+4) .side-menu__icon { background: linear-gradient(135deg, #f472b6, #db2777); box-shadow: 0 6px 12px -6px rgba(219,39,119,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+5) .side-menu__icon { background: linear-gradient(135deg, #60a5fa, #2563eb); box-shadow: 0 6px 12px -6px rgba(37,99,235,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+6) .side-menu__icon { background: linear-gradient(135deg, #f87171, #dc2626); box-shadow: 0 6px 12px -6px rgba(220,38,38,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+7) .side-menu__icon { background: linear-gradient(135deg, #4ade80, #16a34a); box-shadow: 0 6px 12px -6px rgba(22,163,74,.6); }
.app-sidebar .main-menu > li:nth-of-type(8n+8) .side-menu__icon { background: linear-gradient(135deg, #c084fc, #7c3aed); box-shadow: 0 6px 12px -6px rgba(124,58,237,.6); }

.app-sidebar .side-menu__item:hover,
.app-sidebar .side-menu__item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.10), rgba(236, 72, 153, 0.10));
    color: #1d4ed8;
}
.app-sidebar .slide__category {
    margin-top: 6px;
}
.app-sidebar .slide__category .category-name {
    background: linear-gradient(90deg, #0d9488, #7c3aed, #db2777);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}
.app-sidebar .slide-menu .side-menu__item {
    color: #5d6d75;
    font-weight: 600;
}
.app-sidebar .slide-menu .side-menu__item:hover {
    color: #7c3aed;
    background: transparent;
}
.app-sidebar .side-menu__angle {
    color: #a8b3bd;
}

/* ---------------- Content area ---------------- */
.main-content.app-content {
    background-color: #f3f7f7;
}
.custom-card {
    border-radius: 14px;
    border: 1px solid #e3eded;
    box-shadow: 0 8px 22px -14px rgba(16, 68, 63, 0.22);
}
.card-title {
    color: #17272e;
}
.page-title {
    color: #17272e;
}
.breadcrumb-item a {
    color: #0d9488;
}

/* ---------------- Dashboard welcome hero (colorful, no black) ---------------- */
.ml-hero {
    background:
        radial-gradient(520px 260px at 96% -20%, rgba(253, 224, 71, 0.30), transparent 55%),
        radial-gradient(440px 250px at -6% 115%, rgba(69, 239, 224, 0.38), transparent 60%),
        linear-gradient(115deg, #2563eb 0%, #7c3aed 52%, #ec4899 100%);
    color: #ffffff;
    border-radius: 18px;
    border: 0;
    overflow: hidden;
    position: relative;
}
.ml-hero::before {
    content: "";
    position: absolute;
    right: -55px;
    top: -55px;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    border: 26px solid rgba(255, 255, 255, 0.10);
}
.ml-hero .ml-hero-badge {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    display: inline-block;
}
.ml-hero p,
.ml-hero #welcomeText { color: rgba(255, 255, 255, 0.92); }
.ml-hero .text-muted { color: rgba(255, 255, 255, 0.7) !important; }
.ml-hero a { color: #fef08a; }
.ml-hero .ml-tile {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    padding: 14px 16px;
    height: 100%;
    backdrop-filter: blur(4px);
}
.ml-hero .ml-tile .ml-tile-label {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
}
.ml-hero .ml-tile .ml-tile-value { white-space: nowrap; overflow: hidden; }
.ml-hero .ml-tile-earnings { border-color: rgba(255, 255, 255, 0.45); }
.ml-hero .ml-tile-earnings .ml-tile-label { color: #a5f3fc; }
.ml-hero .ml-tile-earnings .ml-tile-value { color: #ffffff; font-size: 1.6rem; font-weight: 800; }
.ml-hero .ml-tile-expense .ml-tile-label { color: rgba(255, 255, 255, 0.75); }
.ml-hero .ml-tile-expense .ml-tile-value { color: #ffffff; font-size: 1.05rem; font-weight: 700; }
.ml-stat .ml-stat-value { white-space: nowrap; overflow: hidden; }
.ml-hero .ml-tile-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #fef08a, #fbbf24);
    color: #7c2d12;
    font-size: 1.25rem;
}

/* ---------------- Stat cards (alternating colors) ---------------- */
.ml-stat {
    color: #ffffff;
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}
.ml-stat::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.10);
}
.ml-stat .ml-stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    font-size: 1.35rem;
    color: #ffffff;
}
.ml-stat .ml-stat-label {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}
.ml-stat .ml-stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}
.ml-stat .ml-stat-sub {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.08em;
}
.ml-stat-teal    { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.ml-stat-indigo  { background: linear-gradient(135deg, #818cf8, #4338ca); }
.ml-stat-amber   { background: linear-gradient(135deg, #fbbf24, #d97706); }
.ml-stat-sky     { background: linear-gradient(135deg, #38bdf8, #1d4ed8); }
.ml-stat-rose    { background: linear-gradient(135deg, #fb7185, #be123c); }
.ml-stat-red     { background: linear-gradient(135deg, #f87171, #b91c1c); }
.ml-stat-blue    { background: linear-gradient(135deg, #60a5fa, #1d4ed8); }
.ml-stat-green   { background: linear-gradient(135deg, #4ade80, #15803d); }
.ml-stat-pink    { background: linear-gradient(135deg, #f472b6, #be185d); }
.ml-stat-yellow  { background: linear-gradient(135deg, #fde047, #d97706); }

/* ---------------- Quick actions ---------------- */
.ml-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    border-radius: 14px;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    transition: transform .15s ease, box-shadow .15s ease;
}
.ml-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 22px -12px rgba(0, 0, 0, 0.35);
    color: #ffffff;
}
.ml-action i { font-size: 1.5rem; }
.ml-action-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.ml-action-indigo { background: linear-gradient(135deg, #818cf8, #4f46e5); }
.ml-action-amber  { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.ml-action-pink   { background: linear-gradient(135deg, #f472b6, #db2777); }
.ml-action-sky    { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.ml-action-lime   { background: linear-gradient(135deg, #a3e635, #16a34a); }

/* ---------------- Progress / goal card ---------------- */
.ml-progress {
    height: 12px;
    border-radius: 999px;
    background: #eef2f5;
    overflow: hidden;
}
.ml-progress .ml-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #14b8a6, #0ea5e9, #6366f1);
    transition: width .6s ease;
}
.ml-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.75rem;
    font-weight: 700;
}
.ml-chip-teal   { background: rgba(20, 184, 166, 0.12);  color: #0f766e; }
.ml-chip-indigo { background: rgba(99, 102, 241, 0.12);  color: #4f46e5; }
.ml-chip-pink   { background: rgba(236, 72, 153, 0.12);  color: #db2777; }
.ml-chip-amber  { background: rgba(245, 158, 11, 0.14);  color: #b45309; }

/* ---------------- Timetable ---------------- */
.ml-timetable {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}
.ml-timetable thead th {
    background: linear-gradient(135deg, #14b8a6, #0ea5e9);
    color: #fff;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 0;
    padding: 10px 12px;
    position: sticky;
    top: 0;
}
.ml-timetable thead th:first-child { border-top-left-radius: 12px; }
.ml-timetable thead th:last-child  { border-top-right-radius: 12px; }
.ml-timetable tbody td {
    border: 0;
    border-bottom: 1px solid #eef2f5;
    padding: 11px 12px;
    font-size: 0.86rem;
    color: #37474a;
    vertical-align: middle;
}
.ml-timetable tbody tr:nth-child(odd) td { background: #f7fbfd; }
.ml-timetable tbody tr:hover td { background: #e8f8f5; }
.ml-timetable .ml-tt-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.78rem;
    color: #fff;
    background: linear-gradient(135deg, #818cf8, #4f46e5);
}
.ml-timetable tbody tr:nth-child(3n+1) .ml-tt-num { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.ml-timetable tbody tr:nth-child(3n+2) .ml-tt-num { background: linear-gradient(135deg, #fb923c, #ea580c); }
.ml-timetable tbody tr:nth-child(3n+3) .ml-tt-num { background: linear-gradient(135deg, #f472b6, #db2777); }

/* ---------------- Misc ---------------- */
.btn-primary {
    background-color: #14b8a6 !important;
    border-color: #0d9488 !important;
}
.btn-primary:hover {
    background-color: #0d9488 !important;
    border-color: #0f766e !important;
}
.footer {
    background: #14171a !important;
}
.footer .text-muted,
.footer a,
.footer .text-dark {
    color: rgba(255, 255, 255, 0.7) !important;
}
.footer .text-primary {
    color: #45efe0 !important;
}
.scrollToTop {
    background: #14b8a6;
    color: #fff;
}
