/* Hanifa Islamic School — admin theme layered on top of Filament's own CSS. */

:root {
    --hs-bg: #f3f5fa;
    --hs-surface: #ffffff;
    --hs-border: #e6e9f2;
    --hs-text: #0f172a;
    --hs-muted: #64748b;
    --hs-navy-1: #1b1846;
    --hs-navy-2: #241f5e;
    --hs-navy-3: #2d2677;
    --hs-accent: #2dd4bf;
    --hs-indigo: #4f46e5;
    --hs-radius: 16px;
    --hs-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .05);
    --hs-shadow-hover: 0 4px 10px rgba(16, 24, 40, .06), 0 12px 28px rgba(16, 24, 40, .08);
}

body.fi-body {
    background: var(--hs-bg);
    color: var(--hs-text);
}

/* ---------- Sidebar ---------- */

.fi-body .fi-sidebar {
    background: linear-gradient(180deg, var(--hs-navy-1) 0%, var(--hs-navy-2) 55%, var(--hs-navy-3) 100%) !important;
    border-right: 0;
}

.fi-body .fi-sidebar-header {
    height: 5.25rem;
    background: transparent;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    padding-left: 1.25rem;
    padding-right: 1rem;
}

.fi-body .fi-sidebar-header .fi-icon-btn {
    color: rgba(255, 255, 255, .6);
}

.fi-body .fi-sidebar-header .fi-icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.fi-body .fi-sidebar-nav {
    padding: 1.25rem 1rem;
    gap: 1.1rem;
}

.fi-body .fi-sidebar-nav-groups {
    gap: 1.1rem;
}

.fi-body .fi-sidebar-group-label {
    color: rgba(199, 210, 254, .55);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.fi-body .fi-sidebar-group-collapse-button {
    color: rgba(199, 210, 254, .45);
}

.fi-body .fi-sidebar-item-button {
    padding: .6rem .75rem;
    border-radius: 10px;
    position: relative;
}

.fi-body .fi-sidebar-item-button:hover,
.fi-body .fi-sidebar-item-button:focus-visible {
    background: rgba(255, 255, 255, .07) !important;
}

.fi-body .fi-sidebar-item-icon {
    color: rgba(199, 210, 254, .7) !important;
    width: 1.25rem;
    height: 1.25rem;
}

.fi-body .fi-sidebar-item-label {
    color: rgba(238, 242, 255, .82) !important;
    font-weight: 500;
}

.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-button {
    background: rgba(255, 255, 255, .12) !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.fi-body .fi-sidebar-item.fi-active > .fi-sidebar-item-button::before {
    content: "";
    position: absolute;
    left: -1rem;
    top: 22%;
    bottom: 22%;
    width: 4px;
    border-radius: 0 4px 4px 0;
    background: var(--hs-accent);
}

.fi-body .fi-sidebar-item.fi-active .fi-sidebar-item-icon {
    color: var(--hs-accent) !important;
}

.fi-body .fi-sidebar-item.fi-active .fi-sidebar-item-label {
    color: #fff !important;
    font-weight: 600;
}

/* Brand block (logo + school name) */

.hs-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    height: 100%;
}

.hs-brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25), 0 0 0 3px rgba(45, 212, 191, .35);
}

.hs-brand-logo img {
    width: 2.55rem;
    height: 2.55rem;
    object-fit: contain;
}

.hs-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.hs-brand-name {
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    letter-spacing: -.01em;
    white-space: nowrap;
}

.hs-brand-sub {
    color: rgba(199, 210, 254, .7);
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .02em;
    margin-top: .15rem;
    white-space: nowrap;
}

/* Sidebar footer */

.hs-sidebar-footer {
    margin: 0 1rem 1rem;
    padding: .9rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .08);
    color: rgba(199, 210, 254, .75);
    font-size: .72rem;
    line-height: 1.5;
}

.hs-sidebar-footer strong {
    display: block;
    color: #fff;
    font-size: .78rem;
    margin-bottom: .15rem;
}

/* The menu is long enough now that the footer would crowd it on shorter screens. */
@media (max-height: 1080px) {
    .hs-sidebar-footer { display: none; }
}

/* ---------- Topbar ---------- */

.fi-body .fi-topbar > nav {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(180%) blur(10px);
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    border-bottom: 1px solid var(--hs-border);
    height: 4.25rem;
}

