/*
 * Vyomakesha ERP — theme taken from the approved prototype (artifact "Vyomakesha ERP — LPG supply application").
 * Plain CSS, no build step; loaded after Filament's own CSS (render hook in AdminPanelProvider), so these rules win.
 * Palette and sizes mirror the prototype's :root variables; dark mode keeps the same structure on deep navy.
 */
:root {
    --p-bg: #f4f5f7; --p-surface: #fff; --p-surface-2: #f9fafb; --p-line: #e3e6ea; --p-line-2: #d0d5dc;
    --p-ink: #16202c; --p-ink-2: #4a5565; --p-ink-3: #7a8494;
    --p-nav: #101b2b; --p-nav-2: #1a2840; --p-nav-ink: #c9d2df; --p-nav-ink-2: #7f8da3;
    --p-brand: #d9480f; --p-brand-2: #fff1e8; --p-brand-ink: #a2360b;
    --p-blue: #1c6dd0; --p-blue-2: #e8f1fc;
    --p-good: #1f8a4c; --p-good-2: #e6f5ec; --p-warn: #b26a00; --p-warn-2: #fff5e0; --p-bad: #c92a2a; --p-bad-2: #fdecec;
    --p-radius: 8px; --p-shadow: 0 1px 2px rgba(16, 27, 43, .06), 0 2px 8px rgba(16, 27, 43, .05);
    /* older names still used by custom screens */
    --erp-card: var(--p-surface); --erp-line: var(--p-line); --erp-ink: var(--p-ink); --erp-muted: var(--p-ink-3);
    --erp-shadow: var(--p-shadow); --erp-radius: var(--p-radius);
}
.dark {
    --p-bg: #0b1220; --p-surface: #111a2c; --p-surface-2: #0e1626; --p-line: #1f2b41; --p-line-2: #2b3a55;
    --p-ink: #e5e9f0; --p-ink-2: #b8c1cf; --p-ink-3: #8592a6; --p-brand-2: rgba(217, 72, 15, .16); --p-blue-2: rgba(28, 109, 208, .18);
    --p-good-2: rgba(31, 138, 76, .18); --p-warn-2: rgba(178, 106, 0, .2); --p-bad-2: rgba(201, 42, 42, .2);
    --p-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
}

/* ---------- canvas & type ---------- */
body.fi-body, .fi-layout { background: var(--p-bg); color: var(--p-ink); font-size: 14px; }
.fi-main { padding: 22px 26px 60px !important; }
@media (max-width: 900px) { .fi-main { padding: 16px 14px 60px !important; } }

