:root {
    color-scheme: light dark;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

body[data-theme="light"] {
    --bg: #eef0f4;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --text: #1f2328;
    --muted: rgba(31, 35, 40, 0.68);
    --border: rgba(31, 35, 40, 0.10);
    --shadow: rgba(14, 8, 16, 0.08);
    --brand: #27a9c4;
    --brand-2: #27a9c4;
    --accent: #e03347;
    --accent-2: #e03347;
    --ring: rgba(39, 169, 196, 0.25);
    --sidebar: #2f3440;
    --sidebar-2: #3a404d;
    --sidebar-text: rgba(255, 255, 255, 0.88);
    --sidebar-muted: rgba(255, 255, 255, 0.62);
    --sidebar-border: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] {
    --bg: #171b22;
    --surface: #232834;
    --surface-2: #2a3040;
    --text: #f5f7fb;
    --muted: rgba(245, 247, 251, 0.72);
    --border: rgba(245, 247, 251, 0.10);
    --shadow: rgba(0, 0, 0, 0.28);
    --brand: #27a9c4;
    --brand-2: #27a9c4;
    --accent: #e85b6c;
    --accent-2: #e85b6c;
    --ring: rgba(39, 169, 196, 0.25);
    --sidebar: #171b22;
    --sidebar-2: #232834;
    --sidebar-text: rgba(255, 255, 255, 0.92);
    --sidebar-muted: rgba(255, 255, 255, 0.62);
    --sidebar-border: rgba(255, 255, 255, 0.08);
}

body[data-theme="system"] {
    --bg: #eef0f4;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --text: #1f2328;
    --muted: rgba(31, 35, 40, 0.68);
    --border: rgba(31, 35, 40, 0.10);
    --shadow: rgba(14, 8, 16, 0.12);
    --brand: #27a9c4;
    --brand-2: #27a9c4;
    --accent: #e03347;
    --accent-2: #e03347;
    --ring: rgba(39, 169, 196, 0.25);
    --sidebar: #2f3440;
    --sidebar-2: #3a404d;
    --sidebar-text: rgba(255, 255, 255, 0.88);
    --sidebar-muted: rgba(255, 255, 255, 0.62);
    --sidebar-border: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
    body[data-theme="system"] {
        --bg: #171b22;
        --surface: #232834;
        --surface-2: #2a3040;
        --text: #f5f7fb;
        --muted: rgba(245, 247, 251, 0.72);
        --border: rgba(245, 247, 251, 0.10);
        --shadow: rgba(0, 0, 0, 0.28);
        --brand: #27a9c4;
        --brand-2: #27a9c4;
        --accent: #e85b6c;
        --accent-2: #e85b6c;
        --ring: rgba(39, 169, 196, 0.25);
        --sidebar: #171b22;
        --sidebar-2: #232834;
        --sidebar-text: rgba(255, 255, 255, 0.92);
        --sidebar-muted: rgba(255, 255, 255, 0.62);
        --sidebar-border: rgba(255, 255, 255, 0.08);
    }
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

.erp-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.erp-sidebar {
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 14px 14px 20px;
    border-right: 1px solid var(--sidebar-border);
}

.erp-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--sidebar-border);
    margin-bottom: 14px;
}

.erp-sidebar .brand-title {
    color: #fff;
}

.erp-sidebar .brand-subtitle {
    color: var(--sidebar-muted);
}

.erp-nav {
    display: grid;
    gap: 10px;
}

.erp-nav-link,
.erp-nav-sublink {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 600;
}

.erp-nav-link:hover,
.erp-nav-sublink:hover,
.erp-nav-link.is-active,
.erp-nav-sublink.is-active {
    background: var(--sidebar-2);
    text-decoration: none;
}

.erp-nav-group {
    display: grid;
    gap: 4px;
}

.erp-nav-group-title {
    padding: 6px 12px 4px;
    color: var(--sidebar-muted);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
}

.erp-nav-sublink {
    margin-left: 8px;
    font-weight: 500;
}

