/* —— Design system: Printing Lab —— */
:root {
    --pl-green: #056b3f;
    --pl-green-deep: #034d2d;
    --pl-green-soft: #e8f5ef;
    --pl-ink: #1a2e28;
    --pl-muted: #5a6f68;
    --pl-line: #d5e3dc;
    --pl-paper: #f3f7f5;
    --pl-card: #ffffff;
    --pl-radius: 14px;
    --pl-shadow: 0 10px 30px rgba(3, 55, 35, .08);
    --pl-font: "Outfit", "Segoe UI", sans-serif;
    --pl-display: "Fraunces", Georgia, serif;
}

*, *::before, *::after {
    box-sizing: border-box;
}
html, body {
    max-width: 100%;
    overflow-x: hidden;
}
body {
    margin: 0;
    font-family: var(--pl-font);
    background:
        radial-gradient(1200px 500px at 10% -10%, rgba(5, 107, 63, .12), transparent 55%),
        radial-gradient(900px 400px at 100% 0%, rgba(26, 58, 92, .08), transparent 50%),
        var(--pl-paper);
    color: var(--pl-ink);
    letter-spacing: .01em;
    line-height: 1.45;
    pointer-events: auto !important;
}
html {
    pointer-events: auto !important;
}
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #1e4d8b;
    color: white;
}
.brand {
    font-size: 1.1rem;
    font-weight: 700;
}
.user-info a {
    color: #fff;
    text-decoration: none;
    margin-left: 12px;
}
.container {
    max-width: 1080px;
    margin: 24px auto;
    padding: 0 24px 48px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 80px auto;
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.auth-card h1 {
    margin-top: 0;
}
.auth-page {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% 0%, rgba(34, 120, 90, 0.14), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 100%, rgba(180, 120, 40, 0.12), transparent 50%),
        linear-gradient(165deg, #f3f6f4 0%, #e8eee9 45%, #f7f3eb 100%);
    font-family: "Outfit", system-ui, sans-serif;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.auth-brand img {
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(20, 60, 40, 0.18);
}
.auth-brand strong {
    display: block;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.25rem;
    color: #1a3d2e;
}
.auth-brand span {
    font-size: 0.85rem;
    color: #5a6b62;
}
.auth-sub {
    color: #5a6b62;
    margin: -4px 0 16px;
    line-height: 1.45;
}
.auth-form label {
    display: block;
    margin: 10px 0 4px;
    font-weight: 550;
    font-size: 0.92rem;
}
.auth-form input {
    width: 100%;
    box-sizing: border-box;
}
.auth-form button,
.auth-links .button,
.landing-cta .button {
    margin-top: 14px;
}
.auth-links {
    margin: 14px 0 0;
    text-align: center;
    color: #5a6b62;
}
.btn-secondary,
a.btn-secondary {
    background: transparent !important;
    color: #1a3d2e !important;
    border: 1.5px solid #1a3d2e !important;
    box-shadow: none !important;
}
.landing-page .landing-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}
.landing-copy {
    max-width: 560px;
    text-align: left;
}
.landing-copy h1 {
    font-family: "Fraunces", Georgia, serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.15;
    color: #163528;
    margin: 8px 0 12px;
}
.landing-copy > p {
    font-size: 1.05rem;
    color: #3d5348;
    max-width: 36ch;
}
.landing-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}
.landing-cta .button {
    text-decoration: none;
    display: inline-block;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
}
.landing-cta .button:not(.btn-secondary) {
    background: #1a3d2e;
    color: #fff;
}
.form-grid {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
    gap: 12px 16px;
    align-items: start;
}
.form-grid > label {
    padding-top: 12px;
    line-height: 1.3;
}
.form-grid.two-col {
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr) minmax(120px, 170px) minmax(0, 1fr);
}
.form-grid .full-span,
.form-grid > .hint,
.form-grid > .alert,
.form-grid > .mfg-hint,
.form-grid > .concept-box,
.form-grid > p,
.form-grid > .toggle-row,
.form-grid > .checkbox-row {
    grid-column: 1 / -1;
}
.form-grid > button,
.form-grid > .button,
.form-grid > div:has(> button),
.form-grid > div:has(> .button) {
    grid-column: 1 / -1;
    justify-self: start;
    width: auto;
}
@media (max-width: 900px) {
    .form-grid,
    .form-grid.two-col {
        grid-template-columns: 1fr;
    }
    .form-grid > button,
    .form-grid > .button {
        width: 100%;
    }
}
label {
    font-weight: 600;
}
input, select, textarea, button {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccd6eb;
    border-radius: 8px;
    font-size: 1rem;
}
textarea {
    resize: vertical;
}
button {
    background: #1e4d8b;
    color: white;
    border: none;
    cursor: pointer;
}
button:hover {
    opacity: .95;
}
.alert {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}
.alert-error {
    background: #ffe6e6;
    color: #b30000;
}
.alert-success {
    background: #e6ffea;
    color: #1f7a35;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.card {
    background: white;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0,0,0,.05);
}
.card h2 {
    margin: 0 0 14px;
}
.card p {
    font-size: 2rem;
    margin: 0;
}
.sections {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.button {
    display: inline-block;
    background: #1e4d8b;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 10px;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}
th, td {
    padding: 12px 14px;
    border-bottom: 1px solid #f0f4ff;
}
th {
    background: #f7faff;
    text-align: left;
}
@media (max-width: 768px) {
    .topbar, .container {padding: 12px;}
    .form-grid {gap: 12px;}
    input, select, button {font-size: .95rem;}
}
.blurred .container,
.blurred .auth-card,
.blurred .marg-layout {
    filter: none;
}
#idle-overlay,
.idle-overlay,
.idle-overlay.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    z-index: -1 !important;
}
/* Suggest lists must stay truly hidden when not open */
.item-suggest[hidden],
.party-suggest[hidden],
[hidden] {
    display: none !important;
}
.hint, .small {
    font-size: 0.9rem;
    color: #5a6b85;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
}
.checkbox-row input {
    width: auto;
}
.filter-bar {
    margin-bottom: 20px;
}
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}
.actions {
    white-space: nowrap;
}
.button.small, .btn-danger {
    padding: 6px 12px;
    font-size: 0.85rem;
    width: auto;
    display: inline-block;
}
.btn-danger {
    background: #b30000;
}
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,.5);
    color: white;
    width: auto;
    padding: 8px 12px;
}
.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    align-items: center;
}
.main-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}
.topbar {
    flex-wrap: wrap;
    gap: 12px;
}
.qr-wrap {
    text-align: center;
    margin: 16px 0;
}
.qr-wrap.hidden {
    display: none;
}
.bill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.bill-tabs .button.active {
    background: #0d3a6e;
    box-shadow: inset 0 0 0 2px #fff;
}
.button.primary {
    background: #0d7a3a;
    font-weight: 700;
}
.button.outline {
    background: #fff;
    color: #1e4d8b;
    border: 2px solid #1e4d8b;
}
.form-actions {
    margin-top: 20px;
}
.bill-items input {
    min-width: 80px;
}
@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    .main-nav.open { display: flex; }
    .topbar .user-info { width: 100%; text-align: right; }
}