.hs-topbar-context {
    display: flex;
    align-items: center;
    gap: .6rem;
    color: var(--hs-muted);
    font-size: .85rem;
}

.hs-topbar-context .hs-topbar-date {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    background: #eef2ff;
    color: var(--hs-indigo);
    font-weight: 600;
    font-size: .78rem;
}

.hs-topbar-context .hs-topbar-date svg {
    width: 1rem;
    height: 1rem;
}

@media (max-width: 767px) {
    .hs-topbar-context {
        display: none;
    }
}

/* ---------- Page header ---------- */

.fi-body .fi-header-heading {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--hs-text);
}

.fi-body .fi-header-subheading {
    color: var(--hs-muted);
}

/* ---------- Surfaces: sections, tables, widgets ---------- */

.fi-body .fi-section,
.fi-body .fi-ta-ctn,
.fi-body .fi-wi-stats-overview-stat,
.fi-body .fi-wi-widget > .fi-section {
    border-radius: var(--hs-radius) !important;
    box-shadow: var(--hs-shadow) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    border: 1px solid var(--hs-border);
}

/* Table header row */
.fi-body .fi-ta-header-cell {
    background: #f8fafc;
}

.fi-body .fi-ta-header-cell-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hs-muted);
}

.fi-body .fi-ta-row:hover {
    background: #fafbff;
}

/* Stat cards */
.fi-body .fi-wi-stats-overview-stat {
    padding: 1.35rem 1.5rem;
    transition: transform .15s ease, box-shadow .15s ease;
}

.fi-body a.fi-wi-stats-overview-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--hs-shadow-hover) !important;
}

.fi-body .fi-wi-stats-overview-stat-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--hs-muted);
}

.fi-body .fi-wi-stats-overview-stat-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
}

/* Buttons */
.fi-body .fi-btn {
    border-radius: 10px;
}

.fi-body .fi-btn-color-primary {
    box-shadow: 0 1px 2px rgba(79, 70, 229, .25), 0 4px 12px rgba(79, 70, 229, .18);
}

/* Inputs */
.fi-body .fi-input-wrp {
    border-radius: 10px;
}

/* Modals */
.fi-body .fi-modal-window {
    border-radius: 20px;
}

/* ---------- Dashboard widgets ---------- */

.hs-welcome {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    padding: 2rem 2.25rem;
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(45, 212, 191, .28), transparent 45%),
        radial-gradient(circle at 10% 110%, rgba(129, 140, 248, .45), transparent 50%),
        linear-gradient(135deg, #1b1846 0%, #312e81 60%, #4338ca 100%);
    box-shadow: 0 10px 30px rgba(49, 46, 129, .25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.hs-welcome-eyebrow {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(199, 210, 254, .85);
}

.hs-welcome h2 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-top: .35rem;
}

.hs-welcome p {
    margin-top: .4rem;
    color: rgba(224, 231, 255, .85);
    font-size: .92rem;
}

.hs-welcome-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-top: 1.4rem;
}

.hs-welcome-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem 1rem;
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    transition: background .15s ease, transform .15s ease;
}

.hs-welcome-btn svg {
    width: 1.05rem;
    height: 1.05rem;
}

.hs-welcome-btn-primary {
    background: #fff;
    color: #312e81;
}

.hs-welcome-btn-primary:hover {
    transform: translateY(-1px);
}

.hs-welcome-btn-ghost {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .18);
}

.hs-welcome-btn-ghost:hover {
    background: rgba(255, 255, 255, .2);
}

.hs-welcome-logo {
    flex-shrink: 0;
    width: 8.5rem;
    height: 8.5rem;
    border-radius: 999px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, .08), 0 16px 40px rgba(0, 0, 0, .3);
}

.hs-welcome-logo img {
    width: 7.9rem;
    height: 7.9rem;
    object-fit: contain;
}

@media (max-width: 768px) {
    .hs-welcome {
        padding: 1.5rem;
    }

    .hs-welcome-logo {
        display: none;
    }
}

/* List card (today's schedule, pending approvals) */

.hs-card {
    background: var(--hs-surface);
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    box-shadow: var(--hs-shadow);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hs-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--hs-border);
}

.hs-card-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    font-size: .98rem;
    color: var(--hs-text);
}