.erp-main {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-width: 0;
}

.erp-main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.erp-page-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.erp-page-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.erp-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.erp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    font-size: 0.88rem;
    font-weight: 700;
}

.erp-content {
    padding: 18px;
    min-width: 0;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.topbar a {
    color: var(--text);
    margin-right: 16px;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-title {
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
}

.brand-mark {
    width: 44px;
    height: 44px;
    position: relative;
}

.brand-mark-shape {
    display: block;
    width: 44px;
    height: 44px;
    background: var(--brand);
    transform: rotate(45deg);
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(255, 138, 42, 0.12);
}

.brand-logo {
    width: 44px;
    height: 44px;
    display: block;
}

.brand-mark-glyph {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: rgba(9, 6, 11, 0.92);
    letter-spacing: 0.08em;
    transform: translateY(-1px);
}

.theme-switcher {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 10px 24px var(--shadow);
}

.theme-button {
    margin: 0;
    width: auto;
    padding: 8px 12px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 600;
}

.theme-button.is-active {
    background: var(--surface-2);
    border: 1px solid rgba(255, 138, 42, 0.22);
    color: var(--text);
}

.topbar-links {
    text-align: right;
    display: grid;
    gap: 8px;
}

.topbar-links span.small,
.topbar-user {
    display: block;
    margin-bottom: 0;
}

.topbar-menu {
    display: flex;
    justify-content: flex-end;
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.topbar-menu-rail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    box-shadow: 0 10px 24px var(--shadow);
}

.nav-dropdown {
    position: relative;
}

.menu-link,
.nav-trigger {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
}

.menu-link:hover,
.nav-dropdown:hover .nav-trigger,
.nav-dropdown:focus-within .nav-trigger {
    background: var(--surface-2);
    border-color: var(--border);
    text-decoration: none;
}

.nav-trigger.is-active,
.menu-link.is-active {
    background: var(--surface-2);
    border-color: var(--border);
}

.nav-trigger::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0.7;
}

.nav-dropdown-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    min-width: 240px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 18px 36px var(--shadow);
    display: none;
    gap: 4px;
    z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
    display: grid;
}

.nav-dropdown-menu a {
    margin-right: 0;
    padding: 9px 10px;
    border-radius: 12px;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.nav-dropdown-menu a span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.nav-dropdown-menu a:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.nav-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--ring);
}

.menu-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px var(--ring);
}

.card,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 12px 28px var(--shadow);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat {
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 10px 24px var(--shadow);
}

.flash {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.flash-success {
    background: rgba(16, 185, 129, 0.18);
    color: var(--text);
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.flash-error {
    background: rgba(239, 68, 68, 0.18);
    color: var(--text);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input,
select,
button,
textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 4px var(--ring);
}

button,
.button {
    display: inline-block;
    width: auto;
    background: var(--brand);
    color: rgba(9, 6, 11, 0.92);
    text-decoration: none;
    cursor: pointer;
    border: none;
    padding: 8px 12px;
    font-weight: 700;
    border-radius: 12px;
    font-size: 0.92rem;
    line-height: 1.2;
}

.button-light {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.button-sm {
    padding: 6px 10px;
    font-size: 0.86rem;
    border-radius: 10px;
}

.inline-form {
    display: inline;
}

.small {
    font-size: 0.9rem;
    color: var(--muted);
}

.qr-box {
    max-width: 220px;
}

.print-document-body {
    background: #ffffff;
    color: #111827;
}

.print-document-shell {
    max-width: 920px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.print-gatepass {
    display: grid;
    gap: 20px;
}

.print-gatepass-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #111827;
}

.print-gatepass-title {
    margin: 0 0 8px;
    font-size: 2rem;
    line-height: 1.1;
}

.print-gatepass-status {
    padding: 10px 14px;
    border: 1px solid #111827;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
}

.print-gatepass-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 20px;
}

.print-gatepass-card {
    border: 1px solid #d1d5db;
    border-radius: 16px;
    padding: 18px;
    background: #ffffff;
    box-shadow: none;
}

.print-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e5e7eb;
}

.print-detail-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.print-detail-row span {
    color: #4b5563;
}

.print-gatepass-qr {
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 14px;
}

.print-qr-note {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
    text-align: center;
}

.print-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.print-actions .button-light {
    background: #ffffff;
    border: 1px solid #111827;
    color: #111827;
}

.print-actions .button-light:hover {
    background: #f3f4f6;
}

.dashboard-shell {
    display: grid;
    gap: 20px;
}

.erp-dashboard {
    display: grid;
    gap: 18px;
}

.erp-section-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.erp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}

