:root{
    --pg-bg:#f4f7fb;
    --pg-surface:#ffffff;
    --pg-surface-soft:#f8fbff;
    --pg-border:#e2e8f0;
    --pg-border-strong:#cbd5e1;
    --pg-text:#0f172a;
    --pg-text-soft:#334155;
    --pg-muted:#64748b;
    --pg-primary:#2563eb;
    --pg-primary-dark:#1d4ed8;
    --pg-primary-soft:#eff6ff;
    --pg-success:#16a34a;
    --pg-success-soft:#effcf3;
    --pg-warning:#d97706;
    --pg-warning-soft:#fff7ed;
    --pg-danger:#dc2626;
    --pg-danger-soft:#fef2f2;
    --pg-info:#0f766e;
    --pg-info-soft:#ecfeff;
    --pg-shadow:0 20px 45px rgba(15,23,42,.08);
    --pg-shadow-soft:0 12px 28px rgba(15,23,42,.05);
    --pg-radius:22px;
    --pg-radius-sm:16px;
}
html,body{height:100%}
body{
    margin:0;
    background:linear-gradient(180deg,#f8fbff 0%,var(--pg-bg) 100%);
    color:var(--pg-text);
    font-family:Arial,Helvetica,sans-serif;
}
a{text-decoration:none}
.app-shell{min-height:100vh;display:flex;align-items:stretch}
.sidebar{
    width:290px;min-width:290px;background:#0f172a;color:#fff;display:flex;flex-direction:column;
    box-shadow:4px 0 24px rgba(15,23,42,.16);position:sticky;top:0;max-height:100vh;z-index:1030;
}
.sidebar-brand{padding:1.5rem 1.45rem 1.15rem;border-bottom:1px solid rgba(255,255,255,.08)}
.sidebar-brand a{color:#fff;font-size:1.55rem;font-weight:800;letter-spacing:.02em}
.sidebar-subtitle{font-size:.78rem;color:#94a3b8;letter-spacing:.12em;text-transform:uppercase;margin-top:.35rem}
.sidebar-panel-label{margin:1rem 1.35rem .1rem;display:inline-flex;align-self:flex-start;padding:.4rem .7rem;border-radius:999px;background:rgba(148,163,184,.14);color:#cbd5e1;font-size:.75rem;font-weight:700;letter-spacing:.04em}
.sidebar-nav{padding:.9rem .95rem 1.25rem;overflow:auto}
.sidebar-section-title{padding:.8rem .85rem .35rem;color:#64748b;font-weight:700;font-size:.74rem;text-transform:uppercase;letter-spacing:.12em}
.sidebar-nav ul{list-style:none;padding:0;margin:0}
.sidebar-nav li{margin:.28rem 0}
.sidebar-link{display:flex;align-items:center;gap:.75rem;color:#cbd5e1;padding:.88rem 1rem;border-radius:16px;font-weight:700;transition:all .18s ease}
.sidebar-link:hover{background:rgba(148,163,184,.14);color:#fff;transform:translateX(1px)}
.sidebar-link.active{background:linear-gradient(135deg,var(--pg-primary),var(--pg-primary-dark));color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.35)}
.sidebar-icon{width:36px;height:36px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;background:rgba(255,255,255,.1);font-size:.75rem;font-weight:800;flex:0 0 36px;letter-spacing:.04em}
.main-panel{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.1rem 1.75rem;background:rgba(255,255,255,.88);backdrop-filter:blur(10px);border-bottom:1px solid var(--pg-border);position:sticky;top:0;z-index:1020}
.topbar-left{display:flex;align-items:center;gap:1rem;min-width:0}
.topbar-right{display:flex;align-items:center}
.topbar-toggle{display:none;border:1px solid var(--pg-border);background:#fff;border-radius:12px;padding:.55rem .75rem;color:var(--pg-text);font-weight:800;box-shadow:var(--pg-shadow-soft)}
.topbar-title{font-size:1.35rem;font-weight:800;color:var(--pg-text);margin:.1rem 0 0}
.topbar-subtitle{font-size:.87rem;color:var(--pg-muted);margin-top:.1rem}
.topbar-badge{display:inline-flex;align-items:center;gap:.5rem;padding:.65rem .95rem;border-radius:999px;background:var(--pg-primary-soft);color:var(--pg-primary);font-size:.86rem;font-weight:700;border:1px solid #dbeafe}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--pg-success);display:inline-block}
.breadcrumb-shell{display:flex;align-items:center;gap:.45rem;flex-wrap:wrap;color:var(--pg-muted);font-size:.78rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.breadcrumb-separator{opacity:.5}
.page-shell{padding:1.75rem}
.app-footer{margin-top:auto;padding:1rem 1.75rem;border-top:1px solid var(--pg-border);background:rgba(255,255,255,.74);color:var(--pg-muted);font-size:.85rem;display:flex;gap:.6rem;flex-wrap:wrap}
.footer-divider{opacity:.5}
.page-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;margin-bottom:1.5rem}
.page-eyebrow{display:inline-flex;align-items:center;padding:.38rem .72rem;background:#e0edff;color:var(--pg-primary-dark);border-radius:999px;font-size:.76rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;margin-bottom:.7rem}
.section-title{font-size:1.75rem;line-height:1.2;font-weight:800;color:var(--pg-text);margin-bottom:.35rem}
.section-subtitle,.text-muted{color:var(--pg-muted)!important}
.app-card,.surface-card,.summary-card,.metric-card{border:1px solid rgba(226,232,240,.8);border-radius:var(--pg-radius);box-shadow:var(--pg-shadow-soft);background:var(--pg-surface)}
.card.app-card{overflow:hidden}
.summary-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}
.summary-card{grid-column:span 12;padding:1.2rem 1.25rem;position:relative;overflow:hidden}
.summary-card::after{content:"";position:absolute;right:-24px;top:-24px;width:94px;height:94px;border-radius:50%;background:rgba(255,255,255,.26)}
.summary-label{font-size:.84rem;font-weight:700;color:var(--pg-muted);text-transform:uppercase;letter-spacing:.05em}
.summary-value{font-size:2rem;line-height:1.1;font-weight:800;color:var(--pg-text);margin:.75rem 0 .4rem}
.summary-meta{color:var(--pg-text-soft);font-size:.9rem}
.summary-accent-primary{background:linear-gradient(135deg,#eff6ff,#ffffff);border-color:#dbeafe}
.summary-accent-success{background:linear-gradient(135deg,#effcf3,#ffffff);border-color:#dcfce7}
.summary-accent-warning{background:linear-gradient(135deg,#fff7ed,#ffffff);border-color:#fed7aa}
.summary-accent-danger{background:linear-gradient(135deg,#fef2f2,#ffffff);border-color:#fecaca}
.summary-accent-info{background:linear-gradient(135deg,#ecfeff,#ffffff);border-color:#bae6fd}
.table-shell{overflow:hidden}
.table-toolbar{padding:1.2rem 1.3rem;border-bottom:1px solid var(--pg-border);display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;flex-wrap:wrap;background:linear-gradient(180deg,#ffffff 0%,#fbfdff 100%)}
.table-title{font-size:1.08rem;font-weight:800;margin:0;color:var(--pg-text)}
.table-subtitle{font-size:.9rem;color:var(--pg-muted);margin:.35rem 0 0}
.table{margin-bottom:0}
.table thead th{background:#f8fbff;color:#1e3a8a;border-bottom:1px solid var(--pg-border);font-size:.82rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding:1rem .95rem;white-space:nowrap}
.table tbody td{padding:1rem .95rem;border-color:#eef2f7;vertical-align:middle}
.table tbody tr:hover{background:#fbfdff}
.table-responsive{overflow:auto}
.table.table-clean tbody tr:last-child td{border-bottom:0}
.empty-state{padding:2.2rem 1rem;text-align:center;color:var(--pg-muted)}
.empty-state-title{font-size:1.05rem;font-weight:800;color:var(--pg-text);margin-bottom:.35rem}
.form-shell{padding:1.5rem}
.form-section{padding:1.25rem;border:1px solid var(--pg-border);border-radius:18px;background:#fcfdff}
.form-section + .form-section{margin-top:1rem}
.form-section-title{font-size:1rem;font-weight:800;color:var(--pg-text);margin-bottom:1rem}
.form-label{font-weight:700;color:var(--pg-text-soft);margin-bottom:.45rem}
.form-control,.form-select{border:1px solid var(--pg-border-strong);border-radius:14px;min-height:46px;padding:.72rem .9rem;box-shadow:none;background:#fff}
.form-control:focus,.form-select:focus{border-color:#93c5fd;box-shadow:0 0 0 .22rem rgba(37,99,235,.12)}
textarea.form-control{min-height:auto}
.form-actions{display:flex;gap:.75rem;flex-wrap:wrap;padding-top:1.2rem}
.btn{border-radius:14px;font-weight:700;padding:.72rem 1rem;box-shadow:none}
.btn-sm{border-radius:12px;padding:.45rem .7rem}
.btn-primary{background:linear-gradient(135deg,var(--pg-primary),var(--pg-primary-dark));border-color:var(--pg-primary-dark)}
.btn-primary:hover{filter:brightness(.98)}
.btn-outline-primary,.btn-outline-secondary,.btn-outline-success,.btn-outline-danger{background:#fff}
.alert-soft{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;border-radius:16px;border:1px solid transparent;padding:1rem 1.1rem;box-shadow:var(--pg-shadow-soft)}
.alert-success.alert-soft{background:var(--pg-success-soft);border-color:#bbf7d0;color:#166534}
.alert-danger.alert-soft{background:var(--pg-danger-soft);border-color:#fecaca;color:#991b1b}
.alert-warning.alert-soft{background:var(--pg-warning-soft);border-color:#fed7aa;color:#9a3412}
.alert-info.alert-soft{background:var(--pg-info-soft);border-color:#a5f3fc;color:#155e75}
.alert-dismissible-custom{margin-bottom:1.2rem}
.btn-close-lite{border:0;background:transparent;color:inherit;font-size:1.35rem;line-height:1;padding:.1rem .2rem;cursor:pointer}
.metric-list{display:grid;gap:.85rem}
.metric-item,.info-pair{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:.95rem 0;border-bottom:1px dashed var(--pg-border)}
.metric-item:last-child,.info-pair:last-child{border-bottom:0;padding-bottom:0}
.info-label{color:var(--pg-muted);font-weight:700}
.info-value{color:var(--pg-text);font-weight:700;text-align:right}
.action-tile{display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;height:100%;padding:1.15rem;border:1px solid var(--pg-border);border-radius:18px;background:#fff;color:inherit;transition:all .18s ease}
.action-tile:hover{transform:translateY(-2px);box-shadow:var(--pg-shadow-soft);border-color:#c7d2fe}
.action-tile-title{font-size:1rem;font-weight:800;color:var(--pg-text);margin-bottom:.4rem}
.action-tile-text{margin:0;color:var(--pg-muted);font-size:.9rem}
.action-badge{display:inline-flex;align-items:center;justify-content:center;min-width:42px;height:42px;border-radius:14px;background:var(--pg-primary-soft);color:var(--pg-primary-dark);font-weight:800}
.modal-panel{position:fixed;inset:0;background:rgba(15,23,42,.45);display:flex;align-items:center;justify-content:center;padding:1.25rem;z-index:1060}
.modal-sheet{width:min(980px,100%);background:#fff;border-radius:24px;box-shadow:var(--pg-shadow);overflow:hidden;max-height:88vh;display:flex;flex-direction:column}
.modal-head,.modal-foot{padding:1rem 1.25rem;border-bottom:1px solid var(--pg-border);display:flex;justify-content:space-between;align-items:center;gap:1rem}
.modal-foot{border-top:1px solid var(--pg-border);border-bottom:0;background:#fbfdff}
.modal-title{margin:0;font-size:1.08rem;font-weight:800}
.modal-body-scroll{padding:0;overflow:auto}
.login-page,.center-page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:2rem;background:radial-gradient(circle at top right,#dbeafe 0%,#f8fbff 35%,#f3f6fb 100%)}
.auth-card{width:min(100%,460px);background:#fff;border:1px solid #dbe4f0;border-radius:28px;box-shadow:var(--pg-shadow);overflow:hidden}
.auth-card-body{padding:2rem}
.auth-brand{display:inline-flex;align-items:center;justify-content:center;width:58px;height:58px;border-radius:18px;background:#eff6ff;color:var(--pg-primary-dark);font-weight:800;font-size:1.2rem;margin-bottom:1rem}
.auth-title{font-size:1.85rem;font-weight:800;color:var(--pg-text);margin-bottom:.4rem}
.auth-subtitle{color:var(--pg-muted);margin-bottom:1.5rem}
.demo-card{margin-top:1.25rem;padding:1rem;border:1px dashed var(--pg-border-strong);border-radius:16px;background:#f8fbff;color:var(--pg-text-soft)}
.list-inline-dots{display:flex;flex-wrap:wrap;gap:.6rem 1rem;padding:0;margin:0;list-style:none}
.list-inline-dots li{position:relative;padding-left:1rem;color:var(--pg-text-soft)}
.list-inline-dots li::before{content:"";position:absolute;left:0;top:.52rem;width:6px;height:6px;border-radius:50%;background:var(--pg-primary)}
.stat-stack{display:grid;gap:.9rem}
.stat-card-mini{padding:1rem;border:1px solid var(--pg-border);border-radius:18px;background:#fff}
.stat-card-mini-label{font-size:.8rem;font-weight:800;color:var(--pg-muted);text-transform:uppercase;letter-spacing:.05em}
.stat-card-mini-value{font-size:1.35rem;font-weight:800;margin-top:.4rem}
.toolbar-search{display:flex;gap:.75rem;align-items:end;flex-wrap:wrap}
.toolbar-search .form-control{min-width:260px}
.page-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:1rem}
.col-span-12{grid-column:span 12}
.col-span-8{grid-column:span 8}
.col-span-4{grid-column:span 4}
.data-chip{display:inline-flex;align-items:center;padding:.35rem .6rem;border-radius:999px;background:#f1f5f9;color:#334155;font-size:.76rem;font-weight:700}
.action-menu{position:relative;display:inline-block}
.action-menu summary{list-style:none;cursor:pointer}
.action-menu summary::-webkit-details-marker{display:none}
.action-menu[open] .action-menu-list{display:block}
.action-menu-list{display:none;position:absolute;right:0;top:calc(100% + .45rem);min-width:180px;padding:.45rem;background:#fff;border:1px solid var(--pg-border);border-radius:16px;box-shadow:var(--pg-shadow-soft);z-index:5}
.action-menu-list a,.action-menu-list button{display:flex;width:100%;padding:.7rem .8rem;border:0;background:transparent;text-align:left;color:var(--pg-text-soft);font-weight:700;border-radius:12px}
.action-menu-list a:hover,.action-menu-list button:hover{background:#f8fbff;color:var(--pg-primary-dark)}
.action-menu-list form{margin:0}
.mobile-overlay{display:none;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease, visibility .2s ease}
.receipt-card-lite{max-width:760px;margin:0 auto;background:#fff;border:1px solid #dbe4f0;border-radius:16px;box-shadow:0 12px 28px rgba(15,23,42,.08)}
.receipt-header-lite{padding:24px 28px 16px;border-bottom:1px solid #e2e8f0}
.receipt-body-lite{padding:24px 28px}
.receipt-table-lite td{padding:10px 0;vertical-align:top}
.receipt-table-lite td:first-child{width:220px;color:#475569;font-weight:700}
.receipt-total-lite{background:#eff6ff;border-radius:14px;padding:16px 18px;font-size:1.25rem;font-weight:800;color:#1d4ed8}
.receipt-actions-lite{max-width:760px;margin:0 auto 16px;display:flex;justify-content:flex-end;gap:10px}
@media (min-width:768px){.summary-card{grid-column:span 6}}
@media (min-width:1200px){.summary-card{grid-column:span 4}}
@media (max-width:1199.98px){.col-span-8,.col-span-4{grid-column:span 12}}
@media (max-width:991.98px){
    .sidebar{
        position:fixed;
        left:0;
        top:0;
        bottom:0;
        width:290px;
        min-width:290px;
        max-width:85vw;
        max-height:100vh;
        overflow-y:auto;
        transform:translateX(-100%);
        transition:transform .2s ease;
        z-index:1045;
    }
    .sidebar.is-open,
    body.sidebar-open .sidebar{transform:translateX(0)}
    .mobile-overlay{
        display:block;
        position:fixed;
        inset:0;
        background:rgba(15,23,42,.45);
        z-index:1040;
    }
    .mobile-overlay.is-active,
    body.sidebar-open .mobile-overlay{
        opacity:1;
        visibility:visible;
        pointer-events:auto;
    }
    body.sidebar-open{overflow:hidden}
    .topbar-toggle{display:inline-flex}
    .page-shell{padding:1.1rem}
    .topbar{padding:1rem 1.1rem}
}
@media (max-width:575.98px){
    .section-title{font-size:1.45rem}
    .summary-value{font-size:1.65rem}
    .auth-card-body{padding:1.4rem}
    .table-toolbar{padding:1rem}
    .modal-sheet{max-height:92vh}
    .form-shell{padding:1rem}
    .topbar-badge{display:none}
}
@media print{
    .receipt-actions-lite{display:none!important}
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-soft-danger {
    background: rgba(220, 53, 69, 0.12);
    color: #b42318;
}

.badge-soft-secondary {
    background: rgba(108, 117, 125, 0.14);
    color: #495057;
}

.bg-light-subtle {
    background-color: #f8f9fa;
}