.hs-card-title-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-card-title-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.hs-icon-indigo { background: #eef2ff; color: #4f46e5; }
.hs-icon-amber { background: #fef3c7; color: #b45309; }

.hs-card-link {
    font-size: .8rem;
    font-weight: 600;
    color: var(--hs-indigo);
    white-space: nowrap;
}

.hs-card-link:hover {
    text-decoration: underline;
}

.hs-list {
    padding: .4rem 0;
    flex: 1;
}

.hs-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.35rem;
    border-bottom: 1px solid #f1f3f9;
}

.hs-list-item:last-child {
    border-bottom: 0;
}

.hs-time {
    flex-shrink: 0;
    width: 4.6rem;
    text-align: center;
    padding: .35rem 0;
    border-radius: 9px;
    background: #f5f6fb;
    font-size: .72rem;
    font-weight: 700;
    color: #334155;
    line-height: 1.25;
}

.hs-time span {
    display: block;
    color: var(--hs-muted);
    font-weight: 500;
}

.hs-item-body {
    flex: 1;
    min-width: 0;
}

.hs-item-title {
    font-weight: 600;
    font-size: .88rem;
    color: var(--hs-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-item-meta {
    font-size: .76rem;
    color: var(--hs-muted);
    margin-top: .1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hs-pill {
    flex-shrink: 0;
    font-size: .7rem;
    font-weight: 700;
    padding: .25rem .6rem;
    border-radius: 999px;
}

.hs-pill-approved { background: #dcfce7; color: #166534; }
.hs-pill-pending { background: #fef3c7; color: #92400e; }
.hs-pill-cancelled { background: #fee2e2; color: #991b1b; }

.hs-empty {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--hs-muted);
    font-size: .85rem;
}

.hs-empty svg {
    width: 2.25rem;
    height: 2.25rem;
    margin: 0 auto .6rem;
    color: #cbd5e1;
}

/* ---------- Activity log details ---------- */
.hs-log-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem 1.25rem;
    padding: 1rem 1.1rem;
    background: #f8fafc;
    border: 1px solid var(--hs-border);
    border-radius: 12px;
}

.hs-log-meta dt {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hs-muted);
}

.hs-log-meta dd {
    margin-top: .15rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--hs-text);
}

.hs-log-desc {
    margin: 1rem 0;
    font-size: .92rem;
    color: var(--hs-text);
}

.hs-log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .85rem;
    border: 1px solid var(--hs-border);
    border-radius: 12px;
    overflow: hidden;
}

.hs-log-table th {
    background: #f8fafc;
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hs-muted);
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--hs-border);
}

.hs-log-table td {
    padding: .6rem .85rem;
    border-bottom: 1px solid var(--hs-border);
    vertical-align: top;
    color: var(--hs-text);
    word-break: break-word;
}

.hs-log-table tr:last-child td { border-bottom: 0; }
.hs-log-field { font-weight: 600; white-space: nowrap; width: 1%; }
.hs-log-old { color: #b91c1c !important; background: #fef2f2; text-decoration: line-through; text-decoration-color: rgba(185, 28, 28, .35); }
.hs-log-new { color: #047857 !important; background: #ecfdf5; font-weight: 600; }

@media (max-width: 640px) {
    .hs-log-meta { grid-template-columns: 1fr; }
}

/* ---------- Profile page ---------- */
.hs-profile-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--hs-radius);
    color: #fff;
    background:
        radial-gradient(circle at 90% 10%, rgba(45, 212, 191, .25), transparent 45%),
        linear-gradient(120deg, var(--hs-navy-1), var(--hs-navy-3));
    box-shadow: var(--hs-shadow);
}

.hs-profile-avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 2px solid rgba(255, 255, 255, .35);
    font-size: 1.35rem;
    font-weight: 800;
}

.hs-profile-name { font-size: 1.15rem; font-weight: 800; }
.hs-profile-sub { font-size: .82rem; opacity: .8; margin-top: .1rem; }

.hs-profile-role {
    margin-left: auto;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    padding: .3rem .75rem;
    border-radius: 999px;
    background: rgba(45, 212, 191, .18);
    color: #99f6e4;
    border: 1px solid rgba(45, 212, 191, .4);
    white-space: nowrap;
}

/* ---------- Kedai: shared ---------- */
[x-cloak] { display: none !important; }

