/* =====================================================================
   Laxmi Pedha BMS - design system
   ===================================================================== */
@font-face { font-family: Poppins; font-weight: 400; font-display: swap; src: url(../lib/fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; font-display: swap; src: url(../lib/fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-display: swap; src: url(../lib/fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 700; font-display: swap; src: url(../lib/fonts/poppins-latin-700-normal.woff2) format("woff2"); }

:root {
    --lp-primary: #e8740c;
    --lp-primary-rgb: 232, 116, 12;
    --lp-primary-600: #c95f04;
    --lp-primary-50: #fff4e8;
    --lp-primary-100: #ffe6cc;
    --lp-maroon: #7c2d12;
    --lp-gold: #f2b544;
    --lp-bg: #faf6f1;
    --lp-card: #ffffff;
    --lp-text: #2a1f17;
    --lp-muted: #8a7b6e;
    --lp-border: #efe5da;
    --lp-success: #16a34a;
    --lp-danger: #dc2626;
    --lp-info: #0284c7;
    --lp-side: #24150c;
    --lp-side-2: #331f12;
    --lp-radius: 16px;
    --lp-shadow: 0 1px 2px rgba(60, 30, 10, .04), 0 6px 24px rgba(60, 30, 10, .06);
    --lp-shadow-lg: 0 10px 40px rgba(60, 30, 10, .14);
    --sidebar-w: 264px;
    --appbar-h: 62px;
    --bottom-h: 68px;
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-t: env(safe-area-inset-top, 0px);

    --bs-primary: var(--lp-primary);
    --bs-primary-rgb: var(--lp-primary-rgb);
    --bs-link-color: var(--lp-primary-600);
    --bs-link-color-rgb: 201, 95, 4;
    --bs-link-hover-color: var(--lp-maroon);
    --bs-body-font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--lp-text);
    --bs-body-bg: var(--lp-bg);
    --bs-border-color: var(--lp-border);
    --bs-border-radius: 10px;
    --bs-border-radius-lg: 14px;
    --bs-focus-ring-color: rgba(var(--lp-primary-rgb), .25);
}

html { -webkit-tap-highlight-color: transparent; }
body { font-size: .93rem; background: var(--lp-bg); min-height: 100vh; overscroll-behavior-y: none; }
::selection { background: var(--lp-primary-100); }
a { text-decoration: none; }
.text-muted { color: var(--lp-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--lp-muted); font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.text-primary { color: var(--lp-primary-600) !important; }
.bg-primary-soft { background: var(--lp-primary-50) !important; }
[x-cloak] { display: none !important; }

/* ---------- Buttons ---------- */
.btn { font-weight: 500; border-radius: 10px; padding: .5rem 1rem; transition: transform .08s ease, box-shadow .2s ease, background .2s; }
.btn:active { transform: scale(.97); }
.btn-primary { --bs-btn-bg: var(--lp-primary); --bs-btn-border-color: var(--lp-primary); --bs-btn-hover-bg: var(--lp-primary-600); --bs-btn-hover-border-color: var(--lp-primary-600); --bs-btn-active-bg: var(--lp-primary-600); --bs-btn-active-border-color: var(--lp-primary-600); --bs-btn-disabled-bg: var(--lp-primary); --bs-btn-disabled-border-color: var(--lp-primary); box-shadow: 0 4px 14px rgba(var(--lp-primary-rgb), .28); }
.btn-outline-primary { --bs-btn-color: var(--lp-primary-600); --bs-btn-border-color: rgba(var(--lp-primary-rgb), .45); --bs-btn-hover-bg: var(--lp-primary); --bs-btn-hover-border-color: var(--lp-primary); --bs-btn-active-bg: var(--lp-primary-600); }
.btn-soft { background: var(--lp-primary-50); color: var(--lp-primary-600); border: 1px solid transparent; }
.btn-soft:hover { background: var(--lp-primary-100); color: var(--lp-maroon); }
.btn-light { background: #fff; border: 1px solid var(--lp-border); }
.btn-whatsapp { background: #25d366; border-color: #25d366; color: #fff; box-shadow: 0 4px 14px rgba(37, 211, 102, .3); }
.btn-whatsapp:hover { background: #1ebe5b; color: #fff; }
.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; }
.btn-sm.btn-icon { width: 32px; height: 32px; border-radius: 8px; }
.btn-lg { padding: .75rem 1.4rem; border-radius: 12px; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-radius: 10px; border-color: var(--lp-border); padding: .55rem .8rem; background-color: #fff; }
.form-control:focus, .form-select:focus { border-color: rgba(var(--lp-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--lp-primary-rgb), .15); }
.form-label { font-size: .8rem; font-weight: 500; color: #5d4c3f; margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--lp-primary); border-color: var(--lp-primary); }
.input-group-text { background: var(--lp-primary-50); border-color: var(--lp-border); color: var(--lp-primary-600); }
@media (max-width: 767.98px) { .form-control, .form-select, .ts-control input { font-size: 16px !important; } }

.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0 !important; border: 0; background: none; box-shadow: none; }
.ts-control { border-radius: 10px !important; border-color: var(--lp-border) !important; min-height: 41px; padding: .5rem .8rem !important; }
.ts-wrapper.focus .ts-control { border-color: rgba(var(--lp-primary-rgb), .6) !important; box-shadow: 0 0 0 .2rem rgba(var(--lp-primary-rgb), .15) !important; }
.ts-dropdown { border-radius: 12px; border-color: var(--lp-border); box-shadow: var(--lp-shadow-lg); overflow: hidden; z-index: 1060; }
.ts-dropdown .active { background: var(--lp-primary-50); color: var(--lp-text); }
.ts-dropdown .option { padding: .55rem .8rem; }
.ts-dropdown .optgroup-header { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-muted); font-weight: 600; background: #fcfaf7; }

/* segmented control */
.seg { display: inline-flex; background: #f3ece4; border-radius: 12px; padding: 4px; gap: 4px; width: 100%; }
.seg input { display: none; }
.seg label { flex: 1; text-align: center; padding: .45rem .7rem; border-radius: 9px; font-weight: 500; cursor: pointer; color: #6d5a4b; transition: all .15s; user-select: none; white-space: nowrap; }
.seg input:checked + label { background: #fff; color: var(--lp-primary-600); box-shadow: 0 2px 8px rgba(60, 30, 10, .1); }

/* ---------- Top loading bar ---------- */
#lp-loader { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 3000; background: linear-gradient(90deg, var(--lp-gold), var(--lp-primary), var(--lp-maroon)); box-shadow: 0 0 10px rgba(var(--lp-primary-rgb), .7); transition: width .3s ease, opacity .4s ease; opacity: 0; }
#lp-loader.on { opacity: 1; }

/* ---------- Sidebar ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: linear-gradient(180deg, var(--lp-side) 0%, var(--lp-side-2) 100%); color: #e9dccf; z-index: 1045; display: flex; flex-direction: column; transition: transform .28s cubic-bezier(.4, 0, .2, 1); padding-top: var(--safe-t); }
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.sidebar .brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(242, 181, 68, .25); }
.sidebar .brand .t1 { font-weight: 700; color: #fff; font-size: 1.08rem; line-height: 1.1; }
.sidebar .brand .t2 { font-size: .7rem; color: #c9a888; letter-spacing: .04em; }
.sidebar .nav-scroll { flex: 1; overflow-y: auto; padding: .6rem .7rem 1rem; scrollbar-width: thin; scrollbar-color: #4a3424 transparent; }
.sidebar .nav-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: #a07f63; padding: 1rem .8rem .35rem; font-weight: 600; }
.sidebar .nav-link { display: flex; align-items: center; gap: .75rem; color: #e3d3c4; padding: .58rem .8rem; border-radius: 10px; font-size: .88rem; margin-bottom: 2px; transition: background .15s, color .15s; }
.sidebar .nav-link i { width: 20px; text-align: center; color: #c79a72; font-size: .95rem; transition: color .15s; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link.active { background: linear-gradient(90deg, rgba(var(--lp-primary-rgb), .95), rgba(var(--lp-primary-rgb), .75)); color: #fff; box-shadow: 0 6px 18px rgba(var(--lp-primary-rgb), .35); }
.sidebar .nav-link.active i { color: #fff; }
.sidebar .side-foot { padding: .8rem; border-top: 1px solid rgba(255, 255, 255, .06); display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding-bottom: calc(.8rem + var(--safe-b)); }
.sidebar .side-foot .btn { color: #e9dccf; background: rgba(255, 255, 255, .06); border: 0; font-size: .78rem; padding: .45rem; }
.sidebar .side-foot .btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(20, 10, 4, .45); backdrop-filter: blur(2px); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .25s; }

.app { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- App bar ---------- */
.appbar { position: sticky; top: 0; z-index: 1030; height: calc(var(--appbar-h) + var(--safe-t)); padding: var(--safe-t) 1.5rem 0; display: flex; align-items: center; gap: .8rem; background: rgba(250, 246, 241, .85); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid rgba(239, 229, 218, .8); }
.appbar .page-title { font-weight: 600; font-size: 1.08rem; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .page-title i { color: var(--lp-primary); margin-right: .45rem; }
.appbar .date-chip { font-size: .78rem; background: #fff; border: 1px solid var(--lp-border); border-radius: 30px; padding: .3rem .8rem; color: #6d5a4b; }
.appbar .menu-btn { display: none; }
.appbar .mobile-logo { display: none; width: 34px; height: 34px; border-radius: 50%; }

main#main { flex: 1; padding: 1.4rem 1.5rem 2rem; animation: fadeUp .28s ease; }
.htmx-swapping #main, #main.htmx-swapping { opacity: .6; transition: opacity .1s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-enter { animation: fadeUp .28s ease; }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav { display: none; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-102%); box-shadow: var(--lp-shadow-lg); }
    body.side-open .sidebar { transform: none; }
    body.side-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
    .app { margin-left: 0; }
    .appbar { padding-left: .8rem; padding-right: .8rem; }
    .appbar .menu-btn { display: inline-flex; }
    .appbar .date-chip { display: none; }
    main#main { padding: 1rem .85rem calc(var(--bottom-h) + var(--safe-b) + 1.4rem); }
    .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; height: calc(var(--bottom-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--lp-border); box-shadow: 0 -6px 24px rgba(60, 30, 10, .06); }
    .bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; color: #8a7b6e; background: none; border: 0; font-weight: 500; position: relative; }
    .bottom-nav i { font-size: 1.15rem; transition: transform .2s; }
    .bottom-nav a.active { color: var(--lp-primary-600); }
    .bottom-nav a.active i { transform: translateY(-2px); }
    .bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 4px 4px; background: var(--lp-primary); }
    .bottom-nav .fab { margin-top: -26px; }
    .bottom-nav .fab span.circle { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--lp-gold), var(--lp-primary) 55%, var(--lp-primary-600)); color: #fff; box-shadow: 0 8px 22px rgba(var(--lp-primary-rgb), .5); border: 4px solid #fff; }
    .bottom-nav .fab i { font-size: 1.35rem; color: #fff; }
    .bottom-nav .fab.active::before { display: none; }
}
@media (max-width: 575.98px) { .appbar .mobile-logo { display: block; } }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--lp-border); border-radius: var(--lp-radius); box-shadow: var(--lp-shadow); background: var(--lp-card); }
.card-header { background: transparent; border-bottom: 1px solid var(--lp-border); padding: .9rem 1.15rem; font-weight: 600; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.card-header .ch-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--lp-primary-50); color: var(--lp-primary-600); display: inline-flex; align-items: center; justify-content: center; }
.card-body { padding: 1.15rem; }
@media (max-width: 575.98px) { .card-body { padding: .95rem; } .card-header { padding: .8rem .95rem; } }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head h1 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--lp-muted); font-size: .85rem; }

/* KPI tiles */
.kpi { position: relative; overflow: hidden; border-radius: var(--lp-radius); padding: 1rem 1.1rem; background: #fff; border: 1px solid var(--lp-border); box-shadow: var(--lp-shadow); height: 100%; }
.kpi .k-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: .7rem; }
.kpi .k-label { font-size: .76rem; color: var(--lp-muted); font-weight: 500; }
.kpi .k-value { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.kpi .k-foot { font-size: .74rem; color: var(--lp-muted); margin-top: .2rem; }
.kpi::after { content: ""; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .05; }
.kpi.hero { background: linear-gradient(135deg, #f59e0b 0%, var(--lp-primary) 45%, var(--lp-maroon) 120%); color: #fff; border: 0; box-shadow: 0 12px 30px rgba(var(--lp-primary-rgb), .35); }
.kpi.hero .k-label, .kpi.hero .k-foot { color: rgba(255, 255, 255, .85); }
.kpi.hero .k-icon { background: rgba(255, 255, 255, .2); color: #fff; }
.tone-orange { background: #fff1e3; color: #c2570c; }
.tone-green { background: #e8f8ee; color: #15803d; }
.tone-blue { background: #e6f3fb; color: #0369a1; }
.tone-red { background: #fdecec; color: #b91c1c; }
.tone-purple { background: #f1ebfd; color: #6d28d9; }
.tone-gold { background: #fdf5dd; color: #a16207; }
@media (max-width: 575.98px) { .kpi { padding: .85rem; } .kpi .k-value { font-size: 1.1rem; } .kpi .k-icon { width: 36px; height: 36px; margin-bottom: .5rem; } }

.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 230px; }
@media (max-width: 575.98px) { .chart-box { height: 230px; } }

/* Quick actions */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.quick-grid a { background: #fff; border: 1px solid var(--lp-border); border-radius: 14px; padding: .8rem .3rem; text-align: center; color: var(--lp-text); font-size: .74rem; font-weight: 500; box-shadow: var(--lp-shadow); transition: transform .12s; }
.quick-grid a:active { transform: scale(.96); }
.quick-grid a i { display: flex; margin: 0 auto .4rem; width: 40px; height: 40px; border-radius: 12px; align-items: center; justify-content: center; font-size: 1rem; }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-striped-bg: #fcf9f6; --bs-table-hover-bg: #fff6ec; margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: #8a7262; font-weight: 600; background: #fcf8f4; border-bottom: 1px solid var(--lp-border); white-space: nowrap; padding: .7rem .75rem; }
.table > tbody td { padding: .65rem .75rem; vertical-align: middle; border-color: #f4ece3; }
.table > tfoot td, .table > tfoot th { background: #fcf8f4; font-weight: 600; }
.table-sm > tbody td { padding: .4rem .55rem; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable::after { content: "\f0dc"; font-family: "Font Awesome 6 Free"; font-weight: 900; margin-left: .35rem; opacity: .3; font-size: .7rem; }
th.sort-asc::after { content: "\f0de"; opacity: .9; color: var(--lp-primary); }
th.sort-desc::after { content: "\f0dd"; opacity: .9; color: var(--lp-primary); }
.lpt-toolbar { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; padding: .75rem 1rem; border-bottom: 1px solid var(--lp-border); }
.lpt-toolbar .lpt-search { position: relative; flex: 1 1 200px; max-width: 320px; }
.lpt-toolbar .lpt-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--lp-muted); font-size: .8rem; }
.lpt-toolbar .lpt-search input { padding-left: 2rem; height: 36px; font-size: .85rem; }
.lpt-toolbar .form-select { width: auto; height: 36px; font-size: .82rem; padding-top: .3rem; padding-bottom: .3rem; }
.lpt-toolbar .btn { height: 36px; font-size: .8rem; padding: .3rem .7rem; }
.lpt-footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--lp-border); font-size: .8rem; color: var(--lp-muted); flex-wrap: wrap; }
.lpt-pages { display: flex; gap: 4px; flex-wrap: wrap; }
.lpt-pages button { min-width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--lp-border); background: #fff; font-size: .78rem; color: var(--lp-text); }
.lpt-pages button.on { background: var(--lp-primary); border-color: var(--lp-primary); color: #fff; }
.lpt-pages button:disabled { opacity: .45; }
.lpt-empty td { text-align: center; color: var(--lp-muted); padding: 2rem !important; }

/* status badges */
.badge-soft { padding: .35em .7em; border-radius: 30px; font-weight: 500; font-size: .72rem; }
.b-credit { background: #fff1e3; color: #c2570c; }
.b-cash { background: #e8f8ee; color: #15803d; }
.b-dr { background: #fdecec; color: #b91c1c; }
.b-cr { background: #e6f3fb; color: #0369a1; }
.b-muted { background: #f3ede7; color: #7a6a5c; }

.items-mini { width: 100%; font-size: .78rem; }
.items-mini td { padding: .12rem .35rem !important; border: 0 !important; }
.items-mini tr + tr td { border-top: 1px dashed #efe3d6 !important; }

/* ---------- Sale entry ---------- */
.bill-no { display: inline-flex; align-items: center; gap: .45rem; background: linear-gradient(135deg, var(--lp-primary), var(--lp-maroon)); color: #fff; border-radius: 10px; padding: .45rem .9rem; font-weight: 700; font-size: 1rem; letter-spacing: .03em; box-shadow: 0 4px 14px rgba(var(--lp-primary-rgb), .3); }
.bal-card { border-radius: 14px; padding: .75rem .9rem; border: 1px dashed rgba(var(--lp-primary-rgb), .4); background: var(--lp-primary-50); }
.bal-card .v { font-size: 1.15rem; font-weight: 700; }
.add-row { background: #fcf8f4; border: 1px solid var(--lp-border); border-radius: 14px; padding: .8rem; }
.item-list .item { display: grid; grid-template-columns: 28px 1fr 110px 110px 120px 40px; gap: .6rem; align-items: center; padding: .6rem .5rem; border-bottom: 1px solid #f3ebe2; animation: fadeUp .2s ease; }
.item-list .item.head { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--lp-muted); font-weight: 600; border-bottom: 1px solid var(--lp-border); padding-top: .2rem; }
.item-list .item .num { width: 26px; height: 26px; border-radius: 8px; background: var(--lp-primary-50); color: var(--lp-primary-600); display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 600; }
.item-list .item input { height: 36px; padding: .3rem .55rem; text-align: right; }
.item-list .item .amt { text-align: right; font-weight: 600; }
.item-list .empty { text-align: center; color: var(--lp-muted); padding: 2rem 1rem; }
.item-list .empty i { font-size: 2rem; color: #e8d6c4; display: block; margin-bottom: .5rem; }
@media (max-width: 767.98px) {
    .item-list .item { grid-template-columns: 26px 1fr 1fr 36px; grid-template-areas: "n p p x" "n q r r" "n a a a"; row-gap: .4rem; background: #fff; border: 1px solid var(--lp-border); border-radius: 12px; margin-bottom: .55rem; padding: .65rem; }
    .item-list .item.head { display: none; }
    .item-list .item > :nth-child(1) { grid-area: n; align-self: start; }
    .item-list .item > :nth-child(2) { grid-area: p; font-weight: 600; }
    .item-list .item > :nth-child(3) { grid-area: q; }
    .item-list .item > :nth-child(4) { grid-area: r; }
    .item-list .item > :nth-child(5) { grid-area: a; text-align: right; }
    .item-list .item > :nth-child(6) { grid-area: x; justify-self: end; align-self: start; }
    .item-list .item .lbl { display: block !important; font-size: .65rem; color: var(--lp-muted); text-transform: uppercase; margin-bottom: 2px; text-align: left; }
}
.totals { background: linear-gradient(180deg, #fffaf5, #fff4e8); border: 1px solid var(--lp-primary-100); border-radius: 14px; padding: 1rem; }
.totals .row-t { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; font-size: .9rem; }
.totals .grand { border-top: 1px dashed rgba(var(--lp-primary-rgb), .4); margin-top: .35rem; padding-top: .65rem; font-size: 1.25rem; font-weight: 700; color: var(--lp-maroon); }
.sticky-submit { position: sticky; bottom: 0; z-index: 5; }
@media (max-width: 991.98px) { .sticky-submit { bottom: calc(var(--bottom-h) + var(--safe-b)); background: linear-gradient(180deg, rgba(250, 246, 241, 0), var(--lp-bg) 35%); padding: .8rem 0 .4rem; margin: 0 -.2rem; } }

/* success sheet */
.success-icon { width: 76px; height: 76px; border-radius: 50%; background: #e8f8ee; color: var(--lp-success); display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 0 auto 1rem; animation: pop .45s cubic-bezier(.2, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-content { border: 0; border-radius: 20px; box-shadow: var(--lp-shadow-lg); }
.modal-header { border-bottom-color: var(--lp-border); }
.modal-footer { border-top-color: var(--lp-border); }
@media (max-width: 575.98px) {
    .modal.sheet .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; top: auto; max-width: none; min-height: 0 !important; height: auto !important; max-height: 94vh; display: flex; align-items: flex-end; transform: translateY(100%); transition: transform .28s ease !important; }
    .modal.sheet .modal-dialog > .modal-content { width: 100%; }
    .modal.sheet.show .modal-dialog { transform: none; }
    .modal.sheet .modal-content { border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); max-height: 92vh; }
}

/* ---------- Attendance ---------- */
.att-list { display: flex; flex-direction: column; gap: .55rem; }
.att-row { display: grid; grid-template-columns: 44px 1fr auto 110px; gap: .8rem; align-items: center; background: #fff; border: 1px solid var(--lp-border); border-radius: 14px; padding: .65rem .8rem; transition: border-color .15s, background .15s; }
.att-row.s-A { border-color: #f6c7c7; background: #fff8f8; }
.att-row.s-H { border-color: #f7dfae; background: #fffbf1; }
.att-row.s-W { border-color: #bfdcf2; background: #f6fbff; }
.att-row .avatar { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .95rem; }
.att-row .nm { font-weight: 600; line-height: 1.2; }
.att-row .meta { font-size: .72rem; color: var(--lp-muted); }
.att-status { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; background: #f3ece4; padding: 4px; border-radius: 12px; }
.att-status button { border: 0; background: transparent; border-radius: 9px; padding: .45rem .7rem; font-weight: 600; font-size: .78rem; color: #7a6656; min-width: 52px; transition: all .12s; }
.att-status button.on.P { background: var(--lp-success); color: #fff; box-shadow: 0 3px 10px rgba(22, 163, 74, .35); }
.att-status button.on.A { background: var(--lp-danger); color: #fff; box-shadow: 0 3px 10px rgba(220, 38, 38, .35); }
.att-status button.on.H { background: #f59e0b; color: #fff; box-shadow: 0 3px 10px rgba(245, 158, 11, .35); }
.att-status button.on.W { background: var(--lp-info); color: #fff; box-shadow: 0 3px 10px rgba(2, 132, 199, .35); }
.att-hours input { text-align: center; height: 40px; }
.att-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.att-summary div { border-radius: 12px; padding: .55rem; text-align: center; font-size: .7rem; font-weight: 500; }
.att-summary b { display: block; font-size: 1.2rem; }
@media (max-width: 767.98px) {
    .att-row { grid-template-columns: 40px 1fr 84px; grid-template-areas: "a n h" "s s s"; row-gap: .55rem; }
    .att-row .avatar { grid-area: a; width: 40px; height: 40px; }
    .att-row .who { grid-area: n; }
    .att-row .att-status { grid-area: s; grid-template-columns: repeat(4, 1fr); }
    .att-row .att-hours { grid-area: h; }
    .att-status button { padding: .55rem .2rem; min-width: 0; font-size: .74rem; }
}
.att-grid td, .att-grid th { text-align: center; padding: .35rem .3rem !important; font-size: .74rem; min-width: 30px; }
.att-grid td.emp, .att-grid th.emp { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 150px; font-weight: 500; }
.att-grid th.emp { background: #fcf8f4; }
.c-P { background: #e8f8ee !important; color: #15803d; font-weight: 600; }
.c-A { background: #fdecec !important; color: #b91c1c; font-weight: 600; }
.c-H { background: #fdf3dc !important; color: #a16207; font-weight: 600; }
.c-W { background: #e6f3fb !important; color: #0369a1; font-weight: 600; }
.c-off { color: #d7c9bb; }

/* ---------- Salary ---------- */
.sal-card { border: 1px solid var(--lp-border); border-radius: 14px; background: #fff; overflow: hidden; }
.sal-card .top { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border-bottom: 1px dashed var(--lp-border); }
.sal-card .lines { padding: .7rem 1rem; font-size: .82rem; }
.sal-card .lines div { display: flex; justify-content: space-between; padding: .18rem 0; }
.sal-card .net { display: flex; justify-content: space-between; align-items: center; padding: .7rem 1rem; background: var(--lp-primary-50); font-weight: 700; color: var(--lp-maroon); }

/* ---------- Empty / misc ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--lp-muted); }
.empty-state i { font-size: 2.6rem; color: #e8d6c4; margin-bottom: .8rem; }
.avatar-sm { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; color: #fff; flex-shrink: 0; }
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid #f3ebe2; }
.list-row:last-child { border-bottom: 0; }
.divider-text { display: flex; align-items: center; gap: .6rem; color: var(--lp-muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; margin: 1rem 0 .6rem; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--lp-border); }
.filter-bar { background: #fff; border: 1px solid var(--lp-border); border-radius: var(--lp-radius); padding: .85rem 1rem; margin-bottom: 1rem; box-shadow: var(--lp-shadow); }
.filter-bar .form-label { margin-bottom: .2rem; }
.nav-pills .nav-link { color: #6d5a4b; border-radius: 10px; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--lp-primary); }
.dropdown-menu { border-color: var(--lp-border); border-radius: 12px; box-shadow: var(--lp-shadow-lg); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; font-size: .88rem; }
.dropdown-item i { width: 20px; color: var(--lp-primary); }
.dropdown-item:active { background: var(--lp-primary); }

/* Notyf tweaks */
.notyf__toast { border-radius: 12px !important; font-family: Poppins, sans-serif; }
.notyf { padding-bottom: calc(var(--bottom-h) + var(--safe-b)) !important; }
@media (min-width: 992px) { .notyf { padding-bottom: 20px !important; } }

/* Update banner */
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + var(--safe-b) + 12px); z-index: 2000; background: var(--lp-side); color: #fff; border-radius: 14px; padding: .6rem .7rem .6rem 1rem; display: flex; gap: .8rem; align-items: center; box-shadow: var(--lp-shadow-lg); font-size: .85rem; width: max-content; max-width: 92vw; }
@media (min-width: 992px) { .update-bar { bottom: 20px; } }

@media print {
    .sidebar, .appbar, .bottom-nav, .no-print, .lpt-toolbar, .lpt-footer, .notyf, .update-bar { display: none !important; }
    .app { margin: 0 !important; }
    main#main { padding: 0 !important; }
    body { background: #fff !important; }
    .card { box-shadow: none !important; border: 0 !important; }
}
@media (min-width: 1200px) { .sticky-xl { position: sticky; top: calc(var(--appbar-h) + 12px); } }

/* =====================================================================
   Printable documents (Bill / Receipt)
   ===================================================================== */
.doc-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.sheet-box { width: 100%; max-width: 794px; margin: 0 auto; overflow: hidden; }
.sheet { width: 794px; background: #fff; color: #2a1f17; font-family: Poppins, Arial, sans-serif; font-size: 12.5px; box-shadow: 0 10px 40px rgba(60, 30, 10, .14); border-radius: 6px; position: relative; display: flex; flex-direction: column; }
.sheet.a4 { min-height: 1122px; }
.sheet .band { height: 10px; background: linear-gradient(90deg, #f2b544, #e8740c 40%, #7c2d12); border-radius: 6px 6px 0 0; }
.sheet .pad { padding: 26px 34px; }
.sheet .hdr { display: flex; gap: 18px; align-items: flex-start; padding-bottom: 16px; border-bottom: 2px solid #f4e3d1; }
.sheet .hdr img { width: 78px; height: 78px; border-radius: 50%; }
.sheet .biz { flex: 1; }
.sheet .biz .nm { font-size: 26px; font-weight: 700; color: #7c2d12; line-height: 1.05; letter-spacing: -.01em; }
.sheet .biz .tg { color: #e8740c; font-weight: 500; font-size: 12px; margin: 2px 0 6px; }
.sheet .biz .ad { color: #6d5a4b; font-size: 11.5px; line-height: 1.5; max-width: 380px; }
.sheet .doc-title { text-align: right; }
.sheet .doc-title .tt { display: inline-block; background: #7c2d12; color: #fff; font-weight: 600; letter-spacing: .18em; font-size: 13px; padding: 6px 14px; border-radius: 6px; margin-bottom: 10px; }
.sheet .doc-title table td { padding: 2px 0 2px 12px; font-size: 12px; }
.sheet .doc-title table td:first-child { color: #8a7b6e; text-align: right; }
.sheet .doc-title table td:last-child { font-weight: 600; text-align: right; }
.sheet .pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.sheet .pill.credit { background: #fff1e3; color: #c2570c; }
.sheet .pill.cash { background: #e8f8ee; color: #15803d; }
.sheet .parties { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin: 18px 0; }
.sheet .box { border: 1px solid #f0e2d3; border-radius: 10px; padding: 12px 14px; background: #fffbf7; }
.sheet .box .lb { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #a07f63; font-weight: 600; margin-bottom: 4px; }
.sheet .box .cn { font-size: 16px; font-weight: 700; color: #2a1f17; }
.sheet .box .sm { font-size: 11.5px; color: #6d5a4b; }
.sheet .box .kv { display: flex; justify-content: space-between; font-size: 12px; padding: 2px 0; }
.sheet table.items { width: 100%; border-collapse: separate; border-spacing: 0; }
.sheet table.items th { background: #7c2d12; color: #fff; font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 9px 10px; text-align: left; }
.sheet table.items th:first-child { border-radius: 8px 0 0 8px; }
.sheet table.items th:last-child { border-radius: 0 8px 8px 0; }
.sheet table.items td { padding: 9px 10px; border-bottom: 1px solid #f4ebe1; }
.sheet table.items tr:nth-child(even) td { background: #fffaf5; }
.sheet .r { text-align: right !important; }
.sheet .c { text-align: center !important; }
.sheet .grow { flex: 1; }
.sheet .sum { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin-top: 16px; }
.sheet .totals-box { border: 1px solid #f0e2d3; border-radius: 10px; overflow: hidden; }
.sheet .totals-box .kv { display: flex; justify-content: space-between; padding: 7px 14px; font-size: 12.5px; }
.sheet .totals-box .kv + .kv { border-top: 1px dashed #f0e2d3; }
.sheet .totals-box .gt { background: linear-gradient(90deg, #e8740c, #7c2d12); color: #fff; font-size: 16px; font-weight: 700; border-top: 0 !important; }
.sheet .words { font-size: 11.5px; color: #6d5a4b; margin-bottom: 12px; }
.sheet .words b { color: #2a1f17; }
.sheet .pay { display: flex; gap: 14px; align-items: center; border: 1px dashed #e8c9a8; border-radius: 10px; padding: 10px 12px; }
.sheet .pay img { width: 104px; height: 104px; border-radius: 6px; }
.sheet .pay .lb { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: #a07f63; font-weight: 600; }
.sheet .pay .kv { font-size: 11.5px; line-height: 1.6; }
.sheet .foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-top: 22px; padding-top: 14px; border-top: 1px solid #f4e3d1; }
.sheet .terms { font-size: 10.5px; color: #8a7b6e; white-space: pre-line; max-width: 420px; }
.sheet .sign { text-align: center; font-size: 11px; color: #6d5a4b; min-width: 180px; }
.sheet .sign .ln { border-top: 1px solid #c9b5a3; margin-top: 46px; padding-top: 4px; }
.sheet .thanks { text-align: center; color: #e8740c; font-weight: 600; margin-top: 18px; font-size: 13px; }
.sheet .meta { text-align: center; color: #b8a796; font-size: 9.5px; margin-top: 4px; }
.sheet .stamp { position: absolute; right: 60px; top: 210px; border: 3px solid rgba(22, 163, 74, .55); color: rgba(22, 163, 74, .65); font-weight: 800; font-size: 26px; padding: 4px 16px; border-radius: 10px; transform: rotate(-12deg); letter-spacing: .12em; }
.sheet .amount-hero { text-align: center; padding: 18px; border-radius: 12px; background: linear-gradient(135deg, #fff7ee, #ffeedd); border: 1px solid #f6dcc0; margin: 16px 0; }
.sheet .amount-hero .v { font-size: 32px; font-weight: 700; color: #7c2d12; }
.public-bar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--lp-border); padding: .6rem 1rem; padding-top: calc(.6rem + var(--safe-t)); display: flex; align-items: center; gap: .6rem; }
@media print {
    @page { size: A4; margin: 0; }
    html, body { background: #fff !important; }
    .doc-actions, .public-bar { display: none !important; }
    .sheet-box { max-width: none !important; height: auto !important; overflow: visible !important; }
    .sheet { transform: none !important; box-shadow: none !important; border-radius: 0 !important; width: 210mm !important; }
    .sheet.a4 { min-height: 296mm; }
    .page-enter, main#main { animation: none !important; }
}
.lpt-toolbar .lpt-size { min-width: 78px; padding-right: 2rem; }
.ts-wrapper.form-select .ts-control, .ts-wrapper.single .ts-control { border: 1px solid var(--lp-border) !important; background-color: #fff !important; box-shadow: none; }
.ts-wrapper.single .ts-control::after { border-color: #8a7b6e transparent transparent !important; }
.table-compact > tbody td, .table-compact > thead th { padding-left: .5rem; padding-right: .5rem; font-size: .84rem; }