/* ---------- sidebar (236px, navy, orange active item) ---------- */
.fi-sidebar { background: var(--p-nav) !important; border-inline-end: 0 !important; box-shadow: none !important; }
@media (min-width: 1024px) { .fi-body:not(.fi-body-has-sidebar-collapsed) .fi-sidebar.fi-sidebar-open { width: 236px; } }
.fi-sidebar-header { background: var(--p-nav) !important; border-bottom: 0 !important; box-shadow: none !important; }
.fi-sidebar-nav { padding: 6px 10px 30px !important; gap: 0 !important; }
.fi-sidebar .fi-sidebar-group-label { color: var(--p-nav-ink-2) !important; font-size: 10.5px !important; text-transform: uppercase; letter-spacing: .08em; font-weight: 500 !important; }
.fi-sidebar .fi-sidebar-group-btn { padding: 14px 10px 6px !important; }
.fi-sidebar .fi-sidebar-group-collapse-btn, .fi-sidebar .fi-sidebar-group-btn svg { color: var(--p-nav-ink-2) !important; }
.fi-sidebar .fi-sidebar-item-btn { border-radius: 6px !important; padding: 7px 10px !important; gap: 10px !important; }
.fi-sidebar .fi-sidebar-item-label { color: var(--p-nav-ink) !important; font-size: 13.5px !important; font-weight: 400 !important; }
.fi-sidebar .fi-sidebar-item-icon { color: var(--p-nav-ink) !important; opacity: .85; width: 16px !important; height: 16px !important; }
.fi-sidebar .fi-sidebar-item-btn:hover { background: var(--p-nav-2) !important; }
.fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-label, .fi-sidebar .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #fff !important; }
.fi-sidebar .fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background: var(--p-brand) !important; box-shadow: none !important; }
.fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-label, .fi-sidebar .fi-sidebar-item.fi-active .fi-sidebar-item-icon { color: #fff !important; opacity: 1; }
.fi-sidebar .fi-sidebar-item-grouped-border-part { background: rgba(255, 255, 255, .15) !important; }
.fi-sidebar .fi-icon-btn, .fi-sidebar-header .fi-icon-btn svg { color: var(--p-nav-ink) !important; }
.fi-sidebar-nav::-webkit-scrollbar { width: 6px; }
.fi-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }
.erp-side-footer { padding: 0 10px 18px; }
.erp-side-footer .erp-grp { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--p-nav-ink-2); margin: 14px 10px 6px; }
.erp-side-footer button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--p-nav-ink); padding: 7px 10px; border-radius: 6px; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; }
.erp-side-footer button:hover { background: var(--p-nav-2); color: #fff; }

/* ---------- topbar (56px, white, search, chips, bell, user) ---------- */
.fi-topbar { background: var(--p-surface) !important; border-bottom: 1px solid var(--p-line) !important; box-shadow: none !important; min-height: 56px; }
.fi-topbar-ctn { box-shadow: none !important; }
.fi-topbar .fi-global-search-field .fi-input-wrp, .fi-topbar .fi-global-search .fi-input-wrp { background: var(--p-surface-2) !important; min-width: 340px; }
@media (max-width: 900px) { .fi-topbar .fi-global-search .fi-input-wrp { min-width: 0; } .erp-chip, .erp-user-text { display: none !important; } }
.erp-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--p-line); border-radius: 999px; padding: 4px 10px; font-size: 12px; color: var(--p-ink-2); background: var(--p-surface); white-space: nowrap; }
.erp-topbar-extras { display: flex; align-items: center; gap: 12px; margin-inline: 12px; }
.erp-bell { position: relative; border: 1px solid var(--p-line); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; background: var(--p-surface); color: var(--p-ink-2); }
.erp-bell:hover { border-color: var(--p-ink-3); text-decoration: none; }
.erp-bell .erp-dot { position: absolute; top: -4px; right: -4px; background: var(--p-bad); color: #fff; border-radius: 999px; font-size: 10px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; }
.erp-user-text { font-size: 12px; line-height: 1.3; margin-inline-end: 8px; }
.erp-user-text b { font-weight: 600; color: var(--p-ink); } .erp-user-text span { color: var(--p-ink-3); }
.fi-user-menu .fi-avatar, .fi-topbar .fi-avatar { background: var(--p-blue-2) !important; color: var(--p-blue) !important; font-weight: 600; }

/* ---------- page header ---------- */
.fi-header { margin-bottom: 18px !important; }
.fi-header-heading { font-size: 22px !important; font-weight: 600 !important; letter-spacing: -.01em; color: var(--p-ink); line-height: 1.3 !important; }
.fi-header-subheading { color: var(--p-ink-2) !important; font-size: 14px !important; margin-top: 4px; }
.fi-breadcrumbs-item-label { color: var(--p-ink-3); font-size: 12px; }

/* ---------- cards: sections, tables, widgets, custom ERP cards ---------- */
.fi-section, .fi-ta-ctn, .fi-wi-stats-overview-stat, .erp-card, .erp-tile, .p-card, .p-tile {
    background: var(--p-surface) !important; border: 1px solid var(--p-line) !important; border-radius: var(--p-radius) !important;
    box-shadow: var(--p-shadow) !important; --tw-ring-shadow: 0 0 #0000 !important;
}
.fi-section-header { border-bottom: 1px solid var(--p-line); padding: 14px 16px !important; }
.fi-section-header-heading { font-size: 15px !important; font-weight: 600 !important; letter-spacing: -.01em; }

/* ---------- tables ---------- */
.fi-ta-header-cell, .erp-table th, .p-table th {
    background: var(--p-surface-2) !important; color: var(--p-ink-3) !important;
    font-size: 11.5px !important; text-transform: uppercase; letter-spacing: .03em; font-weight: 600 !important; white-space: nowrap;
}
.fi-ta-cell, .erp-table td { font-size: 13px; }
.fi-ta-row:hover > td, .erp-table tbody tr:hover td, .p-table tbody tr:hover td { background: #fbfbfc; }
.dark .fi-ta-row:hover > td, .dark .erp-table tbody tr:hover td, .dark .p-table tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.erp-table td { border-bottom-color: var(--p-line) !important; }
.erp-table tfoot td { font-weight: 600; background: var(--p-surface-2); border-top: 1px solid var(--p-line-2); }

/* ---------- buttons, badges, inputs ---------- */
.fi-btn { border-radius: 6px !important; font-weight: 500 !important; font-size: 13px !important; }
.fi-btn.fi-color-primary:not(.fi-outlined) { background: var(--p-brand) !important; background-image: none !important; box-shadow: none !important; border: 1px solid var(--p-brand); }
.fi-btn.fi-color-primary:not(.fi-outlined):hover { background: var(--p-brand-ink) !important; filter: none; }
.fi-btn.fi-color-gray:not(.fi-outlined) { background: var(--p-surface) !important; border: 1px solid var(--p-line-2); color: var(--p-ink) !important; }
.fi-badge { border-radius: 999px !important; font-size: 11px !important; font-weight: 600 !important; }
.fi-input-wrp { border-radius: 6px !important; }

/* ---------- prototype building blocks (dashboard, alerts) ---------- */
.p-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.p-head h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 0; color: var(--p-ink); }
.p-head p { margin: 4px 0 0; color: var(--p-ink-2); }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.p-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 500; border: 1px solid var(--p-line-2); background: var(--p-surface); color: var(--p-ink); padding: 7px 12px; border-radius: 6px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.p-btn:hover { border-color: var(--p-ink-3); text-decoration: none; }
.p-btn.pri { background: var(--p-brand); border-color: var(--p-brand); color: #fff; } .p-btn.pri:hover { background: var(--p-brand-ink); }
.p-grid { display: grid; gap: 16px; }
.p-g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .p-g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .p-g21 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1100px) { .p-g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .p-g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .p-g5, .p-g3, .p-g21 { grid-template-columns: 1fr; } }
.p-tile { display: block; padding: 14px 16px; color: inherit; text-decoration: none; }
a.p-tile:hover { border-color: var(--p-brand) !important; text-decoration: none; }
.p-tile .lbl { font-size: 12px; color: var(--p-ink-3); }
.p-tile .val { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--p-ink); }
.p-tile .sub { font-size: 12px; color: var(--p-ink-2); margin-top: 4px; }
.p-card .hd { padding: 14px 16px; border-bottom: 1px solid var(--p-line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.p-card .hd h3 { font-size: 15px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.p-card .bd { padding: 16px; } .p-card .bd.flush { padding: 0; }
.p-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-table th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--p-line); }
.p-table td { padding: 9px 12px; border-bottom: 1px solid var(--p-line); vertical-align: top; }
.p-table tr:last-child td { border-bottom: 0; }
.p-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-muted { color: var(--p-ink-3); } .p-small { font-size: 12px; } .p-empty { padding: 28px; text-align: center; color: var(--p-ink-3); }
.p-b { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--p-surface-2); color: var(--p-ink-2); border: 1px solid var(--p-line); white-space: nowrap; }
.p-b.good { background: var(--p-good-2); color: var(--p-good); border-color: #bfe3cc; }
.p-b.warn { background: var(--p-warn-2); color: var(--p-warn); border-color: #f0dcb4; }
.p-b.bad { background: var(--p-bad-2); color: var(--p-bad); border-color: #f3c2c2; }
.p-b.blue { background: var(--p-blue-2); color: var(--p-blue); border-color: #c4dbf6; }
.p-b.brand { background: var(--p-brand-2); color: var(--p-brand-ink); border-color: #f6cdb5; }
.p-link { color: var(--p-blue); font-size: 12px; text-decoration: none; } .p-link:hover { text-decoration: underline; }
.p-bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; border-bottom: 1px solid var(--p-line-2); }
.p-bcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.p-bar { width: 100%; max-width: 26px; background: var(--p-blue); border-radius: 4px 4px 0 0; min-height: 2px; }
.p-bcol:hover .p-bar { background: #1557a8; }
.p-bcol .tip { display: none; position: absolute; bottom: 100%; background: var(--p-ink); color: #fff; font-size: 11px; padding: 4px 7px; border-radius: 4px; white-space: nowrap; z-index: 5; }
.dark .p-bcol .tip { background: #000; }
.p-bcol:hover .tip { display: block; }
.p-bar-x { display: flex; gap: 4px; font-size: 10px; color: var(--p-ink-3); margin-top: 4px; } .p-bar-x span { flex: 1; text-align: center; }
.p-hbar { display: grid; grid-template-columns: 150px 1fr 110px; gap: 10px; align-items: center; font-size: 12.5px; margin-bottom: 8px; }
.p-hbar .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-hbar .track { height: 10px; background: var(--p-surface-2); border-radius: 4px; overflow: hidden; }
.p-hbar .fill { height: 100%; background: var(--p-blue); border-radius: 0 4px 4px 0; }
@media (max-width: 720px) { .p-hbar { grid-template-columns: 110px 1fr 90px; } }
.p-alert { padding: 8px 0; border-bottom: 1px solid var(--p-line); } .p-alert:last-child { border-bottom: 0; }
.p-alert .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.p-alert .d { font-size: 12px; margin-top: 4px; color: var(--p-ink); }

/* ---------- custom ERP screens (billing run, stock, customer 360, reports) ---------- */
.erp-tile { position: relative; overflow: hidden; padding: 14px 16px !important; }
.erp-tile .l { font-size: 12px !important; color: var(--p-ink-3); opacity: 1 !important; }
.erp-tile .v { font-size: 22px !important; font-weight: 600 !important; color: var(--p-ink); }
.erp-card h3 { font-size: 15px; font-weight: 600; padding: 14px 16px !important; border-bottom: 1px solid var(--p-line); }
.erp-filters { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: var(--p-radius); padding: 12px 16px; box-shadow: var(--p-shadow); }
.erp-alert { display: flex; gap: .75rem; align-items: center; padding: .6rem .25rem; border-bottom: 1px solid var(--p-line); }
.erp-alert:last-child { border-bottom: 0; }
.erp-alert .erp-dot { width: 9px; height: 9px; border-radius: 999px; flex: none; }

/* ---------- sign-in, reset password & other simple pages (prototype "Login") ---------- */
:root { --erp-p-nav: #101b2b; --erp-p-nav-ink: #c9d2df; --erp-p-nav-ink-2: #7f8da3; --erp-p-brand: #d9480f; --erp-p-brand-2: #fff1e8;
        --erp-p-ink: #16202c; --erp-p-ink-2: #4a5565; --erp-p-ink-3: #7a8494; --erp-p-line: #e3e6ea; --erp-p-bg: #f4f5f7; }
.fi-simple-layout { background: var(--erp-p-bg); }
.dark .fi-simple-layout { background: #0b1220; }
/* With the side panel present the page splits 1.1 : 1, like the prototype; the panel hides on narrow screens. */
.fi-simple-layout:has(> .erp-login-side) { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; align-items: stretch; }
.fi-simple-layout:has(> .erp-login-side) > .fi-simple-main-ctn { display: flex; align-items: center; justify-content: center; padding: 32px; min-height: 100vh; }
.fi-simple-layout:has(> .erp-login-side) .fi-simple-main {
    width: 100%; max-width: 400px; background: transparent !important; box-shadow: none !important; border: 0 !important; padding: 0 !important; --tw-ring-shadow: 0 0 #0000 !important;
}
@media (max-width: 900px) {
    .fi-simple-layout:has(> .erp-login-side) { grid-template-columns: 1fr; }
    .erp-login-side { display: none !important; }
}
.erp-login-side {
    background: var(--erp-p-nav); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
    position: relative; overflow: hidden; min-height: 100vh;
}
.erp-login-side::after {
    content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 72, 15, .45), rgba(217, 72, 15, 0) 70%); pointer-events: none;
}
.erp-login-big { font-size: 34px; line-height: 1.15; font-weight: 600; max-width: 440px; margin-top: 48px; letter-spacing: -.01em; }
.erp-login-side ul { list-style: none; padding: 0; margin: 28px 0 0; color: var(--erp-p-nav-ink); line-height: 2; }
.erp-login-side li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--erp-p-brand); margin-right: 10px; vertical-align: middle; }
.erp-login-foot-line { font-size: 12px; color: var(--erp-p-nav-ink-2); position: relative; z-index: 1; }

/* brandmark: orange tile + name (sidebar, sign-in card, side panel) */
.erp-brandmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--erp-p-ink); white-space: nowrap; }
.dark .erp-brandmark, .erp-login-side .erp-brandmark, .fi-sidebar .erp-brandmark { color: #fff; }
.erp-brandmark-logo { width: 34px; height: 34px; border-radius: 8px; background: var(--erp-p-brand); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; }

/* card contents: left-aligned like the prototype */
.fi-simple-layout:has(> .erp-login-side) .fi-simple-header { align-items: flex-start; text-align: left; }
.fi-simple-layout:has(> .erp-login-side) .fi-logo { margin-bottom: 28px; }
.fi-simple-header-heading { font-size: 22px; font-weight: 600; letter-spacing: -.01em; color: var(--erp-p-ink); }
.dark .fi-simple-header-heading { color: #fff; }
.fi-simple-header-subheading { color: var(--erp-p-ink-3); margin-top: 6px; }
.fi-simple-layout .fi-btn.fi-color-primary:not(.fi-outlined) { background-image: none; background: var(--erp-p-brand); box-shadow: none; padding-block: 10px; }
.fi-simple-layout .fi-btn.fi-color-primary:not(.fi-outlined):hover { background: #a2360b; filter: none; }
.fi-simple-layout .fi-input-wrp { border-radius: 6px !important; }

/* sign-in notice ("You have signed out.") and the back link on reset password */
.erp-note { border-left: 3px solid #1f8a4c; background: #e6f5ec; color: #14532f; padding: 10px 14px; border-radius: 0 6px 6px 0; font-size: 13px; margin-bottom: 14px; }
.erp-note-bad { border-color: #c92a2a; background: #fdecec; color: #7d1a1a; }
.erp-back-link { display: inline-block; margin-top: 14px; font-size: 12px; color: #1c6dd0; }

/* idle warning ("Still there?") */
.erp-idle { position: fixed; inset: 0; background: rgba(16, 27, 43, .45); display: grid; place-items: center; z-index: 1000; padding: 16px; }
.erp-idle[hidden] { display: none; }
.erp-idle-box { background: #fff; color: var(--erp-p-ink); border-radius: 10px; max-width: 460px; width: 100%; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); overflow: hidden; }
.dark .erp-idle-box { background: #101a31; color: #e2e8f0; }
.erp-idle-box h2 { font-size: 17px; font-weight: 600; padding: 16px 20px; border-bottom: 1px solid var(--erp-p-line); margin: 0; }
.erp-idle-box p { padding: 18px 20px; margin: 0; font-size: 14px; }
.erp-idle-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; background: #f9fafb; border-top: 1px solid var(--erp-p-line); }
.dark .erp-idle-actions { background: #0d1629; }
.erp-idle-actions button { font: inherit; font-size: 13px; font-weight: 500; border: 1px solid #d0d5dc; background: #fff; color: var(--erp-p-ink); padding: 7px 12px; border-radius: 6px; cursor: pointer; }
.erp-idle-actions .erp-idle-stay { background: var(--erp-p-brand); border-color: var(--erp-p-brand); color: #fff; }
.fi-simple-layout:has(> .erp-login-side) .fi-simple-header-subheading { text-align: left; }
/* prototype buttons: white text on the brand orange */
.fi-btn.fi-color-primary:not(.fi-outlined), .fi-btn.fi-color-primary:not(.fi-outlined) .fi-icon { color: #fff !important; }
.p-table td:first-child, .p-table th:first-child { white-space: nowrap; }
.erp-side-footer { padding: 0 0 18px; }

/* ---------- header: navy column continues up through the top bar, as in the prototype ---------- */
@media (min-width: 1024px) {
    .fi-topbar { padding-inline-start: 0 !important; }
    .fi-topbar-start { width: 236px; flex: none; align-self: stretch; background: var(--p-nav); padding: 0 16px !important; margin: 0 !important; display: flex; align-items: center; }
    .fi-topbar-start .erp-brandmark { color: #fff; }
    .fi-topbar-start .fi-logo { margin: 0 !important; }
}
.fi-topbar { min-height: 56px; height: 56px; align-items: stretch !important; }
.fi-topbar-end { flex: 1; display: flex; align-items: center; justify-content: flex-start !important; gap: 14px; padding: 0 22px; }
.fi-topbar-end .fi-global-search-ctn { flex: 1; max-width: 420px; }
.fi-topbar-end .fi-global-search-ctn .fi-input-wrp { min-width: 0 !important; width: 100%; }
.erp-topbar-extras { margin-left: auto; margin-right: 0; }
.fi-topbar-collapse-sidebar-btn-ctn, .fi-topbar-open-collapse-sidebar-btn, .fi-topbar-close-collapse-sidebar-btn { display: none !important; }
.fi-topbar-start .erp-brandmark { font-size: 14.5px; gap: 9px; overflow: hidden; }
.fi-topbar-start .erp-brandmark-name { overflow: hidden; text-overflow: ellipsis; }
.fi-topbar-start .erp-brandmark-logo { width: 30px; height: 30px; font-size: 15px; flex: none; }
@media (max-width: 1023px) { .fi-topbar-start { display: flex; align-items: center; padding-inline-start: 12px; } .fi-topbar-end { padding: 0 12px; gap: 10px; } }
.fi-topbar > .fi-topbar-open-sidebar-btn, .fi-topbar > .fi-topbar-close-sidebar-btn { align-self: center; margin: 0 0 0 8px !important; }

/* ---------- Masters screens (prototype customer / supplier pages) ---------- */
.p-g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .p-g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .p-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .p-g2, .p-g4 { grid-template-columns: 1fr; } }
.p-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--p-line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.p-tabs button { font: inherit; font-size: 13px; font-weight: 500; color: var(--p-ink-2); background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 12px; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.p-tabs button:hover { color: var(--p-ink); }
.p-tabs button.on { color: var(--p-brand-ink); border-bottom-color: var(--p-brand); font-weight: 600; }
.dark .p-tabs button.on { color: var(--p-brand); }
.p-kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
.p-kv dt { color: var(--p-ink-3); } .p-kv dd { margin: 0; color: var(--p-ink); }
@media (max-width: 720px) { .p-kv { grid-template-columns: 1fr; gap: 2px; } .p-kv dd { margin-bottom: 8px; } }
.p-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.p-btn.sm { padding: 4px 9px; font-size: 12px; }
.p-btn.danger { color: var(--p-bad); border-color: #f3c2c2; } .p-btn.danger:hover { background: var(--p-bad-2); }
.p-click { cursor: pointer; }
.p-table tfoot td { font-weight: 600; background: var(--p-surface-2); border-top: 1px solid var(--p-line-2); padding: 9px 12px; }
.p-busy { opacity: .55; transition: opacity .15s; }
.p-table .p-num, .p-table th.p-num { text-align: right; font-variant-numeric: tabular-nums; }
/* Filament forms as prototype fieldsets */
.fi-resource-create-record-page .fi-section, .fi-resource-edit-record-page .fi-section { box-shadow: none !important; }
.fi-ta-filters-above-content-ctn { border-bottom: 1px solid var(--p-line); }
/* filters above the table = the prototype's toolbar row: no "Filters" heading, no field labels, compact */
.fi-ta-filters-above-content-ctn .fi-ta-filters { padding: 12px 16px !important; gap: 0 !important; }
.fi-ta-filters-above-content-ctn .fi-ta-filters-header { display: none !important; }
.fi-ta-filters-above-content-ctn .fi-fo-field-label-ctn, .fi-ta-filters-above-content-ctn .fi-fo-field-label { display: none !important; }
.fi-ta-filters-above-content-ctn .fi-sc { max-width: 720px; gap: 10px !important; }
/* list-page tabs (Customer rates) drawn like the prototype's underline tabs */
.fi-resource-list-records-page .fi-tabs { background: none !important; box-shadow: none !important; border: 0 !important; border-bottom: 1px solid var(--p-line) !important; border-radius: 0 !important; padding: 0 !important; margin: 0 !important; max-width: none !important; justify-content: flex-start !important; gap: 2px !important; }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item { border-radius: 0 !important; background: none !important; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 9px 12px !important; }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item .fi-tabs-item-label { color: var(--p-ink-2) !important; font-size: 13px; font-weight: 500; }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item.fi-active { border-bottom-color: var(--p-brand); }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item.fi-active .fi-tabs-item-label { color: var(--p-brand-ink) !important; font-weight: 600; }
.p-a { color: var(--p-brand-ink); font-weight: 600; text-decoration: none; } .p-a:hover { text-decoration: underline; }
/* ---------- Orders & deliveries ---------- */
.p-note { margin-top: 10px; padding: 10px 14px; border-radius: 6px; font-size: 13px; background: var(--p-blue-2); color: var(--p-ink); border: 1px solid #c4dbf6; }
.p-note.warn { background: var(--p-warn-2); border-color: #f0dcb4; } .p-note.bad { background: var(--p-bad-2); border-color: #f3c2c2; } .p-note.good { background: var(--p-good-2); border-color: #bfe3cc; }
.p-trail { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.p-trail .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--p-line-2); margin-right: 8px; vertical-align: -1px; }
.p-trail .on .dot { background: var(--p-good); border-color: var(--p-good); } .p-trail .on { color: var(--p-ink); font-weight: 500; } .p-trail div { color: var(--p-ink-3); }
.p-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--p-line); font-size: 13px; }
.p-toolbar input[type=date] { border: 1px solid var(--p-line-2); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px; background: var(--p-surface); color: var(--p-ink); }
/* challan paper */
.p-paper { background: #fff; color: #111; border: 1px solid var(--p-line); border-radius: 8px; padding: 28px 32px; max-width: 900px; font-size: 13px; }
.p-paper .ttl { text-align: center; font-weight: 700; letter-spacing: .08em; font-size: 15px; }
.p-paper table { width: 100%; border-collapse: collapse; }
.p-paper .grid th, .p-paper .grid td { border: 1px solid #d0d5db; padding: 6px 8px; text-align: left; }
.p-paper .grid th { background: #f4f5f7; font-size: 12px; }
.p-paper .num { text-align: right; font-variant-numeric: tabular-nums; }
.p-paper .r { text-align: right; } .p-paper .stamp { color: #c92a2a; border: 2px solid #c92a2a; display: inline-block; padding: 2px 10px; font-weight: 700; transform: rotate(-4deg); }
.fi-fo-table-repeater td .fi-fo-placeholder, .fi-fo-table-repeater td .fi-sc-text { white-space: nowrap; }
/* item grids (order / delivery) stay a real table on phones and scroll sideways, like the prototype, instead of stacking unlabelled inputs */
.fi-fo-table-repeater { overflow-x: auto; }
.fi-fo-table-repeater > table { display: table !important; min-width: 620px; }
.fi-fo-table-repeater > table > thead { display: table-header-group !important; }
.fi-fo-table-repeater > table > tbody { display: table-row-group !important; }
.fi-fo-table-repeater > table > tbody > tr { display: table-row !important; padding: 0 !important; }
.fi-fo-table-repeater > table > tbody > tr > td { display: table-cell !important; padding: 8px 12px !important; vertical-align: middle; }
.fi-fo-table-repeater > table > tbody > tr > td:first-of-type { min-width: 170px; }
/* segmented switch (invoice / slips) */
.p-seg { display: inline-flex; border: 1px solid var(--p-line-2); border-radius: 7px; overflow: hidden; background: var(--p-surface); }
.p-seg button { font: inherit; font-size: 13px; font-weight: 500; padding: 7px 14px; border: 0; background: none; color: var(--p-ink-2); cursor: pointer; }
.p-seg button + button { border-left: 1px solid var(--p-line-2); }
.p-seg button.on { background: var(--p-nav); color: #fff; }
.fi-fo-table-repeater td .fi-fo-select, .fi-fo-table-repeater td .fi-select-input { min-width: 190px; }
.fi-fo-table-repeater td .fi-input-wrp { min-width: 60px; }
.fi-fo-table-repeater td input.fi-input { min-width: 0; }
.fi-fo-table-repeater > table > tbody > tr > td:nth-last-child(-n+3):not(:has(input, select, button, textarea)) { min-width: 100px; }
/* the cell itself must hold the minimum width: auto table layout ignores the input's own min-width, so a picker spilled over the next column (purchase bill Qty) */
.fi-fo-table-repeater > table > tbody > tr > td:has(.fi-select-input) { min-width: 200px; }
.fi-fo-table-repeater > table > tbody > tr > td:has(.fi-input-wrp):not(:has(.fi-select-input)) { min-width: 76px; }
/* read-only cells (rate, GST %, totals) never break a number across lines */
/* (the last columns of every item grid hold rate / GST / value; item names in the first columns may wrap) */
.fi-fo-table-repeater > table > tbody > tr > td:nth-last-child(-n+3):not(:has(input, select, button, textarea)),
.fi-fo-table-repeater > table > tbody > tr > td:nth-last-child(-n+3):not(:has(input, select, button, textarea)) * { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
/* grids with a dropdown in a row (purchase bill) must not clip it: no sideways scroll there on wider screens (Category showed 1 of 7) */
@media (min-width: 1024px) { .fi-fo-table-repeater:has(.fi-select-input) { overflow: visible; } .fi-fo-table-repeater > table { min-width: 0; } }
/* long column headings wrap so the row fits the pop-up instead of pushing the last columns off-screen */
.fi-fo-table-repeater > table > thead th { white-space: normal; vertical-align: bottom; }

/* ===================== exact prototype frame (measured side by side) ===================== */
/* page: title 22px from the topbar, 18px to the first block, 16px between blocks */
.fi-page-header-main-ctn { padding: 0 !important; row-gap: 18px !important; }
.fi-header { margin-bottom: 0 !important; }
.fi-page-content { row-gap: 16px !important; }
.fi-page-content > .fi-sc.fi-sc-has-gap, .fi-page-main .fi-sc.fi-sc-has-gap { gap: 16px !important; }
.fi-breadcrumbs { margin-bottom: 4px; }
.fi-breadcrumbs .fi-breadcrumbs-item-separator { color: var(--p-ink-3); }
/* sidebar: 10px gutter, compact uppercase group labels, no collapse arrows */
.fi-sidebar-nav-groups { margin: 0 !important; row-gap: 0 !important; }
.fi-sidebar-group { row-gap: 0 !important; }
.fi-sidebar .fi-sidebar-group-btn { padding: 0 !important; margin: 14px 10px 6px !important; min-height: 0 !important; }
.fi-sidebar .fi-sidebar-group-btn .fi-icon-btn, .fi-sidebar .fi-sidebar-group-collapse-btn { display: none !important; }
.fi-sidebar .fi-sidebar-group-items { row-gap: 0 !important; }
.fi-sidebar .fi-sidebar-item-btn { min-height: 32px; }
/* topbar: search 420px with a grey fill, prototype placeholder */
.fi-topbar .fi-global-search-field .fi-input-wrp, .fi-topbar .fi-global-search .fi-input-wrp { min-width: 420px; max-width: 420px; border-radius: 6px !important; background: var(--p-surface-2) !important; }
.fi-topbar .fi-global-search-field input { font-size: 13.5px !important; }
@media (max-width: 1100px) { .fi-topbar .fi-global-search-field .fi-input-wrp, .fi-topbar .fi-global-search .fi-input-wrp { min-width: 0; max-width: none; } }
/* callouts look like the prototype's .note (left rule, tinted) */
.p-note { border: 0 !important; border-left: 3px solid var(--p-blue) !important; background: var(--p-blue-2); color: #18406f; border-radius: 0 6px 6px 0 !important; }
.p-note.warn { border-left-color: var(--p-warn) !important; background: var(--p-warn-2); color: #6b4200; }
.p-note.bad { border-left-color: var(--p-bad) !important; background: var(--p-bad-2); color: #7d1a1a; }
.p-note.good { border-left-color: var(--p-good) !important; background: var(--p-good-2); color: #14532f; }
/* tabs: active = ink text + orange underline, 13.5px, 9px 14px */
.p-tabs button { font-size: 13.5px; padding: 9px 14px; }
.p-tabs button.on, .dark .p-tabs button.on { color: var(--p-ink); }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item { padding: 9px 14px !important; }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item.fi-active .fi-tabs-item-label { color: var(--p-ink) !important; }
.fi-resource-list-records-page .fi-tabs .fi-tabs-item .fi-tabs-item-label { font-size: 13.5px !important; }
/* segmented switch: active = ink */
.p-seg { border-radius: 6px; } .p-seg button { font-size: 12.5px; padding: 6px 11px; } .p-seg button.on { background: var(--p-ink); }
/* key-value lists 150px like .kv */
.p-kv { grid-template-columns: 150px 1fr; gap: 8px 12px; }
/* links in the prototype are blue */
.p-a { color: var(--p-blue); font-weight: 500; }
/* user corner: bell · avatar · name/role (prototype order) */
.fi-topbar-end { gap: 14px; }
.fi-topbar-end .erp-user-text { order: 3; margin: 0; }
.fi-topbar-end .fi-user-menu { order: 2; }
.fi-topbar-end .fi-avatar { width: 32px !important; height: 32px !important; }
/* table toolbar = one row like the prototype: [search] [filters…] ··· [actions] */
.fi-ta-header-ctn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--p-line); }
.fi-ta-header-ctn > .fi-ta-header-toolbar { display: contents; }
.fi-ta-header-ctn > .fi-ta-header-toolbar > .fi-ta-actions { order: 3; margin-inline-start: auto; }
.fi-ta-header-ctn > .fi-ta-header-toolbar > :not(.fi-ta-actions) { order: 1; }
.fi-ta-header-ctn > .fi-ta-filters-above-content-ctn { order: 2; border: 0 !important; padding: 0 !important; flex: 0 1 auto; }
.fi-ta-header-ctn .fi-ta-filters-above-content-ctn .fi-ta-filters { padding: 0 !important; }
.fi-ta-header-ctn .fi-ta-filters-above-content-ctn .fi-sc { display: flex !important; flex-wrap: wrap; gap: 10px !important; max-width: none; }
.fi-ta-header-ctn .fi-ta-filters-above-content-ctn .fi-sc > * { min-width: 170px; }
.fi-ta-header-ctn .fi-ta-search-field .fi-input-wrp, .fi-ta-header-ctn .fi-ta-search-field { width: 260px; }
.fi-ta-header-ctn .fi-ta-search-field .fi-input-wrp-prefix { display: none; }
.fi-ta-filter-indicators { display: none !important; }
.fi-ta-header-ctn:empty { display: none; }
/* compact cells: 9px 12px, 13px text, 12px descriptions */
.fi-ta-header-cell { padding: 9px 12px !important; }
td.fi-ta-cell { padding: 0 !important; }
.fi-ta-cell .fi-ta-text, .fi-ta-cell .fi-ta-col > .fi-ta-text { padding: 9px 12px !important; font-size: 13px !important; }
.fi-ta-cell .fi-ta-text-item { font-size: 13px; }
.fi-ta-cell .fi-ta-text-description, .fi-ta-cell .fi-ta-text .fi-ta-text-item + p { font-size: 12px !important; color: var(--p-ink-3) !important; }
.fi-ta-cell .fi-font-mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 12px !important; }
.fi-ta-cell .fi-ta-actions { padding: 9px 12px; }
.fi-pagination { padding: 10px 16px !important; }
/* list pages carry no breadcrumbs in the prototype */
.fi-resource-list-records-page .fi-breadcrumbs { display: none; }
.fi-ta-header-ctn > .fi-ta-header { order: 4; margin-inline-start: auto; padding: 0 !important; border: 0 !important; display: flex; }
.fi-ta-header-ctn > .fi-ta-header-toolbar > .fi-ta-actions:empty { display: none; }
/* breadcrumbs: "Customers / C001", list link blue, slash separators */
.fi-breadcrumbs-item-separator { display: none !important; }
.fi-breadcrumbs-item + .fi-breadcrumbs-item::before { content: "/"; color: var(--p-ink-3); margin: 0 4px; font-size: 12px; }
.fi-breadcrumbs-item a.fi-breadcrumbs-item-label, a .fi-breadcrumbs-item-label { color: var(--p-blue) !important; }
.fi-breadcrumbs-item-label { font-size: 12px !important; font-weight: 400 !important; }
.fi-ta-header-ctn { justify-content: flex-start !important; }
.fi-ta-header-ctn > .fi-ta-header-toolbar > .fi-ta-actions:not(:has(*)) { display: none !important; }
.fi-ta-header-ctn > .fi-ta-header-toolbar > div:not(.fi-ta-actions) { margin: 0 !important; }
/* empty tables: plain muted line, like the prototype's .empty */
.fi-ta-empty-state { padding: 28px !important; }
.fi-ta-empty-state .fi-ta-empty-state-icon-bg, .fi-ta-empty-state .fi-ta-empty-state-icon-ctn { display: none !important; }
.fi-ta-empty-state-heading { font-size: 14px !important; font-weight: 400 !important; color: var(--p-ink-3) !important; }
/* forms = the prototype's dialog fieldsets: small legend, 12px labels, 14px padding, 14 × 16 gaps */
.fi-resource-create-record-page .fi-section, .fi-resource-edit-record-page .fi-section { border-radius: 8px !important; }
.fi-resource-create-record-page .fi-section-header, .fi-resource-edit-record-page .fi-section-header, .fi-modal .fi-section-header { border-bottom: 0 !important; padding: 12px 14px 0 !important; }
.fi-resource-create-record-page .fi-section-header-heading, .fi-resource-edit-record-page .fi-section-header-heading, .fi-modal .fi-section-header-heading { font-size: 12px !important; font-weight: 600 !important; color: var(--p-ink-2) !important; letter-spacing: 0; }
.fi-resource-create-record-page .fi-section-header-description, .fi-resource-edit-record-page .fi-section-header-description, .fi-modal .fi-section-header-description { font-size: 11.5px !important; color: var(--p-ink-3) !important; }
.fi-resource-create-record-page .fi-section-content, .fi-resource-edit-record-page .fi-section-content, .fi-modal .fi-section-content { padding: 12px 14px 14px !important; }
.fi-resource-create-record-page .fi-section-content > .fi-sc, .fi-resource-edit-record-page .fi-section-content > .fi-sc, .fi-modal .fi-section-content > .fi-sc { gap: 14px 16px !important; }
.fi-fo-field-label-content { font-size: 12px !important; font-weight: 500 !important; color: var(--p-ink-2) !important; }
.fi-fo-field-wrp-helper-text, .fi-sc-text.fi-fo-field-wrp-helper-text { font-size: 11.5px !important; color: var(--p-ink-3) !important; }
.fi-input-wrp { box-shadow: 0 0 0 1px var(--p-line-2) !important; background: var(--p-surface); }
.fi-input-wrp:focus-within { box-shadow: 0 0 0 1px var(--p-brand), 0 0 0 3px rgba(217, 72, 15, .25) !important; }
.fi-input-wrp.fi-disabled { background: var(--p-surface-2); }
.fi-input, .fi-select-input, .fi-fo-textarea textarea { font-size: 13.5px !important; }
.fi-input { padding-block: 7px !important; }
/* the form's own Save / Cancel bar sits like the dialog footer */
.fi-form-actions, .fi-sc-actions { padding-top: 4px; }
@media (max-width: 720px) {
    .fi-ta-header-ctn .fi-ta-search-field, .fi-ta-header-ctn .fi-ta-search-field .fi-input-wrp, .fi-ta-header-ctn > .fi-ta-filters-above-content-ctn, .fi-ta-header-ctn .fi-ta-filters-above-content-ctn .fi-sc > * { width: 100%; }
}

/* pop-ups = the prototype's dialog: 10px corners, title bar, grey footer with the buttons on the right */
.fi-modal-window { border-radius: 10px !important; box-shadow: 0 20px 50px rgba(0, 0, 0, .25) !important; }
.fi-modal-header { padding: 16px 20px !important; border-bottom: 1px solid var(--p-line); }
.fi-modal-heading { font-size: 17px !important; font-weight: 600 !important; letter-spacing: -.01em; color: var(--p-ink); }
.fi-modal-content { padding: 18px 20px !important; }
.fi-modal-footer { padding: 12px 20px !important; background: var(--p-surface-2); border-top: 1px solid var(--p-line); border-radius: 0 0 10px 10px; }
.fi-modal-footer-actions { justify-content: flex-end !important; width: 100%; }
.fi-modal-footer-actions > :first-child { order: 2; }   /* prototype: Cancel, then the main button on the right */
.fi-modal .fi-section { box-shadow: none !important; }
.fi-modal-close-overlay { background: rgba(16, 27, 43, .45) !important; }

/* Counter sale: sale form beside the bill preview; stacked on narrow screens. */
@media (max-width: 1100px) { .p-counter { grid-template-columns: 1fr !important; } .p-counter > .p-card { position: static !important; } }

/* A table with its own heading (e.g. "Payments" beside the payable card): heading on top, like the prototype's card title. */
.fi-ta-header-ctn > .fi-ta-header:has(.fi-ta-header-heading) { order: 0; flex-basis: 100%; margin-inline-start: 0; }
.fi-ta-header-heading { font-size: 14px; font-weight: 600; }

/* Tables inside a card scroll sideways inside the card instead of being cut off at its edge (e.g. customer page, two cards per row). */
.p-card .bd.flush { overflow-x: auto; }