.erp-kpi-card {
    min-height: 118px;
    padding: 14px 16px 12px;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 10px 24px var(--shadow);
    display: grid;
    align-content: space-between;
}

.erp-kpi-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.erp-kpi-label {
    margin-top: 10px;
    font-size: 0.95rem;
    font-weight: 700;
}

.erp-kpi-meta {
    font-size: 0.82rem;
    opacity: 0.92;
}

.kpi-cyan {
    background: #27a9c4;
}

.kpi-green {
    background: #2bb245;
}

.kpi-red {
    background: #e03347;
}

.kpi-amber {
    background: #efb70f;
    color: #1f2328;
}

.kpi-gray {
    background: #7a828d;
}

.kpi-blue {
    background: #1976e8;
}

.erp-alert-grid,
.erp-quick-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.erp-alert-card,
.erp-quick-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 20px var(--shadow);
}

.erp-quick-card:hover {
    text-decoration: none;
    border-color: rgba(31, 35, 40, 0.18);
}

.erp-alert-swatch,
.erp-quick-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: inline-block;
}

.swatch-amber {
    background: #f0bc12;
}

.swatch-red {
    background: #e33c4d;
}

.swatch-gray {
    background: #7a828d;
}

.swatch-cyan {
    background: #27a9c4;
}

.swatch-blue {
    background: #1976e8;
}

.swatch-green {
    background: #2bb245;
}

.erp-alert-title {
    color: var(--muted);
    font-size: 0.84rem;
}

.erp-alert-value {
    margin-top: 4px;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1;
}

.erp-quick-card strong {
    display: block;
    font-size: 0.95rem;
}

.erp-quick-card span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.85rem;
}

.erp-dashboard-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 16px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: 1.35fr minmax(250px, 0.85fr);
    gap: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    background: var(--surface);
    box-shadow: 0 14px 34px var(--shadow);
}

.dashboard-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2.1vw, 2rem);
    line-height: 1.22;
}

.dashboard-copy {
    margin: 0;
    color: var(--muted);
    max-width: 64ch;
}

.dashboard-badges {
    margin-top: 16px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 700;
}

.dashboard-badge-accent {
    background: var(--surface-2);
    border-color: rgba(255, 138, 42, 0.22);
}

.dashboard-hero-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface-2);
}

.dashboard-hero-panel-label {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.dashboard-hero-metric {
    margin-top: 8px;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.dashboard-hero-metric span {
    font-size: 1rem;
    color: var(--muted);
    margin-left: 6px;
}

.dashboard-progress {
    margin-top: 12px;
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

body[data-theme="dark"] .dashboard-progress,
body[data-theme="system"] .dashboard-progress {
    background: rgba(255, 255, 255, 0.14);
}

.dashboard-progress-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--brand);
}

.dashboard-hero-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(170px, 1fr));
    gap: 14px;
}

.dashboard-stat-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface);
    box-shadow: 0 12px 28px var(--shadow);
}

.dashboard-stat-label {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.dashboard-stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.06;
}

.dashboard-stat-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.85rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
}

.dashboard-main {
    min-width: 0;
}

.dashboard-table-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    padding: 16px;
    box-shadow: 0 12px 28px var(--shadow);
    overflow: hidden;
}

.dashboard-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-section-kicker {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-section-head h2,
.dashboard-actions-card h2,
.dashboard-summary-card h2 {
    margin: 2px 0 0;
    font-size: 1.1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 700;
}

.status-paid {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.18);
}

