:root {
    --bg-main: #f4f7fb;
    --bg-sidebar: #132238;
    --text-main: #10233d;
    --text-soft: #62748a;
    --line-soft: #d9e2ef;
    --primary: #0d6efd;
    --card-shadow: 0 18px 45px rgba(16, 35, 61, 0.08);
    --radius-lg: 1.4rem;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-main);
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.12), transparent 26%),
        linear-gradient(180deg, #eef4ff 0%, #f8fbff 35%, #f4f7fb 100%);
}

.admin-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.08), transparent 20%),
        linear-gradient(180deg, #f8fbff 0%, var(--bg-main) 100%);
}

.admin-shell {
    position: relative;
    min-width: 0;
}

.sidebar-panel {
    width: 280px;
    flex: 0 0 280px;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0e1b2f 100%);
    color: #fff;
    position: sticky;
    top: 0;
    overflow: hidden;
    transition: width 0.25s ease, flex-basis 0.25s ease, margin 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}

.sidebar-shell {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-height: 100vh;
    padding: 1.5rem 1.25rem;
}

.sidebar-brand-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.sidebar-brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.25rem;
}

.sidebar-brand-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.sidebar-brand-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.82rem;
}

.sidebar-section-label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.85rem;
}

.sidebar-nav {
    gap: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 1rem;
    transition: 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
}

.sidebar-badge {
    background: rgba(255, 255, 255, 0.12);
}

.mobile-sidebar {
    background: linear-gradient(180deg, var(--bg-sidebar) 0%, #0e1b2f 100%);
}

.topbar {
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(217, 226, 239, 0.8);
    backdrop-filter: blur(10px);
}

.sidebar-toggle-btn {
    align-items: center;
    gap: 0.45rem;
}

.topbar-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.admin-main {
    flex: 1 1 0%;
    min-width: 0;
}

body.sidebar-collapsed .sidebar-panel {
    width: 0;
    flex-basis: 0;
    opacity: 0;
    transform: translateX(-32px);
    pointer-events: none;
}

.admin-content {
    padding: 1.25rem 0 2rem;
}

@media (prefers-reduced-motion: reduce) {
    .sidebar-panel {
        transition: none;
    }
}

.auth-card,
.content-card,
.feature-card,
.stat-card,
.mobile-entity-card {
    background: #fff;
    border: 1px solid rgba(217, 226, 239, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.auth-card {
    overflow: hidden;
}

.auth-card-header {
    padding: 1.5rem 1.5rem 1rem;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1), rgba(255, 255, 255, 0));
}

.auth-card-body,
.content-card,
.feature-card,
.stat-card,
.mobile-entity-card {
    padding: 1.25rem;
}

.auth-brand {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: #eaf2ff;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.page-eyebrow {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.page-title {
    margin: 0.35rem 0 0.25rem;
    font-size: clamp(1.4rem, 2vw, 2rem);
    font-weight: 800;
}

.page-subtitle {
    margin: 0;
    color: var(--text-soft);
    max-width: 700px;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.breadcrumb-shell {
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(217, 226, 239, 0.8);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
}

.breadcrumb {
    --bs-breadcrumb-divider-color: var(--text-soft);
    --bs-breadcrumb-item-active-color: var(--text-main);
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.badge-soft {
    background: #eaf2ff;
    color: var(--primary);
}

.stat-label {
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.35rem 0;
}

.stat-note {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.section-meta {
    font-size: 0.85rem;
    color: var(--text-soft);
}

.quick-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.07), rgba(255, 255, 255, 0));
    border: 1px solid rgba(13, 110, 253, 0.12);
}

.quick-link-card:hover {
    color: inherit;
    border-color: rgba(13, 110, 253, 0.26);
}

.dashboard-header {
    align-items: flex-start;
}

.dashboard-role-stack {
    min-width: min(320px, 100%);
}

.dashboard-hero-card,
.dashboard-metric-card {
    background: #fff;
    border: 1px solid rgba(217, 226, 239, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
}

.dashboard-hero-card {
    padding: 1.25rem;
    background:
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.12), transparent 26%),
        linear-gradient(135deg, rgba(13, 110, 253, 0.05), rgba(255, 255, 255, 0.96));
}

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

.dashboard-micro-stat {
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(217, 226, 239, 0.85);
}

.dashboard-micro-label {
    color: var(--text-soft);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.dashboard-micro-value {
    margin-top: 0.35rem;
    font-size: 1.4rem;
    font-weight: 800;
}

.dashboard-metric-card {
    height: 100%;
    padding: 1.05rem 1.1rem;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(247,250,255,0.98) 100%);
}

