/* Kukudku Business - application styles (Bootstrap 5 based)
   Theme of the source application (templates/base.html + static/assets/css/style.css + includes/master.html):
   white surfaces, light grey sidebar (#f7f7fa) with sky-blue accent (#18aefa), orange action buttons (#FFBC53),
   navy / orange Master Dashboard cards (#0f2c59 / #ff9f1c), Poppins font.
   Change the colours in :root only - every rule below uses these tokens. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('../lib/poppins/poppins-regular.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('../lib/poppins/poppins-medium.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600 700; font-display: swap; src: url('../lib/poppins/poppins-bold.woff') format('woff'); }

:root {
    --kk-white: #ffffff;
    --kk-page: #ffffff;           /* page background                     */
    --kk-panel: #f7f7fa;          /* header-left, sidebar                */
    --kk-border: #ececf5;         /* card / sidebar borders              */
    --kk-line: #f1f3f5;           /* table / list lines                  */
    --kk-accent: #18aefa;         /* sky blue: links, active menu        */
    --kk-accent-soft: rgba(24, 174, 250, .12);
    --kk-orange: #ffbc53;         /* primary buttons (source btn-primary) */
    --kk-orange-dark: #f0a43a;
    --kk-navy: #0f2c59;           /* Master Dashboard headers            */
    --kk-brand-orange: #ff9f1c;   /* Master Dashboard underline / icons  */
    --kk-bg-light: #f7f9fc;
    --kk-thead: #cff4fc;          /* source table-info header row        */
    --kk-text: #333333;
    --kk-text-dark: #2d3748;
    --kk-muted: #6f6f6f;
    --kk-menu-title: #9e9e9e;

    --kk-sidebar-width: 210px;
    --kk-header-height: 60px;
    --kk-radius: .4rem;
    --kk-shadow: 0 1px 3px 0 rgba(0, 0, 0, .03);

    /* Bootstrap variables */
    --bs-body-font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --bs-primary: #18aefa;
    --bs-primary-rgb: 24, 174, 250;
    --bs-link-color: #18aefa;
    --bs-link-color-rgb: 24, 174, 250;
    --bs-link-hover-color: #0f8ed0;
    --bs-link-hover-color-rgb: 15, 142, 208;
    --bs-body-color: #333333;
    --bs-body-bg: #ffffff;
    --bs-border-color: #dddddd;
    --bs-secondary-color: #6f6f6f;
    --bs-focus-ring-color: rgba(255, 188, 83, .35);
}

body { background: var(--kk-page); color: var(--kk-text); font-family: var(--bs-body-font-family); font-size: .9rem; }
h1, h2, h3, h4, h5, h6, .h4 { font-family: var(--bs-body-font-family); color: var(--kk-text); }
.text-muted { color: var(--kk-muted) !important; }
.text-primary { color: var(--kk-accent) !important; }

/* ---------- buttons (source: btn-primary is orange) ---------- */
.btn { border-radius: .3rem; }
.btn-primary {
    --bs-btn-bg: var(--kk-orange); --bs-btn-border-color: var(--kk-orange); --bs-btn-color: #fff;
    --bs-btn-hover-bg: var(--kk-orange-dark); --bs-btn-hover-border-color: var(--kk-orange-dark); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #e0952f; --bs-btn-active-border-color: #e0952f; --bs-btn-active-color: #fff;
    --bs-btn-disabled-bg: #ffd699; --bs-btn-disabled-border-color: #ffd699; --bs-btn-disabled-color: #fff;
    --bs-btn-focus-shadow-rgb: 255, 188, 83;
}
.btn-outline-primary {
    --bs-btn-color: var(--kk-accent); --bs-btn-border-color: var(--kk-accent); --bs-btn-bg: var(--kk-white);
    --bs-btn-hover-bg: var(--kk-accent); --bs-btn-hover-border-color: var(--kk-accent); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #0f8ed0; --bs-btn-active-border-color: #0f8ed0; --bs-btn-active-color: #fff;
    --bs-btn-focus-shadow-rgb: 24, 174, 250;
}
.btn-outline-secondary { --bs-btn-bg: var(--kk-white); }
.btn-outline-danger { --bs-btn-bg: var(--kk-white); }