.kp-chip {
    padding: .45rem .95rem;
    border-radius: 999px;
    border: 1px solid var(--hs-border);
    background: #fff;
    font-size: .82rem;
    font-weight: 600;
    color: #334155;
    transition: all .15s ease;
    white-space: nowrap;
}

.kp-chip:hover { border-color: #c7d2fe; color: var(--hs-indigo); }
.kp-chip.is-active { background: var(--hs-navy-3); border-color: var(--hs-navy-3); color: #fff; }

.kp-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--hs-muted);
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: var(--hs-radius);
}

.kp-empty svg { width: 2.75rem; height: 2.75rem; color: #a5b4fc; }
.kp-empty-title { font-weight: 800; color: var(--hs-text); font-size: 1.05rem; }

/* ---------- Kedai POS ---------- */
.kp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.25rem;
    align-items: start;
}

.kp-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
    margin-bottom: 1rem;
}

.kp-stat {
    display: flex;
    flex-direction: column;
    padding: .8rem 1rem;
    background: #fff;
    border: 1px solid var(--hs-border);
    border-radius: 14px;
    box-shadow: var(--hs-shadow);
}

.kp-stat-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hs-muted); }
.kp-stat-value { font-size: 1.25rem; font-weight: 800; color: var(--hs-text); margin-top: .1rem; }
.kp-stat-school { background: #ecfdf5; border-color: #a7f3d0; }
.kp-stat-school .kp-stat-value { color: #047857; }

.kp-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.kp-search {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 0 .9rem;
    background: #fff;
    border: 1px solid var(--hs-border);
    border-radius: 12px;
    box-shadow: var(--hs-shadow);
}

.kp-search svg { width: 1.15rem; height: 1.15rem; color: #94a3b8; flex-shrink: 0; }
.kp-search input { flex: 1; border: 0; background: transparent; padding: .7rem 0; font-size: .9rem; outline: none; box-shadow: none; }
.kp-search input:focus { box-shadow: none; }
.kp-chips { display: flex; gap: .4rem; overflow-x: auto; }

.kp-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    border-radius: 14px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: .88rem;
}

.kp-banner svg { width: 1.3rem; height: 1.3rem; flex-shrink: 0; }
.kp-banner span { flex: 1 1 240px; }

.kp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: .9rem;
}

.kp-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--hs-shadow);
    outline: 1px solid var(--hs-border);
    transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.kp-card:hover { transform: translateY(-2px); box-shadow: var(--hs-shadow-hover); }
.kp-card:active { transform: scale(.97); }
.kp-card.is-picked { border-color: var(--hs-indigo); outline-color: transparent; }
.kp-card.is-out { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.kp-card.is-out img { filter: grayscale(1); }

.kp-card-img { position: relative; display: block; aspect-ratio: 1 / 1; background: #eef2ff; }
.kp-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.kp-card-qty {
    position: absolute;
    top: .5rem;
    right: .5rem;
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--hs-indigo);
    color: #fff;
    font-weight: 800;
    font-size: .95rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, .45);
}

.kp-card-out {
    position: absolute;
    left: .5rem;
    bottom: .5rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, .78);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
}