/* ===== Marg ERP Style Layout ===== */
.marg-body { background: #e8ecef; }
.marg-layout { display: flex; min-height: 100vh; }
.marg-sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0a7a4a 0%, #056b3f 100%);
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-brand {
    display: flex;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    align-items: center;
}
.logo-icon {
    width: 42px; height: 42px;
    background: #fff;
    color: #056b3f;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.sidebar-brand small { display: block; opacity: .85; font-size: .75rem; }
.fy-badge {
    margin: 12px;
    padding: 10px;
    background: rgba(0,0,0,.2);
    border-radius: 8px;
    font-size: .85rem;
}
.fy-link { color: #b8ffd9; margin-left: 8px; }
.sidebar-nav {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 16px;
}
.sidebar-nav > .nav-link {
    display: block;
    padding: 11px 16px;
    color: #e8fff3;
    text-decoration: none;
    font-size: .95rem;
    font-weight: 600;
    border-left: 3px solid transparent;
}
.sidebar-nav > .nav-link:hover { background: rgba(255,255,255,.1); }
.sidebar-nav > .nav-link.active {
    background: rgba(255,255,255,.15);
    border-left-color: #fff;
}
.nav-section {
    padding: 12px 16px 4px;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .7;
}
.nav-group { border-bottom: 1px solid rgba(255,255,255,.08); }
.nav-group-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
    border: 0;
    border-left: 3px solid transparent;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}
.nav-group-btn:hover { background: rgba(255,255,255,.1); }
.nav-group.open > .nav-group-btn {
    background: rgba(0,0,0,.18);
    border-left-color: #b8ffd9;
}
.nav-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg);
    transition: transform .2s ease;
    opacity: .85;
    flex-shrink: 0;
}
.nav-group.open .nav-chevron {
    transform: rotate(45deg);
}
.nav-group-list {
    display: none;
    background: rgba(0,0,0,.15);
    padding: 4px 0 8px;
}
.nav-group.open > .nav-group-list { display: block; }
.sidebar-nav .nav-group-list a {
    display: block;
    padding: 9px 16px 9px 28px;
    color: #e8fff3;
    text-decoration: none;
    font-size: .9rem;
    border-left: 3px solid transparent;
}
.sidebar-nav .nav-group-list a:hover { background: rgba(255,255,255,.1); }
.sidebar-nav .nav-group-list a.active {
    background: rgba(255,255,255,.18);
    border-left-color: #fff;
    font-weight: 600;
}
.sidebar-nav a {
    display: block;
    padding: 10px 16px;
    color: #e8fff3;
    text-decoration: none;
    font-size: .92rem;
    border-left: 3px solid transparent;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.1); }