.dashboard-metric-card.tone-warning {
    background: linear-gradient(180deg, rgba(255,251,235,1) 0%, rgba(255,255,255,0.98) 100%);
}

.dashboard-metric-card.tone-danger {
    background: linear-gradient(180deg, rgba(255,245,245,1) 0%, rgba(255,255,255,0.98) 100%);
}

.dashboard-metric-card.tone-success {
    background: linear-gradient(180deg, rgba(241,253,246,1) 0%, rgba(255,255,255,0.98) 100%);
}

.dashboard-metric-card.tone-secondary {
    background: linear-gradient(180deg, rgba(248,250,252,1) 0%, rgba(255,255,255,0.98) 100%);
}

.dashboard-metric-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8rem;
}

.dashboard-metric-label {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.dashboard-metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 110, 253, 0.09);
    color: var(--primary);
}

.dashboard-metric-value {
    font-size: clamp(1.45rem, 2vw, 1.95rem);
    line-height: 1.15;
    font-weight: 800;
}

.dashboard-metric-note {
    margin-top: 0.4rem;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.dashboard-chart-list {
    display: grid;
    gap: 0.85rem;
}

.dashboard-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 42%);
    gap: 1rem;
    align-items: center;
}

.dashboard-chart-copy {
    min-width: 0;
}

.dashboard-chart-label {
    font-weight: 700;
    line-height: 1.35;
}

.dashboard-chart-meta {
    margin-top: 0.2rem;
    font-size: 0.86rem;
    color: var(--text-soft);
}

.dashboard-chart-bar-wrap {
    width: 100%;
    min-height: 12px;
    border-radius: 999px;
    background: #eaf0f8;
    overflow: hidden;
}

.dashboard-chart-bar {
    min-height: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6 0%, #0d6efd 100%);
}

.dashboard-list-stack {
    display: grid;
    gap: 0.8rem;
}

.dashboard-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.95rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(217, 226, 239, 0.9);
    background: #fbfdff;
}

.dashboard-list-title {
    font-weight: 700;
}

.dashboard-list-subtitle,
.dashboard-list-meta {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.dashboard-list-meta {
    margin-top: 0.15rem;
}

.dashboard-list-value {
    font-weight: 800;
    text-align: right;
}

.barcode-shortcut-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.45rem;
    color: var(--text-soft);
    font-size: 0.82rem;
}

.quick-link-title {
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.quick-link-text {
    color: var(--text-soft);
    font-size: 0.92rem;
}

.permission-group + .permission-group,
.permission-check-group + .permission-check-group {
    padding-top: 1rem;
    border-top: 1px dashed var(--line-soft);
}

.permission-check-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.permission-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    width: 100%;
    height: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line-soft);
    border-radius: 1rem;
    background: #fff;
    cursor: pointer;
}

.permission-check-item input {
    margin-top: 0.2rem;
}

.permission-check-item strong {
    display: block;
    font-size: 0.95rem;
}

.permission-check-item small {
    display: block;
    margin-top: 0.25rem;
    color: var(--text-soft);
}

.assignment-group + .assignment-group {
    padding-top: 1rem;
    border-top: 1px dashed var(--line-soft);
}

.assignment-group-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}

.assignment-subgroup + .assignment-subgroup {
    margin-top: 1rem;
}

.assignment-subgroup-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 0.6rem;
}

.mobile-entity-card {
    padding: 1rem;
}

.mobile-entity-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
}

.mobile-entity-title {
    font-weight: 800;
}

.mobile-entity-subtitle,
.mobile-entity-meta {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.mobile-entity-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.table-modern thead th {
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-soft);
    border-bottom-width: 1px;
}

.table-modern td,
.table-modern th {
    padding: 1rem;
}

.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    border: 1px dashed var(--line-soft);
    border-radius: 1rem;
    color: var(--text-soft);
}

.empty-state.compact {
    padding: 1.2rem;
}

.empty-state i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.75rem;
}

.empty-state h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
}