.status-unpaid {
    border-color: rgba(244, 63, 94, 0.5);
    background: rgba(244, 63, 94, 0.16);
}

.dashboard-side {
    display: grid;
    gap: 16px;
    align-content: start;
}

.dashboard-actions-card,
.dashboard-summary-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: var(--surface);
    box-shadow: 0 12px 28px var(--shadow);
}

.dashboard-action {
    display: block;
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    text-decoration: none;
    color: inherit;
}

.dashboard-action strong {
    display: block;
    font-size: 0.96rem;
}

.dashboard-action span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.dashboard-note {
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: var(--surface-2);
    font-size: 0.86rem;
}

.page-shell {
    display: grid;
    gap: 18px;
}

.page-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 20px;
    background: var(--surface);
    box-shadow: 0 12px 28px var(--shadow);
}

.page-hero-tight {
    align-items: center;
}

.page-kicker {
    margin: 0 0 8px;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.page-title {
    margin: 0 0 8px;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
    line-height: 1.2;
}

.page-copy {
    margin: 0;
    color: var(--muted);
    max-width: 62ch;
}

.page-hero-side {
    display: grid;
    gap: 10px;
    align-content: start;
}

.page-mini-stat {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--surface-2);
}

.page-mini-stat span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 700;
}

.page-mini-stat strong {
    display: block;
    line-height: 1.2;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-weight: 700;
    font-size: 0.9rem;
}

.stat-chip span {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.stat-chip strong {
    font-weight: 800;
}

.page-panel-grid,
.page-metric-grid {
    display: grid;
    gap: 16px;
}

.page-panel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-info-card,
.page-highlight-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    background: var(--surface);
    box-shadow: 0 20px 44px var(--shadow);
}

.page-highlight-card {
    background: var(--surface);
    border-left: 3px solid rgba(255, 138, 42, 0.55);
}

.page-info-label,
.page-highlight-label {
    margin: 0 0 8px;
    font-size: 0.76rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}

.page-info-value {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.page-info-meta,
.page-highlight-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.page-highlight-title {
    margin: 0;
    font-size: 1.2rem;
}

.page-highlight-amount {
    margin: 14px 0 0;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1;
}

.page-highlight-amount span {
    font-size: 1rem;
    color: var(--muted);
    margin-right: 6px;
}

.page-highlight-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.page-highlight-row,
.detail-list-row,
.result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.page-highlight-row {
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.page-highlight-row span,
.detail-list-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.page-highlight-row strong,
.detail-list-value {
    text-align: right;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.table-toolbar-copy {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.table-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.tab-button {
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 7px 10px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--text);
}

.tab-button.is-active {
    background: var(--surface-2);
}

.table-search {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-search input {
    margin: 0;
    width: min(320px, 100%);
}

.table-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
}

.table-scroll {
    overflow-x: auto;
}

.table-scroll table {
    min-width: 720px;
}

.table-cell-stack {
    display: grid;
    gap: 4px;
}

.table-title {
    font-weight: 700;
}

.table-subtitle {
    color: var(--muted);
    font-size: 0.86rem;
}

.table-inline-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.detail-list {
    display: grid;
    gap: 12px;
}

.detail-list-row {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.detail-list-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.container-detail-grid,
.checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
    gap: 16px;
}

.container-detail-main,
.container-detail-side {
    min-width: 0;
}

.compact-form {
    box-shadow: none;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
}

.compact-form input {
    margin-bottom: 12px;
}

.stack-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.result-card {
    margin-top: 16px;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.result-card-ok {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.12);
}

.result-card-bad {
    border-color: rgba(244, 63, 94, 0.45);
    background: rgba(244, 63, 94, 0.12);
}

.result-title {
    margin: 0 0 10px;
    font-weight: 700;
}

.result-row {
    padding: 8px 0;
    border-top: 1px solid var(--border);
}

.result-row:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.result-action {
    margin-top: 12px;
}

.checkout-summary {
    align-content: start;
}

.checkout-form {
    display: grid;
    gap: 16px;
}

.checkout-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.checkout-form-grid .form-field-full {
    grid-column: 1 / -1;
}

.checkout-form label {
    margin-bottom: 8px;
}

.checkout-note {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.checkout-note-card {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.success-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
}

.success-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.14);
    font-weight: 700;
}

.success-badge::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #10b981;
}

.success-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    background: var(--surface);
    box-shadow: 0 12px 28px var(--shadow);
}

