/**
 * Keche ERP theme — full-app overrides (blue + purple, light workspace).
 * Matches Desktop Keche: data-color-theme="blue" + data-theme="light".
 * Requires html[data-hkits-theme="keche"] (variables in hkits-themes.css).
 * Scoped only to Keche — does not affect other themes.
 */

/* ── Base & layout shell ─────────────────────────────────────────────── */
html[data-hkits-theme="keche"] body.hkits-app,
html[data-hkits-theme="keche"] body.hkits-app .hkits-wrapper,
html[data-hkits-theme="keche"] body.hkits-app .hkits-main,
html[data-hkits-theme="keche"] body.hkits-app .hkits-main-inner,
html[data-hkits-theme="keche"] body.hkits-app .hkits-service-page {
    background: #f8fafc !important;
    color: #1e293b !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-main-inner a:not(.btn):not(.hkits-page-bar a) {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] body.hkits-app .hkits-main-inner a:not(.btn):hover {
    color: #7209b7 !important;
}

/* ── Top navigation (white sticky header like Keche ERP) ─────────────── */
html[data-hkits-theme="keche"] .hkits-topnav.navbar-default {
    background: #ffffff !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
}
html[data-hkits-theme="keche"] .hkits-topnav .navbar-brand,
html[data-hkits-theme="keche"] .hkits-topnav .hkits-facility-brand,
html[data-hkits-theme="keche"] .hkits-topnav .notify,
html[data-hkits-theme="keche"] .hkits-topnav .user-greeting-text,
html[data-hkits-theme="keche"] .hkits-topnav .dropdown-toggle,
html[data-hkits-theme="keche"] .hkits-topnav .navbar-text {
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .hkits-topnav .icon-bar {
    background-color: #1e293b !important;
}

/* ── Sidebar (white, Keche nav-link styling) ─────────────────────────── */
html[data-hkits-theme="keche"] .hkits-sidebar {
    background: #ffffff !important;
    border-right: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06) !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head:not(.active) {
    background: rgba(0, 0, 0, 0.02) !important;
    border-left-color: #4361ee !important;
    border-color: transparent !important;
    color: #64748b !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head:not(.active):hover,
html[data-hkits-theme="keche"] .hkits-menu-head:not(.active):focus {
    background: rgba(67, 97, 238, 0.08) !important;
    color: #4361ee !important;
    border-color: rgba(67, 97, 238, 0.15) !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head.active {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    border-left-color: #7209b7 !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3) !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head.active:hover,
html[data-hkits-theme="keche"] .hkits-menu-head.active:focus {
    background: linear-gradient(135deg, #3a56d4 0%, #5f0796 100%) !important;
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head.active .fa-fw,
html[data-hkits-theme="keche"] .hkits-menu-head.active .hkits-chevron {
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .hkits-menu-head:not(.active) .fa-fw {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .hkits-submenu {
    background: #ffffff !important;
    border-left-color: rgba(67, 97, 238, 0.25) !important;
}
html[data-hkits-theme="keche"] .hkits-submenu li a {
    color: #64748b !important;
    background: transparent !important;
}
html[data-hkits-theme="keche"] .hkits-submenu li a:hover {
    background: rgba(67, 97, 238, 0.08) !important;
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .hkits-submenu li a.active {
    background: #eef0fe !important;
    color: #3a56d4 !important;
    font-weight: 700;
}
html[data-hkits-theme="keche"] .hkits-submenu li a .hkits-submenu-icon {
    color: #7209b7 !important;
}
html[data-hkits-theme="keche"] .hkits-submenu li a:hover .hkits-submenu-icon,
html[data-hkits-theme="keche"] .hkits-submenu li a.active .hkits-submenu-icon {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .hkits-sidebar-footer a {
    color: #64748b !important;
}
html[data-hkits-theme="keche"] .hkits-sidebar-footer a:hover {
    color: #4361ee !important;
}

/* ── Page bar ────────────────────────────────────────────────────────── */
html[data-hkits-theme="keche"] .hkits-page-bar {
    background: linear-gradient(90deg, #eef0fe 0%, #f8fafc 100%) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .hkits-page-bar h1,
html[data-hkits-theme="keche"] .hkits-page-bar .hkits-page-heading,
html[data-hkits-theme="keche"] .hkits-page-bar .fa-fw {
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .hkits-page-bar a {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .hkits-page-bar a:hover {
    color: #7209b7 !important;
}

/* ── Panels, cards & dashboard ───────────────────────────────────────── */
html[data-hkits-theme="keche"] .panel,
html[data-hkits-theme="keche"] .hkits-dash-card,
html[data-hkits-theme="keche"] .hkits-dash-panel,
html[data-hkits-theme="keche"] .hkits-pcard {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05) !important;
}
html[data-hkits-theme="keche"] .panel-default > .panel-heading,
html[data-hkits-theme="keche"] .hkits-dash-v2 .panel-default > .panel-heading,
html[data-hkits-theme="keche"] .hkits-dash-card-head {
    background: #f8fafc !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .panel-default > .panel-heading .fa,
html[data-hkits-theme="keche"] .hkits-dash-v2 .panel-default > .panel-heading .fa,
html[data-hkits-theme="keche"] .hkits-dash-card-head .fa {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .panel-primary > .panel-heading,
html[data-hkits-theme="keche"] .hkits-dash-v2 .panel-primary > .panel-heading {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    border-color: #3a56d4 !important;
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .panel-primary > .panel-heading .fa,
html[data-hkits-theme="keche"] .hkits-dash-v2 .panel-primary > .panel-heading .fa {
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .panel-body,
html[data-hkits-theme="keche"] .hkits-dash-v2 .panel-body,
html[data-hkits-theme="keche"] .hkits-dash-card-body,
html[data-hkits-theme="keche"] .hkits-pcard-body,
html[data-hkits-theme="keche"] body.hkits-app .hkits-main-inner,
html[data-hkits-theme="keche"] body.hkits-app .modal-body {
    background: #ffffff !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .hkits-dash-inner-head {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    border-bottom-color: #3a56d4 !important;
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .hkits-dash-inner-head .fa {
    color: #ffffff !important;
}

/* Dashboard stat cards */
html[data-hkits-theme="keche"] .hkits-stat-label,
html[data-hkits-theme="keche"] .hkits-top-rev-head,
html[data-hkits-theme="keche"] .hkits-top-rev-rank,
html[data-hkits-theme="keche"] .hkits-top-rev-amt,
html[data-hkits-theme="keche"] .hkits-income-dept-head {
    color: #64748b !important;
}
html[data-hkits-theme="keche"] .hkits-stat-value,
html[data-hkits-theme="keche"] .hkits-stat-change,
html[data-hkits-theme="keche"] .hkits-top-rev-name,
html[data-hkits-theme="keche"] .hkits-income-dept-name,
html[data-hkits-theme="keche"] .hkits-income-dept-amt,
html[data-hkits-theme="keche"] .hkits-pcard-meta .pull-right,
html[data-hkits-theme="keche"] .hkits-pcard-name {
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .hkits-dash-stat-card .hkits-stat-icon,
html[data-hkits-theme="keche"] .hkits-stat-icon {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    color: #ffffff !important;
}
html[data-hkits-theme="keche"] .hkits-perf-mini {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    border-color: #3a56d4 !important;
    color: #ffffff !important;
}

/* ── Tables (lists, dashboard, sales/billing) ────────────────────────── */
html[data-hkits-theme="keche"] body.hkits-app .table,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-table {
    color: #1e293b !important;
    background: #ffffff !important;
}

html[data-hkits-theme="keche"] body.hkits-app .table > thead > tr > th,
html[data-hkits-theme="keche"] body.hkits-app .table:not(.hkits-dash-table) > thead > tr > th,
html[data-hkits-theme="keche"] body.hkits-app .hkits-items-table thead th,
html[data-hkits-theme="keche"] body.hkits-app .hkits-cw-records-table thead th,
html[data-hkits-theme="keche"] body.hkits-app .hkits-pharmacy-workspace .hkits-ph-ws-table th,
html[data-hkits-theme="keche"] body.hkits-app .hkits-billing-queue-table thead th,
html[data-hkits-theme="keche"] body.hkits-app table thead th {
    background: rgba(67, 97, 238, 0.1) !important;
    color: #1e293b !important;
    border-color: rgba(67, 97, 238, 0.2) !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table > thead > tr:not(:first-child) > th {
    background: #eef0fe !important;
    color: #1e293b !important;
    border-color: rgba(67, 97, 238, 0.15) !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table > thead > tr:first-child > th,
html[data-hkits-theme="keche"] body.hkits-app .hkits-pharm-form .hkits-pharm-items-table thead th {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    color: #ffffff !important;
    border-color: #3a56d4 !important;
}
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table > thead > tr:first-child > th .fa {
    color: #ffffff !important;
}

html[data-hkits-theme="keche"] body.hkits-app .table > tbody > tr > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table tbody td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-cw-records-table tbody td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-billing-queue-table tbody td {
    background: #ffffff !important;
    color: #1e293b !important;
    border-color: rgba(0, 0, 0, 0.06) !important;
}

html[data-hkits-theme="keche"] body.hkits-app .table-striped > tbody > tr:nth-of-type(odd) > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table tbody tr:nth-of-type(odd) > td {
    background: #f8fafc !important;
}

html[data-hkits-theme="keche"] body.hkits-app .table-hover > tbody > tr:hover > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-table tbody tr:hover > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-cw-records-table tbody tr:hover > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-billing-queue-table tbody tr:hover td {
    background: rgba(67, 97, 238, 0.05) !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-table .list-name,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-col-toggle,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-collapse-child td {
    color: #1e293b !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-collapse-parent > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-collapse-child > td,
html[data-hkits-theme="keche"] body.hkits-app .hkits-dash-v2 .hkits-dash-subtotal-row > td {
    background: #f1f5f9 !important;
    color: #1e293b !important;
}

/* ── Forms & filters (sales, billing, records) ───────────────────────── */
html[data-hkits-theme="keche"] body.hkits-app label,
html[data-hkits-theme="keche"] body.hkits-app .control-label,
html[data-hkits-theme="keche"] body.hkits-app .help-block,
html[data-hkits-theme="keche"] body.hkits-app label.caption,
html[data-hkits-theme="keche"] body.hkits-app .caption {
    color: #1e293b !important;
}

html[data-hkits-theme="keche"] body.hkits-app input.form-control,
html[data-hkits-theme="keche"] body.hkits-app textarea.form-control,
html[data-hkits-theme="keche"] body.hkits-app select.form-control,
html[data-hkits-theme="keche"] body.hkits-app select:not(.btn):not([multiple]) {
    background-color: #ffffff !important;
    border: 2px solid rgba(0, 0, 0, 0.1) !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] body.hkits-app input.form-control:focus,
html[data-hkits-theme="keche"] body.hkits-app textarea.form-control:focus,
html[data-hkits-theme="keche"] body.hkits-app select.form-control:focus {
    border-color: #4361ee !important;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.12) !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-filter-panel .hkits-filter-body,
html[data-hkits-theme="keche"] body.hkits-app .hkits-filter-panel--table .hkits-filter-body {
    background: #f8fafc !important;
    color: #1e293b !important;
}

html[data-hkits-theme="keche"] body.hkits-app .hkits-billing-overlay-box,
html[data-hkits-theme="keche"] body.hkits-app .well {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
}

/* ── Buttons & tabs ──────────────────────────────────────────────────── */
html[data-hkits-theme="keche"] .btn-primary,
html[data-hkits-theme="keche"] .hkits-btn-primary {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    border-color: #3a56d4 !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px rgba(67, 97, 238, 0.3) !important;
}
html[data-hkits-theme="keche"] .btn-primary:hover,
html[data-hkits-theme="keche"] .btn-primary:focus,
html[data-hkits-theme="keche"] .hkits-btn-primary:hover {
    background: linear-gradient(135deg, #3a56d4 0%, #5f0796 100%) !important;
    border-color: #3a56d4 !important;
    color: #ffffff !important;
}

html[data-hkits-theme="keche"] .nav-tabs > li > a {
    color: #64748b !important;
}
html[data-hkits-theme="keche"] .nav-tabs > li > a:hover {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .nav-tabs > li.active > a,
html[data-hkits-theme="keche"] .nav-tabs > li.active > a:hover,
html[data-hkits-theme="keche"] .hkits-file-tabs > li.active > a,
html[data-hkits-theme="keche"] .hkits-file-tabs > li.active > a:hover {
    color: #4361ee !important;
    border-top-color: #7209b7 !important;
}

html[data-hkits-theme="keche"] body.hkits-app .text-primary {
    color: #4361ee !important;
}

/* ── Modals ──────────────────────────────────────────────────────────── */
html[data-hkits-theme="keche"] .modal-content {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .modal-header {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(114, 9, 183, 0.1) 100%) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .modal-title,
html[data-hkits-theme="keche"] .modal-title .fa {
    color: #1e293b !important;
}
html[data-hkits-theme="keche"] .modal-title .fa {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] .modal-footer {
    background: #f8fafc !important;
    border-top-color: rgba(0, 0, 0, 0.08) !important;
}

/* ── Misc layout overrides (prevent bleed from other theme rules) ───── */
html[data-hkits-theme="keche"] body.hkits-app .hkits-empty-state {
    color: #64748b !important;
}
html[data-hkits-theme="keche"] body.hkits-app .hkits-view-toggle-btn {
    color: #4361ee !important;
}
html[data-hkits-theme="keche"] body.hkits-app .hkits-view-toggle-btn.active {
    background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%) !important;
    color: #ffffff !important;
}