.alert {
    border: 0;
    border-radius: 1rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.status-pill-success {
    background: #dff7ea;
    color: #0c6b39;
}

.status-pill-secondary {
    background: #edf1f7;
    color: #596b82;
}

.status-pill-primary {
    background: #eaf2ff;
    color: var(--primary);
}

.status-pill-danger {
    background: #ffe7e7;
    color: #b42318;
}

.status-pill-light {
    background: #f7f9fc;
    color: var(--text-soft);
}

.barcode-preview-wrap,
.qr-preview-wrap,
.verification-shell {
    border: 1px dashed var(--line-soft);
    border-radius: 1rem;
    padding: 1rem;
    background: #fbfdff;
}

.barcode-preview-table,
.qr-preview-table {
    max-width: 180px;
}

.barcode-preview-image,
.qr-preview-image {
    display: block;
    width: 100%;
    height: auto;
}

.qr-preview-wrap {
    max-width: 210px;
}

.verification-detail-card {
    padding: 1rem;
    border-radius: 1rem;
    background: #f8fbff;
    border: 1px solid rgba(217, 226, 239, 0.9);
}

.verification-detail-label {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.verification-detail-value {
    font-weight: 700;
    word-break: break-word;
}

.budget-category-card {
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(217, 226, 239, 0.95);
    background: #fbfdff;
}

.budget-category-input-wrap {
    width: 100%;
    max-width: 260px;
}

.budget-category-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.budget-stat-value {
    font-size: 1.35rem;
    line-height: 1.3;
}

.procurement-form-shell {
    display: block;
}

.procurement-summary-card {
    height: 100%;
    padding: 1rem;
    border-radius: 1rem;
    background: #f8fbff;
    border: 1px solid rgba(217, 226, 239, 0.9);
}

.procurement-summary-label {
    color: var(--text-soft);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
}

.procurement-summary-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.procurement-summary-note {
    margin-top: 0.35rem;
    color: var(--text-soft);
    font-size: 0.86rem;
}

.procurement-items-stack {
    display: grid;
    gap: 1rem;
}

.procurement-item-card {
    padding: 1rem;
    border-radius: 1.1rem;
    border: 1px solid rgba(217, 226, 239, 0.95);
    background:
        linear-gradient(135deg, rgba(13, 110, 253, 0.04), rgba(255, 255, 255, 0)),
        #fbfdff;
}

.procurement-item-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.procurement-item-index {
    font-size: 1rem;
    font-weight: 800;
}

.procurement-item-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 160px;
    gap: 1rem;
    align-items: flex-start;
    margin-top: 1rem;
}

.procurement-budget-hint {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    background: #eef5ff;
    color: #31527e;
    font-size: 0.88rem;
}

.procurement-budget-hint.is-overbudget {
    background: #fff1f1;
    color: #a02121;
}

.procurement-photo-preview {
    border: 1px dashed var(--line-soft);
    border-radius: 1rem;
    background: #fff;
    padding: 0.75rem;
}

.procurement-photo-preview img,
.procurement-photo-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0.7rem;
    object-fit: cover;
}

.procurement-photo-thumb {
    width: 88px;
}

.approval-progress-list {
    display: grid;
    gap: 0.5rem;
}

.approval-progress-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.approval-action-card {
    padding: 1rem;
    border-radius: 1rem;
    background: #f8fbff;
    border: 1px solid rgba(217, 226, 239, 0.9);
}

.stock-opname-form {
    min-width: 0;
}

.stock-opname-table-header {
    flex-wrap: wrap;
}

.stock-opname-table-wrap {
    width: 100%;
    border-radius: 1rem;
}

.stock-opname-table {
    min-width: 1080px;
    table-layout: fixed;
}

.stock-opname-table th,
.stock-opname-table td {
    vertical-align: top;
}

.stock-opname-col-number {
    width: 52px;
}

.stock-opname-col-item {
    width: 28%;
}

.stock-opname-col-qty {
    width: 120px;
}

.stock-opname-col-cost {
    width: 140px;
}

.stock-opname-col-input {
    width: 150px;
}

.stock-opname-col-difference {
    width: 130px;
}

.stock-opname-col-note {
    width: 220px;
}

.stock-opname-row-number,
.stock-opname-number-cell,
.stock-opname-difference-cell {
    white-space: nowrap;
}

.stock-opname-number-cell {
    font-variant-numeric: tabular-nums;
}

.stock-opname-item-cell {
    min-width: 0;
    overflow-wrap: anywhere;
}

.stock-opname-input-cell .form-control,
.stock-opname-note-cell .form-control {
    width: 100%;
    min-width: 0;
}

.stock-opname-difference-cell .status-pill {
    min-width: 78px;
    justify-content: center;
}

.pagination {
    --bs-pagination-border-radius: 0.9rem;
}

@media (max-width: 991.98px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        width: 100%;
    }

    .page-actions .btn {
        width: 100%;
    }

    .admin-content {
        padding-top: 1rem;
    }

    .procurement-item-footer {
        grid-template-columns: 1fr;
    }

    .procurement-photo-preview {
        max-width: 220px;
    }

    .dashboard-chart-row,
    .dashboard-list-item {
        grid-template-columns: 1fr;
    }

    .dashboard-list-value {
        text-align: left;
    }

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

    .stock-opname-table {
        min-width: 980px;
    }

    .stock-opname-col-item {
        width: 260px;
    }

    .stock-opname-col-note {
        width: 190px;
    }
}