/* ---------- header (source .header) ---------- */
.kk-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1030; height: var(--kk-header-height);
    display: flex; align-items: center; background: var(--kk-white); border-bottom: 1px solid #f3f3f4;
}
.kk-header-left {
    width: var(--kk-sidebar-width); height: 100%; flex-shrink: 0; display: flex; align-items: center; padding: 0 14px;
    background: var(--kk-panel); border-right: 1px solid var(--kk-border); border-bottom: 1px solid #efefef;
}
.kk-brand { display: flex; align-items: center; gap: 6px; text-decoration: none; color: var(--kk-accent); font-size: 1.55rem; font-weight: 500; }
.kk-brand img { width: 36px; height: 36px; }
.kk-brand:hover { color: var(--kk-accent); }
.kk-toggle { border: 0; background: transparent; color: var(--kk-accent); font-size: 1.6rem; padding: 0 16px; line-height: 1; }
.kk-welcome { font-size: 1.3rem; margin: 0; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-welcome strong { font-weight: 700; }
.kk-user-menu { margin-left: auto; display: flex; align-items: center; height: 100%; padding-right: 10px; }
.kk-user-menu > .kk-icon-btn, .kk-user-menu > .dropdown > .kk-icon-btn {
    border: 0; background: transparent; color: #a0a0a0; height: var(--kk-header-height); padding: 0 14px; font-size: 1.35rem;
}
.kk-user-menu .kk-icon-btn:hover, .kk-user-menu .kk-icon-btn:focus { color: var(--kk-accent); background: rgba(232, 232, 232, .2); }
.kk-avatar { width: 31px; height: 31px; border-radius: 50%; }
.kk-user-menu .dropdown-menu { min-width: 200px; padding: 0; overflow: hidden; }
.kk-user-menu .dropdown-item { padding: 10px 15px; border-top: 1px solid #e3e3e3; }
.kk-user-menu .dropdown-item:hover { color: var(--kk-orange); background: transparent; }
.kk-user-header { display: flex; align-items: center; gap: 10px; padding: 10px 15px; }
@media (max-width: 991.98px) {
    .kk-header-left { width: auto; border-right: 0; background: var(--kk-white); padding: 0 6px 0 10px; }
    .kk-toggle { padding: 0 8px; }
    .kk-user-menu { padding-right: 4px; }
    .kk-user-menu > .kk-icon-btn, .kk-user-menu > .dropdown > .kk-icon-btn { padding: 0 8px; font-size: 1.2rem; }
}
@media (max-width: 575.98px) {
    .kk-brand { font-size: 0; gap: 0; }   /* logo only on phones */
}

/* ---------- sidebar (source .sidebar, compact) ---------- */
.kk-sidebar {
    background: var(--kk-panel); border-right: 1px solid var(--kk-border); color: var(--kk-muted);
}
@media (min-width: 992px) {
    .kk-sidebar {
        position: fixed; top: var(--kk-header-height); bottom: 0; left: 0; width: var(--kk-sidebar-width);
        overflow-y: auto; z-index: 1020; transition: margin-left .2s ease-in-out;
    }
    .kk-main { margin-left: var(--kk-sidebar-width); transition: margin-left .2s ease-in-out; }
    body.kk-mini .kk-sidebar { margin-left: calc(-1 * var(--kk-sidebar-width)); }
    body.kk-mini .kk-main { margin-left: 0; }
}
.kk-sidebar.offcanvas-lg { background-color: var(--kk-panel) !important; }
.kk-sidebar .offcanvas-header { background: var(--kk-panel); border-bottom: 1px solid var(--kk-border); }
.kk-menu { list-style: none; margin: 0; padding: 10px 12px; font-size: 13px; }
.kk-menu ul { list-style: none; margin: 0; padding: 0; }
.kk-menu .kk-menu-title { color: var(--kk-menu-title); font-size: 11px; padding: 8px 6px 4px; }
.kk-menu a, .kk-menu .kk-menu-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; color: var(--kk-muted); text-decoration: none;
    padding: 8px 10px; background: transparent; border: 0; text-align: left; line-height: 1.2; position: relative;
}
.kk-menu > li > a:hover, .kk-menu > li > .kk-menu-toggle:hover { background: var(--kk-white); color: var(--kk-accent); }
.kk-menu i.bi { width: 18px; font-size: 14px; }
.kk-menu .kk-arrow { margin-left: auto; font-size: 11px; transition: transform .15s; }
.kk-menu .kk-menu-toggle[aria-expanded="true"] .kk-arrow { transform: rotate(90deg); }
.kk-menu ul a { padding: 6px 10px 6px 38px; font-size: 12px; }
.kk-menu ul a:hover { color: var(--kk-accent); }
.kk-menu li.active > a, .kk-menu li.active > .kk-menu-toggle { background: var(--kk-white); color: var(--kk-accent); }
.kk-menu > li.active > a::before, .kk-menu > li.active > .kk-menu-toggle::before {
    content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 100%; background: var(--kk-accent);
}
.kk-menu ul a.active { color: var(--kk-accent); font-weight: 500; }
.kk-menu .kk-not-migrated { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 38px; font-size: 12px; color: #b0b0b0; cursor: default; }
.kk-menu .kk-nm-icon { margin-left: auto; font-size: 10px; color: #d0a650; width: auto !important; }
.kk-sidebar::-webkit-scrollbar { width: 6px; }
.kk-sidebar::-webkit-scrollbar-thumb { background: #dcdce6; border-radius: 3px; }

/* ---------- layout ---------- */
.kk-main { min-width: 0; padding-top: var(--kk-header-height); min-height: 100vh; display: flex; flex-direction: column; }
.kk-content { flex: 1 0 auto; padding: 1.5rem 1.5rem .5rem; }
.kk-footer { text-align: center; color: var(--kk-muted); font-size: .8rem; padding: .75rem 0; }
.kk-anonymous {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
    /* light-to-dark grey gradient behind the login box (also sign-out / access-denied cards) */
    background: #9aa1aa linear-gradient(135deg, #f4f5f7 0%, #d5d9de 40%, #a3a9b1 75%, #6c737c 100%) fixed;
}

.page-title {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem;
    margin-bottom: 1rem;
}
.page-title h1 { font-size: 1.6rem; margin: 0; font-weight: 600; color: #333; }
.page-title h1 i { color: var(--kk-accent); }
.kk-breadcrumb { color: #6c757d; font-size: .9rem; margin-bottom: 1rem; }

/* ---------- cards & panels ---------- */
.card { border: 1px solid var(--kk-border); border-radius: var(--kk-radius); box-shadow: var(--kk-shadow); background: var(--kk-white); }
.card-header { background: var(--kk-white); color: #333; font-weight: 600; border-bottom: 1px solid var(--kk-border); }
.card-header:first-child { border-radius: calc(var(--kk-radius) - 1px) calc(var(--kk-radius) - 1px) 0 0; }
.kk-filter {
    background: var(--kk-white); border: 1px solid var(--kk-border); border-radius: var(--kk-radius);
    padding: .75rem 1rem; margin-bottom: 1rem; box-shadow: var(--kk-shadow);
}

/* ---------- tables (data grids): sleek border, light green row hover ---------- */
.table-responsive { border-radius: 10px; }
.card > .table-responsive, .card > div > .table-responsive { border-radius: inherit; }
.table-kk {
    background: var(--kk-white); margin-bottom: 0; border-collapse: separate; border-spacing: 0;
    --bs-table-hover-bg: #e9f9ee; --bs-table-border-color: #e8edf3; --bs-table-striped-bg: #fafcfe;
}
.table-kk thead th {
    background: linear-gradient(180deg, #f3f8fc 0%, #e6f2fa 100%); color: #2d3e50; font-size: .78rem; font-weight: 600;
    letter-spacing: .02em; white-space: nowrap; border-bottom: 2px solid #cfe3f1; padding-top: .6rem; padding-bottom: .6rem;
}
.table-kk td, .table-kk th { vertical-align: middle; border-color: #eef2f6; }
.table-kk tbody td { border-bottom: 1px solid #eef2f6; }
.table-kk > :not(caption) > tr > :first-child { padding-left: 1rem; }
.table-kk > :not(caption) > tr > :last-child { padding-right: 1rem; }
.table-kk tbody tr { transition: background-color .15s ease, box-shadow .15s ease; }
.table-kk tbody tr:hover > * { background-color: #e9f9ee !important; }
.table-kk tbody tr:hover > :first-child { box-shadow: inset 3px 0 0 #34c26f; }
.table-kk tfoot td { font-weight: 600; background: #f6f8fb; color: #2d3e50; border-top: 2px solid #dfe7ef; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #e9f9ee; --bs-table-color-state: inherit; }
/* any table inside a card gets the sleek frame */
.card .table-kk { border: 0; }
.card:has(> .table-responsive), .card:has(> div > .table-responsive) { border: 1px solid #e3e9f0; box-shadow: 0 2px 10px rgba(15, 44, 89, .05); overflow: hidden; }
.table:not(.table-kk).table-hover > tbody > tr:hover > * { background-color: #e9f9ee; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- dashboard tiles ---------- */
.kk-stat {
    border-radius: var(--kk-radius); padding: 1rem 1.1rem; background: var(--kk-white); height: 100%;
    border: 1px solid var(--kk-border); border-top: 4px solid var(--kk-accent); box-shadow: var(--kk-shadow);
    transition: box-shadow .15s ease, transform .15s ease;
}
a.kk-stat:hover { box-shadow: 0 4px 14px rgba(24, 174, 250, .18); transform: translateY(-1px); }
.kk-stat .label { color: var(--kk-muted); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kk-stat .value { font-size: 1.45rem; font-weight: 600; color: #333; }

/* Home page widgets (source .bg-one/.bg-two/.bg-three/.bg-eight/.bg-four + .db-icon) */
.kk-widget { border: 1px solid; border-radius: 30px 0; padding: 1.25rem; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.kk-widget .kk-db-icon { width: 60px; height: 60px; border-radius: 10px; color: #fff; font-size: 25px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kk-widget .kk-db-info { text-align: right; }
.kk-widget .kk-db-info h3 { font-size: 28px; font-weight: 600; color: #333; margin: 0; }
.kk-widget .kk-db-info h6 { margin: 0; font-weight: 400; font-size: 15px; color: #333; }
.kk-widget .kk-db-info a { font-size: 1.5rem; color: var(--kk-accent); text-decoration: none; }
.kk-bg-one { background-color: rgb(253 187 56 / .5); border-color: #fdbb38; }
.kk-bg-one .kk-db-icon { background-color: #fdbb38; }
.kk-bg-two, .kk-bg-eight { background-color: rgb(25 175 251 / .2); border-color: #19affb; }
.kk-bg-two .kk-db-icon, .kk-bg-eight .kk-db-icon { background-color: #19affb; }
.kk-bg-three { background-color: rgb(244 104 65 / .2); border-color: #f46841; }
.kk-bg-three .kk-db-icon { background-color: #f46841; }
.kk-bg-four { background-color: rgb(110 107 250 / .2); border-color: #6e6bfa; border: 1px solid #6e6bfa; border-radius: 30px 0; }

/* ---------- forms ---------- */
.form-label { font-weight: 500; font-size: .85rem; margin-bottom: .2rem; color: #333; }
.form-control, .form-select { border-color: #ddd; background-color: var(--kk-white); }
.form-control:focus, .form-select:focus { border-color: var(--kk-orange); box-shadow: 0 0 0 .2rem rgba(255, 188, 83, .25); }
.form-check-input:checked { background-color: var(--kk-accent); border-color: var(--kk-accent); }
.form-check-input:focus { border-color: var(--kk-accent); box-shadow: 0 0 0 .2rem rgba(24, 174, 250, .25); }
.field-validation-error, .kk-summary ul { color: #b42318; font-size: .82rem; }
.kk-summary ul { margin-bottom: .5rem; padding-left: 1.2rem; }
.input-validation-error { border-color: #dc3545; }

/* ---------- misc Bootstrap components ---------- */
.badge.bg-primary, .text-bg-primary { background-color: var(--kk-accent) !important; color: #fff !important; }
.dropdown-item:active, .dropdown-item.active { background-color: var(--kk-accent); }
.page-link { color: var(--kk-accent); }
.active > .page-link, .page-link.active { background-color: var(--kk-accent); border-color: var(--kk-accent); }
.nav-tabs .nav-link { color: var(--kk-accent); }
.nav-pills .nav-link.active { background-color: var(--kk-accent); }

/* message cards (sign out, access denied, error) */
.kk-login { width: 100%; max-width: 420px; border-top: 4px solid var(--kk-accent); box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .1); }

/* ---------- sign-in (source .login-wrapper / .loginbox) ---------- */
.kk-login-wrapper { width: 100%; }
.kk-loginbox {
    display: flex; margin: 1.875rem auto; max-width: 900px; min-height: 560px; width: 100%; background: #f8f9fa;
    border-radius: 6px; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175); overflow: hidden;
}
.kk-login-left {
    width: 50%; display: flex; align-items: center; justify-content: center; padding: 60px;
    background: #6b4a33 url('../img/login-bg.jpg') no-repeat left top; background-size: cover;
}
.kk-login-left img { max-width: 270px; width: 100%; }
.kk-login-right { width: 50%; display: flex; align-items: center; justify-content: center; padding: 40px 45px; }
.kk-login-right-wrap { width: 100%; max-width: 360px; }
.kk-login-right h1 { font-size: 28px; font-weight: 500; margin-bottom: 5px; text-align: center; color: #212529; }
.kk-account-subtitle { color: #4c4c4c; font-size: 17px; margin-bottom: 1.875rem; text-align: center; }
.kk-login-input { height: 45px; background-color: #e9ecef; border: 1px solid #dee2e6; font-size: 16px; }
.kk-login-input:focus { background-color: #fff; border-color: #86b7fe; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); }
.kk-eye { position: absolute; top: 22px; right: 10px; transform: translateY(-50%); border: 0; background: transparent; padding: 0 4px; cursor: pointer; font-size: 15px; line-height: 1; }
.kk-login-btn { height: 43px; background: #0d6efd; border-color: #0d6efd; color: #fff; font-size: 17px; }
.kk-login-btn:hover, .kk-login-btn:focus { background: #0b5ed7; border-color: #0a58ca; color: #fff; }
.kk-forgotpass a { color: #a0a0a0; text-decoration: none; font-size: 17px; }
.kk-forgotpass a:hover { color: #333; }
.kk-login-errors.validation-summary-valid { display: none; }
.kk-login-errors ul { margin: 0; padding-left: 1rem; }
@media (max-width: 767.98px) {
    .kk-login-left { display: none; }
    .kk-loginbox { max-width: 450px; min-height: unset; }
    .kk-login-right { width: 100%; padding: 1.875rem; }
}

/* ---------- Master Dashboard (source includes/master.html) ---------- */
.kk-master { background: var(--kk-bg-light); margin: -1.5rem -1.5rem 0; padding: 1.5rem; overflow-x: clip; min-height: calc(100vh - var(--kk-header-height) - 3rem); }
.kk-section-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(15, 44, 89, .05); border: 1px solid #eef2f5; margin-bottom: 25px; }
.kk-section-header {
    background: var(--kk-navy); color: #fff; font-size: 15px; font-weight: 700; padding: 14px 20px; text-transform: uppercase;
    letter-spacing: .5px; display: flex; align-items: center; gap: 12px; border-bottom: 3px solid var(--kk-brand-orange);
    border-top-left-radius: 11px; border-top-right-radius: 11px;
}
.kk-section-header i { font-size: 18px; color: var(--kk-brand-orange); }
.kk-section-header .kk-calc-btn { margin-left: auto; border: 0; background: transparent; color: var(--kk-brand-orange); font-size: 18px; padding: 0; }
.kk-section-header .kk-calc-btn:hover { transform: scale(1.2); }
.kk-brand-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.kk-brand-cols { display: flex; flex-wrap: wrap; }
.kk-brand-cols > .kk-brand-list { width: 50%; }
.kk-brand-cols > .kk-brand-list + .kk-brand-list { border-left: 1px solid #eef2f5; }
@media (max-width: 575.98px) { .kk-brand-cols > .kk-brand-list { width: 100%; } .kk-brand-cols > .kk-brand-list + .kk-brand-list { border-left: 0; } }
.kk-brand-item, .kk-brand-dropdown {
    display: flex; align-items: center; width: 100%; padding: 12px 20px; border: 0; border-bottom: 1px solid var(--kk-line);
    background: #fff; color: var(--kk-text-dark); font-weight: 500; font-size: 14px; text-decoration: none; text-align: left;
    transition: all .25s cubic-bezier(.25, .8, .25, 1);
}
.kk-brand-item:hover, .kk-brand-dropdown:hover, .kk-brand-dropdown[aria-expanded="true"] { background: rgba(255, 159, 28, .07); color: var(--kk-navy); }
.kk-brand-item i.bi, .kk-brand-dropdown i.bi { font-size: 16px; color: var(--kk-navy); width: 26px; text-align: center; margin-right: 12px; }
.kk-brand-item:hover i.bi, .kk-brand-dropdown:hover i.bi { color: var(--kk-brand-orange); }
.kk-brand-dropdown::after { margin-left: auto; color: #cbd5e1; }
.kk-brand-item.kk-disabled { color: #a0aec0; cursor: default; }
.kk-brand-item.kk-disabled:hover { background: #fff; color: #a0aec0; }
.kk-brand-item.kk-disabled i.bi { color: #cbd5e1; }
.kk-not-migrated-badge { margin-left: auto; font-size: 10px; font-weight: 500; color: #8a6d3b; background: #fff3cd; border: 1px solid #ffe69c; border-radius: 10px; padding: 1px 7px; white-space: nowrap; }

/* fly-out menus: open on mouse over to the right of the entry with a left-to-right slide; nested groups fly out again */
.kk-fly { position: relative; width: 100%; }
.kk-fly-arrow { margin-left: auto; font-size: 11px; color: #cbd5e1; transition: transform .2s ease, color .2s ease; width: auto !important; margin-right: 0 !important; }
.kk-fly:hover > .kk-fly-toggle .kk-fly-arrow, .kk-fly.open > .kk-fly-toggle .kk-fly-arrow { color: var(--kk-brand-orange); transform: translateX(3px); }
.kk-fly:hover > .kk-brand-dropdown, .kk-fly.open > .kk-brand-dropdown { background: rgba(255, 159, 28, .08); color: var(--kk-navy); }
.kk-fly:hover > .kk-brand-dropdown i.bi:first-child, .kk-fly.open > .kk-brand-dropdown i.bi:first-child { color: var(--kk-brand-orange); }
.kk-fly-menu {
    position: absolute; top: -6px; left: 100%; z-index: 1065; min-width: 250px; max-width: 320px; padding: 8px;
    margin-left: 6px; background: #fff; border: 1px solid #e6ebf2; border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 44, 89, .18), 0 2px 6px rgba(15, 44, 89, .06);
    /* display:none (not just hidden) so closed fly-outs of the right-hand cards don't widen the page (horizontal scroll bar) */
    display: none;
}
/* invisible bridge so the pointer can travel from the entry into the fly-out without closing it */
.kk-fly-menu::before { content: ""; position: absolute; top: 0; bottom: 0; left: -14px; width: 14px; }
/* the slide uses an animation (not a resting clip-path / transform) so nested fly-outs are not clipped once open */
@keyframes kk-fly-in { from { clip-path: inset(0 100% 0 0 round 12px); transform: translateX(-10px); opacity: .2; } to { clip-path: inset(0 0 0 0 round 12px); transform: translateX(0); opacity: 1; } }
@keyframes kk-fly-in-left { from { clip-path: inset(0 0 0 100% round 12px); transform: translateX(10px); opacity: .2; } to { clip-path: inset(0 0 0 0 round 12px); transform: translateX(0); opacity: 1; } }
.kk-fly:hover > .kk-fly-menu, .kk-fly.open > .kk-fly-menu {
    display: block; animation: kk-fly-in .3s cubic-bezier(.22, .8, .3, 1);
}
.kk-fly:hover, .kk-fly.open { z-index: 1065; }
.kk-fly.kk-fly-left > .kk-fly-menu { left: auto; right: 100%; margin-left: 0; margin-right: 6px; }
.kk-fly.kk-fly-left > .kk-fly-menu::before { left: auto; right: -14px; }
.kk-fly.kk-fly-left:hover > .kk-fly-menu, .kk-fly.kk-fly-left.open > .kk-fly-menu { animation-name: kk-fly-in-left; }
@media (prefers-reduced-motion: reduce) { .kk-fly-menu { animation: none !important; } }
.kk-fly-head { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a94a6; padding: 4px 12px 6px; border-bottom: 1px solid var(--kk-line); margin-bottom: 4px; }
.kk-fly-menu .dropdown-item {
    border-radius: 8px; padding: 9px 12px; font-weight: 500; font-size: 13.5px; color: var(--kk-text-dark);
    display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; text-align: left;
    transition: background-color .15s ease, padding-left .15s ease, color .15s ease;
}
.kk-fly-menu .dropdown-item i.bi:first-child { color: var(--kk-navy); width: 18px; text-align: center; }
.kk-fly-menu .dropdown-item:hover, .kk-fly-sub:hover > .dropdown-item, .kk-fly-sub.open > .dropdown-item { background: rgba(255, 159, 28, .1); color: var(--kk-navy); padding-left: 16px; }
.kk-fly-menu .dropdown-item:hover i.bi:first-child { color: var(--kk-brand-orange); }
.kk-fly-menu .dropdown-item.kk-danger { color: #dc3545; font-weight: 700; }
.kk-fly-menu .dropdown-item.kk-disabled { color: #a0aec0; cursor: default; padding-left: 12px; background: transparent; }
.kk-fly-menu .dropdown-item.kk-disabled i.bi:first-child { color: #cbd5e1; }
.kk-fly-sub > .kk-fly-menu { top: -9px; }
@media (hover: none), (max-width: 767.98px) {
    /* touch / small screens: the menu opens below the entry on tap */
    .kk-fly-menu { position: static; margin: 0 8px 8px 46px; max-width: none; box-shadow: none; display: none; visibility: visible; opacity: 1; animation: none !important; transition: none; }
    .kk-fly:hover > .kk-fly-menu { display: none; }
    .kk-fly.open > .kk-fly-menu { display: block; }
    .kk-fly-menu::before { display: none; }
}

/* section header gradients (one colour family per card) */
.kk-section-header { position: relative; overflow: hidden; }
.kk-section-header::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 45%); pointer-events: none; }
.kk-theme-0 .kk-section-header { background: linear-gradient(135deg, #0f4c81 0%, #1b74c5 55%, #27a2e8 100%); border-bottom-color: #7fd3ff; }
.kk-theme-1 .kk-section-header { background: linear-gradient(135deg, #b4380a 0%, #f06a1d 55%, #ffa34d 100%); border-bottom-color: #ffd29a; }
.kk-theme-2 .kk-section-header { background: linear-gradient(135deg, #0b6e4f 0%, #12a06e 55%, #3dd598 100%); border-bottom-color: #a7f3d0; }
.kk-theme-3 .kk-section-header { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #a78bfa 100%); border-bottom-color: #ddd6fe; }
.kk-theme-4 .kk-section-header { background: linear-gradient(135deg, #9d174d 0%, #db2777 55%, #f472b6 100%); border-bottom-color: #fbcfe8; }
.kk-theme-5 .kk-section-header { background: linear-gradient(135deg, #134e4a 0%, #0f766e 55%, #2dd4bf 100%); border-bottom-color: #99f6e4; }
.kk-section-header i, .kk-section-header .kk-calc-btn { color: #fff; }
.kk-section-header > i.bi { background: rgba(255, 255, 255, .18); border-radius: 8px; padding: 4px 6px; font-size: 16px; }

/* Flexible Rate Calculator */
.kk-calc .modal-header { background: var(--kk-navy); color: #fff; border-bottom: 3px solid var(--kk-brand-orange); }
.kk-calc .modal-body { background: var(--kk-bg-light); }
.kk-calc-card { border-radius: 8px; padding: .75rem; height: 100%; box-shadow: 0 2px 8px rgba(0, 0, 0, .05); }
.kk-calc-live { background: #fff9db; border-left: 4px solid #fcc419; }
.kk-calc-with { background: #ebfbee; border-left: 4px solid #40c057; }
.kk-calc-without { background: #fff5f5; border-left: 4px solid #fa5252; }

/* ---------- header modals ---------- */
.kk-credit-red { color: #dc3545; font-weight: 600; }
.kk-credit-orange { color: #fd7e14; font-weight: 600; }
.kk-status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; }
.kk-status-dot.online { background: green; }
.kk-status-dot.offline { background: red; }
.kk-user-table { max-height: 400px; overflow-y: auto; }
.kk-user-table thead th { position: sticky; top: 0; z-index: 1; }

/* ---------- daily rate ---------- */
.kk-rate-card { border: 1px solid #ffc107; }
.kk-rate-input { width: 150px; }

/* ---------- product issue screens ---------- */
.issue-calendar { z-index: 1050; width: 260px; }
.issue-calendar td button { width: 2rem; padding: .15rem 0; border: 0; border-radius: .25rem; background: transparent; }
.issue-calendar td button:hover { background: var(--kk-accent-soft); }
.has-issue-entry, .issue-calendar td button.has-issue-entry { background: #ffe8b3 !important; color: #8a5300; font-weight: 600; }
.issue-calendar td button.selected { outline: 2px solid var(--kk-accent); }
.kk-driver-row { cursor: pointer; }
.kk-driver-row.table-active td { font-weight: 600; }
.kk-report-badge { display: inline-block; margin: 0 .25rem .25rem 0; padding: .2rem .5rem; border-radius: .35rem; background: var(--kk-accent-soft); color: #0b5e88; font-size: .8rem; }
.kk-driver-card { break-inside: avoid; page-break-inside: avoid; }

@media print {
    .kk-header, .kk-sidebar, .kk-filter, .kk-footer, .no-print, .btn { display: none !important; }
    .kk-main { margin-left: 0 !important; padding-top: 0 !important; }
    body { background: #fff; }
    .card, .kk-stat { box-shadow: none; border-color: #ccc; }
    .table-kk thead th, .table-kk tfoot td, .card-header { background: #fff !important; color: #000; }
}

/* ---------- error page: technical details (setting Kukudku:ShowErrorDetails) ---------- */
.kk-error-card { max-width: 980px !important; border-top-color: #dc3545 !important; }
.kk-error-card .display-5 { color: #dc3545 !important; }
.kk-error-details { font-size: .85rem; }
.kk-error-entry { border: 1px solid #f1c8cc; border-left: 4px solid #dc3545; background: #fff7f7; border-radius: 8px; padding: .65rem .85rem; margin-bottom: .6rem; }
.kk-error-type { font-family: Consolas, "Courier New", monospace; font-size: .78rem; color: #8a1c26; font-weight: 600; word-break: break-all; }
.kk-error-message { color: #212529; margin-top: .15rem; white-space: pre-wrap; word-break: break-word; }
.kk-error-facts { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; margin: .5rem 0 0; font-size: .8rem; }
.kk-error-facts dt { color: #6c757d; font-weight: 500; }
.kk-error-facts dd { margin: 0; word-break: break-word; }
.kk-error-stack summary { cursor: pointer; color: #0d6efd; font-size: .82rem; margin-top: .25rem; }
.kk-error-stack pre { max-height: 360px; overflow: auto; background: #1f2430; color: #e6e6e6; border-radius: 8px; padding: .75rem; font-size: .75rem; margin-top: .5rem; white-space: pre-wrap; word-break: break-word; }

/* ---------- toast notifications (wwwroot/js/site.js kkToast) ---------- */
.kk-toast-host { position: fixed; top: calc(var(--kk-header-height, 60px) + 14px); right: 18px; z-index: 2000; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.kk-toast {
    position: relative; overflow: hidden; pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 10px;
    min-width: 260px; max-width: 420px; padding: 13px 18px 15px 14px; border-radius: 12px; color: #fff; font-weight: 500; font-size: 14.5px;
    background: linear-gradient(135deg, #12a06e 0%, #20b97f 100%); box-shadow: 0 12px 30px rgba(16, 120, 80, .28), 0 2px 6px rgba(0, 0, 0, .08);
    opacity: 0; transform: translateX(40px) scale(.98); transition: opacity .35s ease, transform .35s cubic-bezier(.22, .8, .3, 1);
}
.kk-toast i.bi { font-size: 20px; flex: 0 0 auto; }
.kk-toast-error { background: linear-gradient(135deg, #c62f3d 0%, #e04b59 100%); box-shadow: 0 12px 30px rgba(180, 30, 45, .28), 0 2px 6px rgba(0, 0, 0, .08); }
.kk-toast-in { opacity: 1; transform: translateX(0) scale(1); }
.kk-toast-out { opacity: 0; transform: translateX(24px) scale(.98); }
.kk-toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, .55); transform-origin: left; animation: kk-toast-bar linear forwards; }
@keyframes kk-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 575.98px) { .kk-toast-host { left: 12px; right: 12px; align-items: stretch; } .kk-toast { max-width: none; } }
@media (prefers-reduced-motion: reduce) { .kk-toast { transition: opacity .2s ease; transform: none; } }

/* ---------- number inputs without the up / down spinner (testing 31-Oct; site.js also stops the mouse wheel) ---------- */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }

/* ---------- searchable dropdowns (wwwroot/js/kk-select.js, Select2 default theme look) ---------- */
/* the original <select> stays in the form (posted, read by page scripts), visually hidden next to the box */
select.kk-sel-native {
    position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; padding: 0 !important;
    margin: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden !important;
}
.kk-sel {
    position: relative; display: block; width: 100%; min-width: 0; height: calc(1.5em + .75rem + 2px); padding: .375rem 2rem .375rem .75rem;
    font-size: 1rem; font-weight: 400; line-height: 1.5; color: var(--bs-body-color, #212529); text-align: left;
    background-color: var(--kk-white); border: 1px solid #ddd; border-radius: var(--bs-border-radius, .375rem);
    cursor: pointer; user-select: none; outline: 0; transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.kk-sel-rendered { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.kk-sel-placeholder .kk-sel-rendered { color: #6c757d; }
.kk-sel-arrow { position: absolute; top: 50%; right: .8rem; width: 0; height: 0; margin-top: -2px;
    border-color: #888 transparent transparent transparent; border-style: solid; border-width: 5px 4px 0 4px; }
.kk-sel-open .kk-sel-arrow { border-color: transparent transparent #888 transparent; border-width: 0 4px 5px 4px; }
.kk-sel-focus, .kk-sel-open { border-color: var(--kk-orange); box-shadow: 0 0 0 .2rem rgba(255, 188, 83, .25); }
.kk-sel-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.kk-sel-open.kk-sel-open-above { border-radius: 0 0 var(--bs-border-radius, .375rem) var(--bs-border-radius, .375rem); }
.kk-sel-disabled { background-color: var(--bs-secondary-bg, #e9ecef); color: #6c757d; cursor: default; box-shadow: none; }
.kk-sel-disabled .kk-sel-arrow { border-top-color: #bbb; }
.kk-sel.is-invalid { border-color: #dc3545; }
.kk-sel.is-invalid.kk-sel-focus, .kk-sel.is-invalid.kk-sel-open { box-shadow: 0 0 0 .2rem rgba(220, 53, 69, .25); }
.kk-sel.is-valid { border-color: #198754; }
.kk-sel.form-select-sm, .input-group-sm > .kk-sel { height: calc(1.5em + .5rem + 2px); padding: .25rem 1.75rem .25rem .5rem; font-size: .875rem; border-radius: var(--bs-border-radius-sm, .25rem); }
.kk-sel.form-select-sm .kk-sel-arrow, .input-group-sm > .kk-sel .kk-sel-arrow { right: .6rem; }
.kk-sel.form-select-lg { height: calc(1.5em + 1rem + 2px); padding: .5rem 2.25rem .5rem 1rem; font-size: 1.25rem; }
.kk-sel.w-auto { display: inline-block; min-width: 10rem; }
.kk-sel.d-inline-block, .kk-sel.d-inline-flex { display: inline-block; width: auto; min-width: 10rem; vertical-align: middle; }
td > .kk-sel { min-width: 8rem; }
/* inside .input-group the box takes the place of the select */
.input-group > .kk-sel { position: relative; flex: 1 1 auto; width: 1%; min-width: 0; }
.input-group > .kk-sel-native:first-child + .kk-sel { margin-left: 0; border-top-left-radius: var(--bs-border-radius, .375rem); border-bottom-left-radius: var(--bs-border-radius, .375rem); }
.input-group > .kk-sel:focus, .input-group > .kk-sel-open { z-index: 5; }
.kk-sel-dropdown {
    position: fixed; z-index: 2100; box-sizing: border-box; background: #fff; border: 1px solid #aaa; border-radius: 0 0 4px 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12); font-size: .95rem; overflow: hidden;
}
.kk-sel-dropdown-above { border-radius: 4px 4px 0 0; box-shadow: 0 -6px 16px rgba(0, 0, 0, .12); }
.kk-sel-search { padding: 4px; }
.kk-sel-search-input { display: block; width: 100%; box-sizing: border-box; padding: 4px 6px; border: 1px solid #aaa; border-radius: 0; font-size: .95rem; outline: 0; }
.kk-sel-search-input:focus { border-color: var(--kk-orange); }
.kk-sel-search-input::-webkit-search-cancel-button { cursor: pointer; }
.kk-sel-results { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.kk-sel-option { padding: 6px 8px; cursor: pointer; white-space: normal; word-break: break-word; line-height: 1.35; }
.kk-sel-option-grouped { padding-left: 1.25rem; }
.kk-sel-option-selected { background-color: #ddd; }
.kk-sel-option-highlighted { background-color: #5897fb; color: #fff; }
.kk-sel-option-disabled { color: #999; cursor: default; }
.kk-sel-option-empty:not(.kk-sel-option-highlighted) { color: #6c757d; }
.kk-sel-group { padding: 6px 8px 4px; font-weight: 600; color: #333; cursor: default; }
.kk-sel-message { padding: 6px 8px; color: #666; cursor: default; }

/* ---------- client-side pagination (site.js: <table data-paginate="10">) ---------- */
.kk-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .6rem; }
.kk-pager-info { font-size: .85rem; color: var(--kk-muted); }
.kk-pager .pagination { margin: 0; }
.kk-pager .page-link { color: var(--kk-text-dark); cursor: pointer; }
.kk-pager .page-item.active .page-link { background-color: var(--kk-accent); border-color: var(--kk-accent); color: #fff; }
.kk-pager .page-item.disabled .page-link { color: #adb5bd; cursor: default; }
.kk-sel.kk-sel-plain { display: inline-block; width: auto; min-width: 8rem; vertical-align: middle; }

/* ---------------- Master screens: toolbar, grid actions and CRUD pop-ups (UAT 2-Nov, kk-crud.js) ---------------- */
.kk-master-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.kk-master-search { display: flex; gap: 6px; flex: 1 1 280px; max-width: 460px; }
.kk-master-search .form-control { min-width: 0; }
.kk-master-toolbar .btn-success { white-space: nowrap; }
/* UAT 12-Nov: search box and Search button on ONE line (the button text used to wrap under its icon, which made the
   box two lines high); a wider "+ Add New" button. Applies to every list screen that uses _MasterToolbar. */
.kk-master-search { align-items: center; }
.kk-master-search .form-control { height: 34px; padding-top: .25rem; padding-bottom: .25rem; }
.kk-master-search .btn { flex: 0 0 auto; height: 34px; display: inline-flex; align-items: center; white-space: nowrap; padding: 0 .9rem; }
.kk-master-toolbar > .btn-success { min-width: 150px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0 1.1rem; }
.table-kk td.kk-actions, .table-kk th.kk-actions { text-align: center; white-space: nowrap; width: 1%; }
.table-kk td.kk-actions .btn { padding: .15rem .45rem; }
.table-kk td.kk-actions form { display: inline; }
.kk-grid-empty td { text-align: center; color: #888; padding: 1.25rem .5rem !important; }
.kk-crud-modal .modal-header { background: var(--kk-accent, #f0a500); color: #fff; }
.kk-crud-modal .modal-header .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.kk-crud-modal .modal-title { font-weight: 600; font-size: 1.1rem; }
.kk-crud-body .page-title, .kk-crud-body .breadcrumb { display: none; }
.kk-crud-body > .kk-modal-fragment > .card, .kk-crud-body .kk-modal-fragment > .card { border: 0; box-shadow: none; }
.kk-crud-body .kk-modal-fragment > .card > .card-body { padding: 0; }
.kk-crud-busy .modal-content { opacity: .75; pointer-events: none; }
body.kk-crud-loading { cursor: progress; }
.kk-confirm-modal { z-index: 1065; }
/* the layout's ModelOnly summary (_StatusMessage) is hidden when the page shows its own summary with errors (no duplicate) */
.kk-content:has(.validation-summary-errors:not(.kk-summary)) > .kk-summary,
.kk-modal-fragment:has(.validation-summary-errors:not(.kk-summary)) > .kk-summary { display: none; }
/* Date Wise Opening Balance: loading overlay over the shop table */
.kk-ob-spinner { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; background: rgba(255,255,255,.6); z-index: 5; }
.kk-ob-spinner[hidden] { display: none; }
.kk-ob-spinner .spinner-border { width: 3rem; height: 3rem; }

/* ---------- Master Dashboard: compact (testing 4-Nov) ----------
   The five cards fit without a vertical scroll bar on a laptop (1366x768 and 1920x1080 at 100 %): two rows of cards
   (3 + 2), at most 6 entries per column, ~31 px per entry, compact headers; long titles are cut with "..." (full title
   on mouse over). Below the lg breakpoint the cards stack and the page scrolls as before. */
.kk-content:has(> .kk-master) { padding-bottom: 0; background: var(--kk-bg-light); }
.kk-main:has(.kk-master) .kk-footer { background: var(--kk-bg-light); padding: .35rem 0; }
.kk-master { min-height: 0; padding: .75rem 1rem .25rem; }
.kk-master .kk-section-card { margin-bottom: 0; height: 100%; border-radius: 10px; }
.kk-master .kk-section-header { font-size: 13px; line-height: 1.2; padding: 7px 14px; gap: 8px; border-top-left-radius: 9px; border-top-right-radius: 9px; }
.kk-master .kk-section-header > i.bi { font-size: 14px; line-height: 1; padding: 4px 5px; }
.kk-master .kk-section-header .kk-calc-btn { font-size: 16px; line-height: 1; }
.kk-master .kk-brand-item, .kk-master .kk-brand-dropdown { padding: 5px 14px; font-size: 13px; line-height: 20px; }
.kk-master .kk-brand-item i.bi, .kk-master .kk-brand-dropdown i.bi:first-child { font-size: 15px; line-height: 1; width: 20px; margin-right: 10px; flex-shrink: 0; }
.kk-master .kk-entry-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-master .kk-brand-list > .kk-brand-item:last-child, .kk-master .kk-brand-list > .kk-fly:last-child > .kk-brand-dropdown { border-bottom-color: transparent; }
.kk-master .kk-not-migrated-badge { font-size: 9.5px; padding: 0 6px; }
.kk-master-note { font-size: 11px; margin: .4rem 0 0; }
@media (max-width: 991.98px) { .kk-master .kk-entry-text { white-space: normal; } }

/* ---------- UAT 12-Nov: no left menu; the content uses the full width ---------- */
.kk-main, body.kk-mini .kk-main { margin-left: 0 !important; }
.kk-header-left { width: auto; }
a.kk-home-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }
.kk-db-counts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.kk-db-count { display: flex; align-items: center; gap: 12px; min-width: 210px; padding: 8px 16px 8px 8px; border: 1px solid; border-radius: 18px 0; text-decoration: none; color: #333; }
.kk-db-count:hover { color: #333; filter: brightness(.97); }
.kk-db-count .kk-db-icon { width: 42px; height: 42px; border-radius: 8px; color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.kk-db-count .num { font-size: 24px; font-weight: 600; line-height: 1; }
.kk-db-count .lbl { font-size: 14px; color: #555; }