.sidebar-nav a.active {
    background: rgba(255,255,255,.15);
    border-left-color: #fff;
    font-weight: 600;
}
.marg-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.marg-topbar {
    background: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.topbar-title { font-weight: 700; color: #1a3a5c; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.fy-pill {
    background: #e8f5ee;
    color: #056b3f;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 600;
}
.btn-logout {
    background: #c62828;
    color: #fff;
    padding: 8px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: .9rem;
}
.sidebar-toggle {
    display: none;
    background: #056b3f;
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    width: auto;
}
.marg-content {
    padding: 28px 32px 48px;
    flex: 1;
}
.marg-table input { width: 100%; min-width: 60px; }
.full-span { grid-column: 1 / -1; }
.card.highlight { border: 2px solid #056b3f; }
.card .big { font-size: 1.8rem; }
.badge.ok { background: #c8e6c9; color: #2e7d32; padding: 4px 10px; border-radius: 4px; font-size: .8rem; }

.marg-quick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.qa-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    display: block;
    border-top: 4px solid #1e4d8b;
}
.qa-card.sale { border-top-color: #2e7d32; }
.qa-card.purchase { border-top-color: #e65100; }
.qa-card strong { display: block; margin-top: 8px; font-size: 1.1rem; }
.qa-card small { color: #666; }
.qa-icon {
    width: 36px; height: 36px;
    background: #056b3f;
    color: #fff;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.qa-card.sale .qa-icon { background: #2e7d32; }
.qa-card.purchase .qa-icon { background: #e65100; }
.qa-card { position: relative; }
.qa-key {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: .7rem;
    font-family: Consolas, monospace;
    background: #eef2f5;
    color: #334;
    border: 1px solid #c5d0da;
    border-radius: 4px;
    padding: 2px 6px;
}

.bill-header-bar {
    padding: 16px 20px;
    border-radius: 10px 10px 0 0;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.bill-header-bar.sale { background: linear-gradient(90deg, #2e7d32, #43a047); }
.bill-header-bar.purchase { background: linear-gradient(90deg, #e65100, #fb8c00); }
.bill-header-bar h1 { margin: 0; font-size: 1.4rem; }
.bill-meta span { margin-left: 16px; }
.marg-bill-screen {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.1);
    margin-bottom: 24px;
}
.bill-form { padding: 20px; }
.bill-fields-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.field-box label { display: block; font-size: .8rem; color: #555; margin-bottom: 4px; }
.field-box.wide { grid-column: span 2; }
.readonly-field { background: #f0f4f8; font-weight: 700; color: #056b3f; }
.balance-strip { background: #fff8e1; padding: 10px; border-radius: 6px; font-size: .9rem; }
.items-panel { border: 1px solid #dde3ea; border-radius: 8px; overflow: hidden; }
.items-panel-head {
    background: #37474f;
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
}
.bill-footer-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 2px solid #e0e0e0;
}
.bill-footer-bar textarea { flex: 1; min-width: 200px; }
.bill-total {
    text-align: right;
    background: #e8f5e9;
    padding: 12px 20px;
    border-radius: 8px;
}
.bill-total strong { display: block; font-size: 1.5rem; color: #2e7d32; }
.btn-save { width: auto; padding: 14px 28px; font-size: 1rem; }

.concept-box {
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(232,245,239,.9));
    border: 1px solid var(--pl-line);
    border-left: 4px solid var(--pl-green);
    padding: 16px 20px;
    margin-bottom: 22px;
    border-radius: 0 var(--pl-radius) var(--pl-radius) 0;
    font-size: .92rem;
    line-height: 1.55;
    color: var(--pl-muted);
    box-shadow: var(--pl-shadow);
}
.concept-box ul, .concept-box ol { margin: 8px 0 0; padding-left: 20px; }
.concept-box b, .concept-box strong { color: var(--pl-ink); }

.page-head {
    margin: 0 0 8px;
    color: var(--pl-ink);
    font-family: var(--pl-display);
    font-weight: 700;
    font-size: 1.85rem;
    letter-spacing: -.02em;
}
.page-head + .hint,
.page-head + .concept-box { margin-top: 6px; }
.hint, .small {
    color: var(--pl-muted);
    font-size: .9rem;
    margin: 0 0 18px;
}
.marg-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--pl-green-soft);
    color: var(--pl-green);
    font-family: var(--pl-font);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    vertical-align: middle;
}
.marg-panel {
    background: var(--pl-card);
    border: 1px solid rgba(213, 227, 220, .9);
    border-radius: var(--pl-radius);
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--pl-shadow);
}
.marg-panel h2 {
    margin: 0 0 16px;
    font-family: var(--pl-display);
    font-size: 1.2rem;
    color: var(--pl-ink);
}
.marg-content {
    padding: 28px 32px 48px;
}
.marg-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: var(--pl-radius);
    overflow: hidden;
    box-shadow: var(--pl-shadow);
    margin-bottom: 18px;
}
.marg-table th {
    background: linear-gradient(180deg, #0a7a4a, var(--pl-green));
    color: #fff;
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: .85rem;
}
.marg-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #eef3f0;
    font-size: .92rem;
}
.marg-table tr:last-child td { border-bottom: 0; }
.marg-table tbody tr:hover td { background: #f7fbf9; }

.button, button, .button.primary, button.primary {
    font-family: var(--pl-font);
    font-weight: 600;
    border-radius: 10px;
    padding: 11px 18px;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button.primary, button.primary, .form-grid > button, .marg-panel button[type="submit"] {
    background: linear-gradient(180deg, #0a8a54, var(--pl-green));
    border: none;
    color: #fff;
    box-shadow: 0 8px 18px rgba(5, 107, 63, .25);
}
.button.primary:hover, button.primary:hover, .form-grid > button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 22px rgba(5, 107, 63, .3);
}
input, select, textarea {
    font-family: var(--pl-font);
    border-radius: 10px;
    border-color: var(--pl-line);
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--pl-green);
    box-shadow: 0 0 0 3px rgba(5, 107, 63, .15);
}
.qa-card {
    transition: transform .18s ease, box-shadow .18s ease;
}
.qa-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(3, 55, 35, .12);
}
.stat-card, .card {
    border: 1px solid rgba(213, 227, 220, .85);
    box-shadow: var(--pl-shadow);
}
.stats-row { gap: 14px; margin-bottom: 24px; }
.form-grid { gap: 14px 18px; }
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat-card span { display: block; font-size: .8rem; color: #666; }
.stat-card strong { font-size: 1.25rem; color: #1a3a5c; }
.filter-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-tabs a {
    padding: 6px 14px;
    background: #e8eef5;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    font-size: .9rem;
}
.filter-tabs a.active { background: #1e4d8b; color: #fff; }
.badge-direct { background: #e3f2fd; color: #1565c0; padding: 2px 8px; border-radius: 4px; font-size: .8rem; text-transform: capitalize; }
.badge-indirect { background: #fce4ec; color: #c2185b; padding: 2px 8px; border-radius: 4px; font-size: .8rem; text-transform: capitalize; }
.salary-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background: #e8f5e9;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 1rem;
}
.salary-preview strong { color: #2e7d32; }
.button.primary { background: #056b3f; color: #fff; width: auto; padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; }
.btn-danger { background: #c62828; color: #fff; width: auto; padding: 4px 10px; border: none; border-radius: 4px; cursor: pointer; }
.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    background: #f5f7fa;
    padding: 12px 14px;
    border-radius: 8px;
}
.chk-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
    max-width: 100%;
}
.chk-label input[type="checkbox"] {
    width: auto !important;
    min-width: 18px;
    max-width: 22px;
    margin: 0;
    flex-shrink: 0;
    transform: scale(1.15);
}
/* Plain text delete-key fields — avoid Electron password/text-security freeze */
input.pwd-mask {
    letter-spacing: 0.12em;
}
.del-protect-opts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}
.del-protect-opts .chk-label {
    width: auto;
}
.off-tag {
    background: #eeeeee;
    color: #757575;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 700;
}
input:disabled, select:disabled {
    background: #f0f0f0;
    color: #999;
    cursor: not-allowed;
}

.item-suggest {
    position: fixed;
    z-index: 5000;
    background: #fff;
    border: 1px solid #056b3f;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    max-height: 260px;
    overflow-y: auto;
    pointer-events: auto;
}
.suggest-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: .95rem;
}
.suggest-row:last-child { border-bottom: none; }
.suggest-row:hover,
.suggest-row.active {
    background: #056b3f;
    color: #fff;
}
.suggest-row.active span,
.suggest-row:hover span { color: #c8f7d8; }
.suggest-row span { color: #666; font-weight: 600; white-space: nowrap; }
.suggest-empty { padding: 12px 14px; color: #777; font-size: .9rem; }
.entry-help {
    float: right;
    font-weight: 500;
    opacity: .85;
    font-size: .78rem;
    text-transform: none;
    letter-spacing: 0;
}
.marg-entry-panel .items-panel-head { overflow: hidden; }
.bill-items .entry-field {
    font-size: 1rem;
    font-weight: 600;
    text-align: right;
    padding: 8px 10px;
}
.bill-items .item-name-input { text-align: left; min-width: 180px; }
.bill-items .entry-qty { max-width: 80px; }
.bill-items .entry-field:focus {
    outline: 2px solid #056b3f;
    border-color: #056b3f;
    background: #fffef5;
}
.table-scroll { overflow-x: auto; }
.bill-items th, .bill-items td { white-space: nowrap; }
.gst-toggle { margin-top: 6px; }
.bill-totals-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}
.mini-total { font-size: .9rem; color: #444; }
.party-box { position: relative; }
.new-party-extra {
    background: #fff8e1;
    border: 1px dashed #f9a825;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.party-suggest {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% - 2px) !important;
    width: auto !important;
    min-width: 0 !important;
    z-index: 6000;
}

.bal-dr { color: #2e7d32; font-weight: 700; }
.bal-cr { color: #c62828; font-weight: 700; }
.invoice-preview-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
}
.invoice-preview-card.active {
    border-color: #056b3f;
    box-shadow: 0 0 0 2px rgba(5,107,63,.25);
}
.invoice-preview-card strong { display: block; margin-bottom: 6px; }
.invoice-mini {
    font-size: .75rem;
    color: #555;
    border: 1px dashed #ccc;
    padding: 8px;
    min-height: 70px;
}
.bs-table td:last-child, .bs-table th:last-child { text-align: right; }
.bs-section { font-weight: 700; background: #f5f7fa; }

.mfg-section {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.mfg-section h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #056b3f;
    border-bottom: 1px solid #e8ecef;
    padding-bottom: 8px;
}
.mfg-section .form-grid {
    margin: 0;
}
.mfg-items-table input,
.mfg-items-table select {
    width: 100%;
    min-width: 0;
}
.mfg-items-table .btn-add-row {
    width: auto;
    background: #056b3f;
    margin-top: 8px;
}
.mfg-cost-preview {
    font-size: 1.15rem;
    font-weight: 700;
    color: #2e7d32;
}
.mfg-hint {
    font-size: .85rem;
    color: #666;
    margin: 0 0 12px;
}

.bal-dr { color: #2e7d32; font-weight: 700; }
.bal-cr { color: #c62828; font-weight: 700; }
.invoice-preview-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    background: #fff;
    display: block;
}
.invoice-preview-card.active {
    border-color: #056b3f;
    box-shadow: 0 0 0 2px rgba(5,107,63,.25);
}
.invoice-preview-card strong { display: block; margin-bottom: 6px; }
.invoice-mini {
    font-size: .75rem;
    color: #555;
    border: 1px dashed #ccc;
    padding: 8px;
    min-height: 70px;
    margin-top: 6px;
}
.bs-table td:last-child, .bs-table th:last-child { text-align: right; }
.bs-section { font-weight: 700; background: #f5f7fa; }

.settle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.settle-col label { display: block; margin: 10px 0 6px; font-size: .85rem; }
.settle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #d5e3dc;
    margin-bottom: 8px;
}
.settle-row.net {
    border-bottom: 0;
    margin-top: 12px;
    padding: 12px;
    background: #e8f5ef;
    border-radius: 10px;
    font-size: 1.05rem;
}
.settle-multi .marg-table { box-shadow: none; margin: 8px 0; }
.settlement-panel h2 { margin-bottom: 12px; }

.plab-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(120%);
    background: #1a2e28;
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    z-index: 99999;
    max-width: min(92vw, 420px);
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
    font-family: var(--pl-font);
    font-size: .92rem;
}
.plab-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.plab-toast.err { background: #b71c1c; }
button.confirm-armed,
.btn-danger.confirm-armed {
    outline: 2px solid #ffeb3b !important;
}
.marg-table td form {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin: 0;
}
.auth-card input,
.auth-card button,
.auth-form input,
.auth-form button {
    width: 100%;
    max-width: 100%;
}
.auth-card {
    margin: 40px auto;
    padding: 24px;
}
.otp-glamour {
    margin: 14px 0 18px;
    padding: 16px 14px 18px;
    border-radius: 14px;
    background:
        radial-gradient(120% 80% at 10% 0%, rgba(5,107,63,.10), transparent 55%),
        linear-gradient(180deg, #f7fbf9, #eef6f1);
    border: 1px solid #cfe3d8;
    text-align: center;
}
.otp-glamour-label {
    display: block;
    font-size: .72rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #5f766d;
    margin-bottom: 12px;
    font-weight: 600;
}
.otp-glamour-digits {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}
.otp-digit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #f3faf6);
    border: 1px solid #b7d8c6;
    box-shadow: 0 8px 18px rgba(5,107,63,.12);
    color: #056b3f;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.65rem;
    font-weight: 700;
    animation: otpPop .45s ease both;
}
.otp-digit:nth-child(2) { animation-delay: .04s; }
.otp-digit:nth-child(3) { animation-delay: .08s; }
.otp-digit:nth-child(4) { animation-delay: .12s; }
.otp-digit:nth-child(5) { animation-delay: .16s; }
.otp-digit:nth-child(6) { animation-delay: .2s; }
@keyframes otpPop {
    from { transform: translateY(8px) scale(.92); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}
@media (max-width: 520px) {
    .auth-card { margin: 20px 12px; width: auto; }
    .marg-content { padding: 16px 14px 40px; }
    .form-grid > label { padding-top: 4px; }
    .otp-digit { width: 40px; height: 50px; font-size: 1.4rem; }
}

@media (max-width: 900px) {
    .marg-sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left .25s;
    }
    .marg-sidebar.open { left: 0; }
    .sidebar-toggle { display: block; }
    .field-box.wide { grid-column: span 1; }
}