.page-center {
    max-width: 640px;
    margin: 0 auto;
}

.success-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.login-body {
    min-height: 100vh;
    background: var(--bg);
}

.container-login {
    max-width: 1160px;
}

.topbar-login {
    background: transparent;
    border-bottom: 0;
}

@media print {
    body {
        background: #ffffff !important;
        color: #111827 !important;
    }

    .print-document-shell {
        max-width: none;
        margin: 0;
        padding: 0;
    }

    .print-gatepass {
        gap: 16px;
    }

    .print-actions {
        display: none;
    }

    .print-gatepass-card,
    .print-gatepass-status {
        border-color: #111827;
    }
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, 420px);
    gap: 28px;
    align-items: stretch;
    margin-top: 46px;
}

.login-brand-panel {
    padding: 36px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.12);
}

.login-brand-kicker {
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

.login-brand-title {
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    line-height: 1.12;
}

.login-brand-copy {
    margin: 0 0 26px;
    color: var(--muted);
    max-width: 44ch;
    font-size: 1.02rem;
    line-height: 1.5;
}

.login-brand-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    display: grid;
    gap: 12px;
}

.login-brand-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-weight: 600;
}

.login-brand-row strong {
    color: var(--text);
}

.login-panel {
    display: grid;
    align-content: center;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 46px 92px rgba(0, 0, 0, 0.18);
}

.login-kicker {
    margin: 0 0 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}

.login-title {
    margin: 0 0 10px;
    font-size: 1.6rem;
}

.login-copy {
    margin: 0 0 20px;
    color: var(--muted);
}

.login-form label {
    font-size: 0.92rem;
    color: var(--muted);
}

.login-form input {
    padding: 12px 12px;
}

.login-submit {
    width: 100%;
    justify-content: center;
}

.login-credentials {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
    color: var(--muted);
}

.login-credentials-title {
    margin: 0 0 8px;
    font-weight: 700;
    color: var(--text);
}

code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 138, 42, 0.14);
    border: 1px solid rgba(255, 138, 42, 0.22);
    color: var(--text);
}

@media (max-width: 880px) {
    .erp-shell {
        grid-template-columns: 1fr;
    }

    .erp-sidebar {
        padding-bottom: 12px;
    }

    .erp-main-header {
        flex-wrap: wrap;
    }

    .erp-kpi-grid,
    .erp-alert-grid,
    .erp-quick-grid,
    .erp-dashboard-panels {
        grid-template-columns: 1fr 1fr;
    }

    .topbar-inner {
        flex-wrap: wrap;
        justify-content: center;
    }

    .topbar-right {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .topbar-links {
        text-align: center;
    }

    .topbar-menu {
        justify-content: center;
    }

    .topbar-menu-rail {
        justify-content: center;
    }

    .nav-dropdown-menu {
        right: auto;
        left: 0;
    }

    .login-shell {
        grid-template-columns: 1fr;
        margin-top: 24px;
    }

    .login-brand-panel {
        padding: 24px;
    }

    .dashboard-hero {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-columns {
        grid-template-columns: 1fr;
    }

    .page-hero,
    .page-panel-grid,
    .container-detail-grid,
    .checkout-grid,
    .success-layout {
        grid-template-columns: 1fr;
    }

    .page-metric-grid,
    .checkout-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .erp-content {
        padding: 14px;
    }

    .erp-kpi-grid,
    .erp-alert-grid,
    .erp-quick-grid,
    .erp-dashboard-panels,
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}