.kp-card-body { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .8rem .8rem; }
.kp-card-name { font-weight: 700; font-size: .92rem; color: var(--hs-text); line-height: 1.25; }
.kp-card-vendor { font-size: .72rem; color: var(--hs-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .4rem; }
.kp-card-price { font-weight: 800; font-size: .95rem; color: var(--hs-indigo); }
.kp-card-left { font-size: .7rem; font-weight: 700; color: #0369a1; background: #e0f2fe; padding: .15rem .5rem; border-radius: 999px; white-space: nowrap; }
.kp-card-left.is-low { color: #b45309; background: #fef3c7; }
.kp-nomatch { padding: 2rem; text-align: center; color: var(--hs-muted); }

.kp-cart {
    position: sticky;
    top: 5.5rem;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 7rem);
    background: #fff;
    border: 1px solid var(--hs-border);
    border-radius: 20px;
    box-shadow: var(--hs-shadow-hover);
    overflow: hidden;
}

.kp-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.15rem;
    color: #fff;
    background: linear-gradient(120deg, var(--hs-navy-1), var(--hs-navy-3));
}

.kp-cart-title { font-weight: 800; font-size: 1.05rem; }
.kp-cart-sub { font-size: .78rem; opacity: .75; }
.kp-link-danger { font-size: .8rem; font-weight: 700; color: #fecaca; }
.kp-link-danger:hover { color: #fff; }

.kp-lines { flex: 1 1 auto; overflow-y: auto; padding: .4rem .9rem; min-height: 8rem; }

.kp-line {
    display: grid;
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    grid-template-areas: "img info sub" "img step step";
    align-items: center;
    column-gap: .65rem;
    row-gap: .35rem;
    padding: .7rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.kp-line img { grid-area: img; width: 2.6rem; height: 2.6rem; border-radius: 10px; object-fit: cover; align-self: start; }
.kp-line-info { grid-area: info; display: flex; flex-direction: column; min-width: 0; }
.kp-line-name { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-line-price { font-size: .75rem; color: var(--hs-muted); }
.kp-line-sub { grid-area: sub; font-weight: 800; font-size: .88rem; }

.kp-stepper { grid-area: step; display: inline-flex; align-items: center; width: max-content; border: 1px solid var(--hs-border); border-radius: 10px; overflow: hidden; }
.kp-stepper button { width: 2.1rem; height: 2rem; font-size: 1.1rem; font-weight: 700; color: var(--hs-indigo); background: #f8fafc; }
.kp-stepper button:hover { background: #eef2ff; }
.kp-stepper input { width: 3rem; height: 2rem; border: 0; text-align: center; font-weight: 700; font-size: .9rem; padding: 0; -moz-appearance: textfield; }
.kp-stepper input::-webkit-outer-spin-button,
.kp-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.kp-cart-empty { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: 2rem 0; color: #94a3b8; font-size: .85rem; }
.kp-cart-empty svg { width: 2.2rem; height: 2.2rem; }

.kp-totals { padding: .9rem 1.15rem; border-top: 1px solid var(--hs-border); background: #f8fafc; }
.kp-row { display: flex; justify-content: space-between; font-size: .82rem; color: var(--hs-muted); padding: .15rem 0; }
.kp-row-school { color: #047857; font-weight: 600; }
.kp-row-total { font-size: 1.3rem; font-weight: 800; color: var(--hs-text); padding-top: .45rem; margin-top: .3rem; border-top: 1px dashed #cbd5e1; }

.kp-cash { margin-top: .7rem; }
.kp-cash label { display: flex; align-items: center; justify-content: space-between; gap: .75rem; font-size: .8rem; font-weight: 600; color: #334155; }
.kp-cash em { font-style: normal; font-weight: 400; color: #94a3b8; }
.kp-cash input { width: 8.5rem; text-align: right; border: 1px solid var(--hs-border); border-radius: 10px; padding: .45rem .65rem; font-weight: 700; }
.kp-cash-quick { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.kp-cash-quick button { padding: .3rem .6rem; border-radius: 8px; border: 1px solid var(--hs-border); background: #fff; font-size: .75rem; font-weight: 700; color: #334155; }
.kp-cash-quick button:hover { border-color: #c7d2fe; color: var(--hs-indigo); }
.kp-change { margin-top: .5rem; font-size: 1rem; font-weight: 800; color: #047857; }
.kp-change.is-short { color: #b91c1c; }

.kp-submit {
    margin: 0 1.15rem 1.15rem;
    padding: 1rem;
    border-radius: 14px;
    background: linear-gradient(120deg, #4f46e5, #2d2677);
    color: #fff;
    font-weight: 800;
    font-size: 1.02rem;
    box-shadow: 0 10px 22px rgba(79, 70, 229, .35);
    transition: transform .1s ease, opacity .15s ease;
}

.kp-submit:active { transform: scale(.98); }
.kp-submit:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }

.kp-mobile-bar { display: none; }

.kp-flash {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    z-index: 60;
    padding: .8rem 1.4rem;
    border-radius: 999px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
}

.kp-flash.is-ok { background: #059669; }
.kp-flash.is-warn { background: #d97706; }

@media (max-width: 1279px) {
    .kp { grid-template-columns: minmax(0, 1fr) 330px; }
}

@media (max-width: 1023px) {
    .kp { grid-template-columns: 1fr; }
    .kp-cart { position: static; max-height: none; }
    .kp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kp-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

    .kp-mobile-bar {
        position: fixed;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        padding: .9rem 1.1rem;
        border-radius: 16px;
        background: var(--hs-navy-3);
        color: #fff;
        font-size: .85rem;
        box-shadow: 0 12px 28px rgba(27, 24, 70, .4);
    }

    .kp-flash { bottom: 5.5rem; }
}

/* ---------- Kedai stock & report ---------- */
.ks-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: .9rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    box-shadow: var(--hs-shadow);
}

.ks-date { display: flex; flex-direction: column; gap: .25rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--hs-muted); }
.ks-date input,
.ks-date select { min-width: 10rem; border: 1px solid var(--hs-border); border-radius: 10px; padding: .5rem .7rem; font-size: .9rem; font-weight: 600; color: var(--hs-text); text-transform: none; letter-spacing: 0; }
.ks-date-label { align-self: center; font-weight: 700; color: var(--hs-text); }
.ks-today { margin-left: .4rem; padding: .15rem .55rem; border-radius: 999px; background: #e0e7ff; color: var(--hs-indigo); font-size: .7rem; font-weight: 800; }
.ks-toolbar-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: .5rem; }

.ks-table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--hs-border); border-radius: var(--hs-radius); box-shadow: var(--hs-shadow); }
.ks-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ks-table th { background: #f8fafc; text-align: left; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hs-muted); padding: .75rem 1rem; border-bottom: 1px solid var(--hs-border); white-space: nowrap; }
.ks-table td { padding: .7rem 1rem; border-bottom: 1px solid #f1f5f9; color: var(--hs-text); }
.ks-table tbody tr:hover { background: #fafbff; }
.ks-table tfoot td { font-weight: 800; background: #f8fafc; border-top: 2px solid var(--hs-border); border-bottom: 0; }
.ks-num { text-align: right !important; white-space: nowrap; }

.ks-product { display: flex; align-items: center; gap: .75rem; }
.ks-product img { width: 2.75rem; height: 2.75rem; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ks-product-name { font-weight: 700; }
.ks-product-sub { font-size: .76rem; color: var(--hs-muted); }

.ks-input { width: 6rem; text-align: right; border: 1px solid #cbd5e1; border-radius: 10px; padding: .5rem .7rem; font-size: 1rem; font-weight: 800; color: var(--hs-text); }
.ks-input:focus { border-color: var(--hs-indigo); box-shadow: 0 0 0 3px rgba(79, 70, 229, .15); outline: none; }
.ks-left { display: inline-block; min-width: 2.2rem; padding: .15rem .55rem; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-weight: 800; text-align: center; }
.ks-left.is-out { background: #fee2e2; color: #b91c1c; }
.ks-muted { color: #cbd5e1; }
.ks-footer { display: flex; justify-content: flex-end; margin-top: 1rem; }

.kr-ranges { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; }
.kr-filters { display: flex; flex-wrap: wrap; gap: .9rem; }
.kr-period { display: flex; align-items: center; gap: .45rem; margin-bottom: 1rem; font-weight: 700; color: var(--hs-text); }
.kr-period svg { width: 1.15rem; height: 1.15rem; color: var(--hs-indigo); }

.kr-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kr-card { display: flex; flex-direction: column; gap: .2rem; padding: 1.15rem 1.25rem; background: #fff; border: 1px solid var(--hs-border); border-radius: var(--hs-radius); box-shadow: var(--hs-shadow); }
.kr-card-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--hs-muted); }
.kr-card-value { font-size: 1.65rem; font-weight: 800; color: var(--hs-text); }
.kr-card-sub { font-size: .78rem; color: var(--hs-muted); }
.kr-card-vendor { border-top: 4px solid #6366f1; }
.kr-card-school { border-top: 4px solid #10b981; background: #f0fdf9; }
.kr-card-school .kr-card-value { color: #047857; }

.kr-section { margin-bottom: 1.5rem; }
.kr-section-head { margin-bottom: .65rem; }
.kr-section-head h3 { font-size: 1.05rem; font-weight: 800; color: var(--hs-text); }
.kr-section-head p { font-size: .82rem; color: var(--hs-muted); }
.kr-school { color: #047857 !important; font-weight: 700; }
.kr-pay { color: var(--hs-indigo) !important; font-weight: 800; }

.hs-price-preview { font-size: 1.35rem; font-weight: 800; color: var(--hs-indigo); }

@media (max-width: 767px) {
    .kr-cards { grid-template-columns: 1fr; }
    .ks-toolbar-actions { margin-left: 0; width: 100%; }
}

/* ---------- Kedai daily stock ledger ---------- */
.ks-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.25rem;
    margin: -.25rem 0 1rem;
    font-size: .76rem;
    color: var(--hs-muted);
}

.ks-legend b { color: var(--hs-text); font-weight: 700; }

.ks-ledger tbody + tbody { border-top: 2px solid var(--hs-border); }

.ks-vendor-row td {
    background: #f5f3ff !important;
    color: var(--hs-navy-3);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .5rem 1rem !important;
}

.ks-ledger tr.is-idle td { opacity: .55; }
.ks-ledger tr.is-idle:hover td { opacity: 1; }

.ks-carry {
    display: inline-block;
    min-width: 2.2rem;
    padding: .15rem .55rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-weight: 800;
    text-align: center;
}

.ks-taken { display: inline-flex; align-items: center; gap: .35rem; justify-content: flex-end; }
.ks-input-sm { width: 4.75rem; }

.ks-all {
    padding: .35rem .55rem;
    border-radius: 8px;
    border: 1px solid var(--hs-border);
    background: #fff;
    font-size: .72rem;
    font-weight: 700;
    color: var(--hs-indigo);
}

.ks-all:hover { background: #eef2ff; border-color: #c7d2fe; }
.ks-left.is-zero { background: #f1f5f9; color: #64748b; }

/* ---------- Kedai POS: payment method ---------- */
.kp-method { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .7rem; font-size: .8rem; font-weight: 600; color: #334155; }
.kp-method-options { display: inline-flex; border: 1px solid var(--hs-border); border-radius: 10px; overflow: hidden; background: #fff; }
.kp-method-options button { padding: .4rem .75rem; font-size: .78rem; font-weight: 700; color: #475569; border-right: 1px solid var(--hs-border); }
.kp-method-options button:last-child { border-right: 0; }
.kp-method-options button.is-active { background: var(--hs-navy-3); color: #fff; }

/* ---------- Kedai cash book ---------- */
.kc-month { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; }
.kc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.kc-card-out { border-top: 4px solid #f43f5e; }
.kc-card-out .kr-card-value { color: #be123c; }

.kc-today {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.kc-today-col {
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--hs-border);
    border-radius: var(--hs-radius);
    box-shadow: var(--hs-shadow);
}

.kc-today-col h3 { font-size: .95rem; font-weight: 800; margin-bottom: .5rem; color: var(--hs-text); }
.kc-today-col .kp-row { font-size: .85rem; color: #334155; padding: .25rem 0; }
.kc-today-col .kp-row-total { font-size: 1rem; }
.kc-muted { color: #94a3b8; font-style: normal; font-size: .78rem; }
.kc-closing { margin-top: .75rem; padding: .5rem .75rem; border-radius: 10px; font-size: .82rem; font-weight: 700; }
.kc-closing.is-ok { background: #ecfdf5; color: #047857; }
.kc-closing.is-off { background: #fff7ed; color: #c2410c; }

.kc-table td { vertical-align: top; }
.kc-table tr.kc-new-day td { border-top: 2px solid #e2e8f0; }
.kc-table tr.kc-opening td { background: #f8fafc; }
.kc-table tr.kc-manual { cursor: pointer; }
.kc-table tr.kc-manual:hover td { background: #eef2ff; }
.kc-desc { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-weight: 600; }
.kc-tag { font-size: .62rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: .1rem .4rem; border-radius: 6px; background: #f1f5f9; color: #64748b; }
.kc-tag-sales { background: #dcfce7; color: #166534; }
.kc-tag-vendor { background: #e0e7ff; color: #3730a3; }
.kc-tag-difference { background: #ffedd5; color: #9a3412; }
.kc-out { color: #be123c !important; }
.kc-ok { color: #047857; font-weight: 700; }
.kc-bad { color: #b91c1c; font-weight: 800; }

@media (max-width: 1023px) {
    .kc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kc-today { grid-template-columns: 1fr; }
}

/* Tabs wrap onto more lines instead of scrolling sideways (e.g. one tab per kedai vendor). */
.fi-body .fi-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: .25rem; }

.ks-vendor-tabs { margin-bottom: 1rem; }
