@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --sidebar-w: 220px;
    --sidebar-bg: #071412;
    --sidebar-active: transparent;
    --sidebar-active-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.05);
    --content-bg: #f5f7f6;
    --card-radius: 16px;
    --primary-blue: #0f766e;
    --primary-dark: #0d5f58;
    --accent: #0f766e;
    --text-dark: #101816;
    --text-muted: #6b7c77;
    --border-color: #e4ebe8;
    --hairline: #e8eeeb;
    --surface: #ffffff;
    --glow: transparent;
    --shadow-soft: 0 8px 24px rgba(10, 30, 26, 0.045);
}

body.procure-app {
    font-family: 'Plus Jakarta Sans', 'Manrope', sans-serif;
    background: var(--content-bg);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

/* Narrow dark rail */
.procure-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1030;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.procure-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 16px 18px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.procure-brand:hover {
    color: #fff;
    text-decoration: none;
}

.procure-brand-icon {
    width: 32px;
    height: 32px;
    background: #0f766e;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: none;
}

.procure-brand-text {
    font-family: 'Manrope', 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.04em;
    display: block;
    line-height: 1.1;
}

.procure-brand-tag {
    display: block;
    font-size: 9px;
    font-weight: 500;
    color: #6f857f;
    letter-spacing: 0.04em;
    margin-top: 3px;
    text-transform: uppercase;
}

.procure-nav .nav-section {
    list-style: none;
    margin: 16px 10px 6px;
    padding: 0 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #5d736c;
}

.procure-nav {
    list-style: none;
    padding: 8px 8px 16px;
    margin: 0;
    flex: 1;
}

.procure-nav .nav-item {
    margin-bottom: 1px;
}

.procure-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    color: #8fa39c;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
    border-left: 2px solid transparent;
}

.procure-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #e8f0ed;
}

.procure-nav .nav-link.active {
    background: rgba(15, 118, 110, 0.14);
    color: var(--sidebar-active-text);
    border-left-color: #0f766e;
}

.procure-nav .nav-link i {
    width: 16px;
    text-align: center;
    font-size: 13px;
    opacity: 0.9;
}

.procure-user-panel {
    padding: 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.procure-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(15, 118, 110, 0.35);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.procure-user-info {
    flex: 1;
    min-width: 0;
}

.procure-user-name {
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.procure-user-role {
    color: #6f857f;
    font-size: 11px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.procure-user-panel .fa-chevron-down,
.procure-user-panel .fa-chevron-up {
    color: #6f857f;
    font-size: 11px;
}

/* Main Content */
.procure-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 28px 32px 40px;
    max-width: 100%;
}

.procure-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--hairline);
}

.procure-header-title {
    font-family: 'Manrope', 'Plus Jakarta Sans', sans-serif;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-dark);
    margin: 0;
}

.procure-header-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin: 6px 0 0;
}

.procure-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.procure-search {
    position: relative;
}

.procure-search input {
    width: 280px;
    padding: 8px 14px 8px 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 13px;
    background: #fff;
    outline: none;
}

.procure-search input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.procure-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.procure-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    height: 38px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.procure-btn:hover {
    background: #f7faf9;
}

.procure-btn i {
    font-size: 12px;
    color: var(--text-muted);
}

/* KPI Cards */
.kpi-card {
    background: #fff;
    border-radius: var(--card-radius);
    padding: 18px 20px 12px;
    border: 1px solid var(--border-color);
    height: 100%;
}

.kpi-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.kpi-icon.blue { background: #dbeafe; color: #2563eb; }
.kpi-icon.green { background: #dcfce7; color: #16a34a; }
.kpi-icon.purple { background: #f3e8ff; color: #9333ea; }
.kpi-icon.teal { background: #ccfbf1; color: #0d9488; }
.kpi-icon.cyan { background: #e0f2fe; color: #0284c7; }

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px;
    line-height: 1.2;
}

.kpi-change {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-change.up { color: #16a34a; }
.kpi-change.down { color: #dc2626; }

.kpi-sparkline {
    height: 40px;
    margin-top: 4px;
}

/* Chart Cards */
.chart-card {
    background: #fff;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    height: auto;
    overflow: hidden;
}

/* Equal-height cards only when placed in Bootstrap columns */
.row > [class*="col-"] > .chart-card {
    height: 100%;
}

.chart-card.chart-card-auto {
    height: auto;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px 0;
}

.chart-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-card-title .info-icon {
    color: var(--text-muted);
    font-size: 13px;
    cursor: help;
}

.chart-card-body {
    padding: 12px 20px 20px;
}

.chart-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 28px 4px 10px;
    font-size: 12px;
    color: var(--text-dark);
    background: #fff;
    appearance: auto;
}

.chart-container {
    position: relative;
    height: 260px;
}

.chart-container-sm {
    position: relative;
    height: 200px;
}

/* Donut legend */
.donut-legend {
    list-style: none;
    padding: 0;
    margin: 0;
}

.donut-legend li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}

.donut-legend .legend-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-legend .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend .legend-label {
    color: var(--text-dark);
    font-weight: 500;
}

.donut-legend .legend-value {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.donut-legend .legend-pct {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 36px;
    text-align: right;
}

/* PO Status layout */
.po-status-layout {
    display: flex;
    align-items: center;
    gap: 20px;
}

.po-status-chart {
    flex: 0 0 180px;
    position: relative;
    height: 180px;
}

/* Table */
.procure-table {
    width: 100%;
    border-collapse: collapse;
}

.procure-table thead th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.procure-table tbody td {
    padding: 12px;
    font-size: 13px;
    color: var(--text-dark);
    border-bottom: 1px solid #f1f5f9;
}

.procure-table tbody tr:last-child td {
    border-bottom: none;
}

.procure-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(70vh, 640px);
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
}

.procure-table-scroll .procure-table {
    margin: 0;
    min-width: 900px;
}

.procure-table-scroll .procure-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    box-shadow: 0 1px 0 var(--border-color);
}

.procure-table-scroll .procure-table tbody tr:hover td {
    background: #f8fafc;
}

.procure-content .pagination svg,
.ic-page svg.w-5 {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1.25rem;
    max-height: 1.25rem;
}

.procure-table .procure-btn {
    padding: 5px 10px;
    font-size: 12px;
}

.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.approved { background: #dcfce7; color: #15803d; }
.status-badge.issued { background: #dbeafe; color: #1d4ed8; }
.status-badge.pending { background: #fef3c7; color: #b45309; }
.status-badge.draft { background: #f1f5f9; color: #64748b; }
.status-badge.cancelled { background: #fee2e2; color: #b91c1c; }

.view-all-link {
    font-size: 13px;
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.view-all-link:hover {
    text-decoration: underline;
    color: #1d4ed8;
}

/* Contracts list */
.contract-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.contract-item:last-child {
    border-bottom: none;
}

.contract-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 2px;
}

.contract-supplier {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.contract-date {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.days-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #fef3c7;
    color: #b45309;
    white-space: nowrap;
}

.days-badge.urgent {
    background: #fee2e2;
    color: #b91c1c;
}

/* Savings insight */
.savings-insight {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--card-radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border: 1px solid #a7f3d0;
}

.savings-icon {
    width: 44px;
    height: 44px;
    background: #10b981;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.savings-text h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 4px;
}

.savings-text p {
    font-size: 13px;
    color: #16a34a;
    margin: 0 0 8px;
    font-weight: 500;
}

.savings-link {
    font-size: 13px;
    color: var(--primary-blue);
    font-weight: 500;
    text-decoration: none;
}

.savings-link:hover {
    text-decoration: underline;
}

/* Auth pages */
.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-dark);
}

.auth-brand:hover {
    text-decoration: none;
    color: var(--text-dark);
}

.auth-brand-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-blue);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.auth-brand-text {
    font-size: 24px;
    font-weight: 700;
}

.login-page, .register-page {
    background: var(--content-bg);
}

.login-box .card, .register-box .card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.login-box .btn-primary, .register-box .btn-primary {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    border-radius: 8px;
}

.login-box .btn-primary:hover, .register-box .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.login-box .card-outline-primary {
    border-top: 3px solid var(--primary-blue);
}

/* Mobile toggle button */
.procure-mobile-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 42px;
    height: 42px;
    background: #071412;
    color: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 1040;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: var(--shadow-soft);
}

/* Sidebar overlay for mobile */
.procure-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 20, 18, 0.45);
    z-index: 1025;
    display: none;
    backdrop-filter: blur(2px);
}

.procure-sidebar-overlay.show {
    display: block;
}

@media (max-width: 991.98px) {
    .procure-sidebar {
        transform: translateX(-100%);
        transition: transform 0.28s ease;
        width: min(280px, 86vw);
    }

    .procure-sidebar.show {
        transform: translateX(0);
    }

    .procure-content {
        margin-left: 0;
        padding: 18px 14px 28px;
        padding-top: 64px;
    }

    .procure-search input {
        width: 100%;
        max-width: 100%;
    }

    .procure-header-actions {
        width: 100%;
    }

    .procure-header-actions .procure-btn,
    .procure-header-actions .procure-btn-primary {
        flex: 1 1 auto;
        justify-content: center;
    }

    .procure-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 18px;
        padding-bottom: 14px;
    }

    .procure-header-title {
        font-size: 24px !important;
    }

    .kpi-card {
        margin-bottom: 12px;
    }

    .po-status-layout {
        flex-direction: column;
    }

    .po-status-chart {
        flex: unset;
        width: 100%;
    }

    .so-page-title-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .so-wh-layout {
        display: flex !important;
        flex-direction: column;
        gap: 14px;
    }
}

@media (max-width: 575.98px) {
    .procure-content {
        padding: 14px 12px 24px;
        padding-top: 60px;
    }

    .so-section-head {
        padding: 14px 14px 0;
    }

    .so-section-body {
        padding: 14px;
    }

    .so-section-footer {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 14px 14px;
    }

    .so-zone-chips {
        flex-wrap: wrap;
    }
}

@media (min-width: 992px) {
    .procure-mobile-toggle {
        display: none !important;
    }

    .procure-sidebar-overlay {
        display: none !important;
    }
}

/* Form cards & filters */
.procure-form-card {
    background: #fff;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.procure-filters {
    background: #fff;
    border-radius: var(--card-radius);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    margin-bottom: 16px;
}

.procure-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--primary-blue);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.procure-btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.procure-detail-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}

.procure-detail-value {
    font-size: 14px;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 14px;
}

.expiry-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.expiry-badge.red { background: #fee2e2; color: #b91c1c; }
.expiry-badge.orange { background: #ffedd5; color: #c2410c; }
.expiry-badge.yellow { background: #fef3c7; color: #b45309; }
.expiry-badge.green { background: #dcfce7; color: #15803d; }

.approval-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
}

.approval-timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border-color);
}

.approval-timeline li {
    position: relative;
    padding-left: 44px;
    padding-bottom: 20px;
}

.approval-timeline .tl-dot {
    position: absolute;
    left: 8px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary-blue);
}

.mapping-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.progress-ring-label {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* ── Purchase Order create/edit content layout ── */
.po-form-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.po-form-main {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
}

.po-form-side {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
}

@media (min-width: 992px) {
    .po-form-main {
        flex: 0 0 calc(75% - 8px);
        max-width: calc(75% - 8px);
    }

    .po-form-side {
        flex: 0 0 calc(25% - 8px);
        max-width: calc(25% - 8px);
        position: sticky;
        top: 16px;
        align-self: flex-start;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
}

.po-compact-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    margin-bottom: 16px;
    overflow: hidden;
}

.po-compact-card:last-child {
    margin-bottom: 0;
}

.po-compact-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
}

.po-compact-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.01em;
}

.po-compact-card-body {
    padding: 12px 14px;
}

.po-info-card .po-compact-card-body {
    padding: 14px 16px;
}

.po-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px 12px;
}

@media (min-width: 576px) {
    .po-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) {
    .po-info-grid {
        grid-template-columns: 1.4fr 1fr 1fr 0.7fr;
    }
}

.po-info-grid .po-field-notes {
    grid-column: 1 / -1;
}

.po-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.po-field .form-control {
    border-radius: 8px;
    font-size: 13px;
    min-height: 36px;
    padding: 6px 10px;
}

.po-supplier-label-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.po-supplier-label-row label {
    margin-bottom: 0;
}

.po-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.po-badge-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.po-badge-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.po-badge-warn {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.po-badge-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.po-lines-table th,
.po-lines-table td {
    padding: 8px 6px;
    vertical-align: middle;
    font-size: 12px;
}

.po-lines-table .form-control-sm {
    font-size: 12px;
    min-height: 32px;
    padding: 4px 8px;
}

.po-lines-totals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px;
    padding: 10px 14px 14px;
    border-top: 1px solid #f1f5f9;
    font-size: 13px;
    color: #0f172a;
}

.po-lines-totals strong {
    font-weight: 600;
}

.po-lines-tip {
    font-size: 11px;
    color: #64748b;
    margin: 0 14px 10px;
}

.po-side-metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.po-side-metric {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
}

.po-side-metric-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.po-side-metric-value {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.po-side-metric-value.is-emphasis {
    color: #1d4ed8;
    font-size: 15px;
}

.po-supplier-rank {
    list-style: none;
    margin: 0;
    padding: 0;
}

.po-supplier-rank li {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 12px;
}

.po-supplier-rank li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.po-supplier-rank li.is-best {
    background: #ecfdf5;
    margin: 0 -6px;
    padding: 8px 6px;
    border-radius: 8px;
    border-bottom: none;
}

.po-supplier-rank li.is-selected-expensive {
    background: #fff7ed;
    margin: 0 -6px;
    padding: 8px 6px;
    border-radius: 8px;
    border-bottom: none;
}

.po-supplier-rank .name {
    font-weight: 600;
    color: #0f172a;
}

.po-supplier-rank .meta {
    color: #64748b;
    font-size: 11px;
    margin-top: 2px;
}

.po-supplier-rank .price {
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    color: #0f172a;
}

.po-side-summary {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
    font-size: 12px;
    color: #334155;
}

.po-side-summary .is-good { color: #047857; font-weight: 600; }
.po-side-summary .is-warn { color: #c2410c; font-weight: 600; }
.po-side-summary .is-info { color: #1d4ed8; font-weight: 600; }

.po-qty-warning-card .po-compact-card-body {
    background: #fffbeb;
}

.po-qty-warning-text {
    margin: 0;
    font-size: 12px;
    color: #9a3412;
    line-height: 1.45;
}

.po-qty-warning-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    font-size: 11px;
    color: #7c2d12;
}

.po-collapse-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: none;
    padding: 0;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #1d4ed8;
    cursor: pointer;
}

.po-collapse-panel {
    display: none;
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 11px;
    color: #475569;
    line-height: 1.45;
}

.po-collapse-panel.is-open {
    display: block;
}

.po-side-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.po-skeleton {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
    background-size: 400% 100%;
    animation: poSkeleton 1.2s ease infinite;
}

.po-skeleton.lg { height: 28px; }
.po-skeleton.sm { height: 10px; width: 60%; }

@keyframes poSkeleton {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

.po-side-empty {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.45;
}

.po-use-qty-btn {
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.po-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 4px;
}

.po-ai-advisory {
    font-size: 12px;
    color: #334155;
    line-height: 1.45;
    margin: 0;
}

/* AI Inventory Demand Analysis */
.ida-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #4338ca;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 1px solid #c7d2fe;
}

.ida-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 1199.98px) {
    .ida-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ida-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.ida-kpi-grid .kpi-card {
    margin-bottom: 0;
}

.ida-recommendation-tabs .nav-link {
    border-radius: 8px 8px 0 0;
    font-weight: 600;
    font-size: 13px;
    color: #64748b;
}

.ida-recommendation-tabs .nav-link.active {
    color: #1d4ed8;
    border-color: #e2e8f0 #e2e8f0 #fff;
}

/* Role permission module cards */
.perm-group-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 16px;
    background: #fff;
    height: 100%;
}

.perm-group-card h6 {
    color: #1e293b;
}

.perm-group-checkboxes {
    max-height: 220px;
    overflow-y: auto;
}

/* =========================================================
   Swiss-modern NexSupply sections (warehouse v2 direction)
   ========================================================= */
.so-page-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.so-page-header .procure-header-title {
    font-family: 'Manrope', 'Plus Jakarta Sans', sans-serif;
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.035em;
    margin: 0;
}

.so-code-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 11px;
    border-radius: 999px;
    background: transparent;
    color: #0f766e;
    border: 1px solid rgba(15, 118, 110, 0.35);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.so-micro-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a9b95;
    margin-bottom: 10px;
}

.so-section {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.so-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 0;
}

.so-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.so-section-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

.so-section-icon--square {
    border-radius: 10px;
    background: #eef6f3;
    color: #0f766e;
}

.so-section-icon--circle {
    border-radius: 50%;
    background: #0f766e;
    color: #fff;
    box-shadow: none;
}

.so-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.so-section-body {
    padding: 16px 22px 20px;
}

.so-section-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 22px 16px;
    border-top: 1px solid var(--hairline);
    color: var(--text-muted);
    font-size: 12px;
}

.so-detail-list {
    margin: 0;
}

.so-detail-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--hairline);
    align-items: center;
}

.so-detail-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.so-detail-row:first-child {
    padding-top: 0;
}

.so-detail-row dt {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.so-detail-row dd {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.so-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.so-field {
    flex: 1 1 140px;
    min-width: 120px;
}

.so-field--grow {
    flex: 2 1 200px;
}

.so-field--action {
    flex: 0 0 auto;
}

.so-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.so-label-spacer {
    visibility: hidden;
}

.so-input,
.so-section .form-control,
.chart-card .form-control,
.procure-form-card .form-control {
    height: 42px;
    border-radius: 10px !important;
    border-color: var(--border-color) !important;
    background: #fff;
    font-size: 13px;
    box-shadow: none;
}

.so-input:focus,
.so-section .form-control:focus,
.chart-card .form-control:focus,
.procure-form-card .form-control:focus {
    border-color: #0f766e !important;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1) !important;
}

.so-add-btn {
    height: 42px;
    border-radius: 10px !important;
    padding: 0 16px;
    font-weight: 700;
}

.so-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.so-table {
    min-width: 520px;
}

.so-table thead th,
.procure-table thead th {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8a9b95;
    background: transparent;
    border-bottom: 1px solid var(--hairline);
    padding: 10px 12px;
    white-space: nowrap;
}

.so-table tbody td,
.procure-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
    font-size: 13.5px;
    color: var(--text-dark);
}

.so-table tbody tr:last-child td,
.procure-table tbody tr:last-child td {
    border-bottom: 0;
}

.so-table tbody tr:hover td,
.procure-table tbody tr:hover td {
    background: rgba(15, 118, 110, 0.03);
}

.so-zone-pill {
    display: inline-flex;
    min-width: 28px;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 8px;
    background: #eef6f3;
    color: #0f766e;
    font-weight: 700;
    font-size: 12px;
}

.so-zone-chips {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.so-zone-chip {
    min-width: 36px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
}

.so-zone-chip.is-active {
    border-color: #0f766e;
    color: #0f766e;
    background: #eef6f3;
}

.so-mono {
    font-family: 'Manrope', ui-monospace, monospace;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.so-danger-link {
    border: 0;
    background: transparent;
    color: #b42318;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
}

.so-danger-link:hover {
    color: #912018;
    text-decoration: underline;
}

.so-pager {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.so-pager-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #fff;
    color: #5b6b68;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.so-pager-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.so-pager-page {
    min-width: 30px;
    height: 30px;
    border-radius: 8px;
    background: #0f766e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.so-wh-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 16px;
    align-items: start;
}

.so-wh-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* Elevate existing cards to Swiss panels */
.chart-card,
.procure-form-card,
.kpi-card {
    border: 1px solid var(--hairline);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.chart-card-header {
    padding: 18px 22px 0;
}

.chart-card-body {
    padding: 16px 22px 20px;
}

.procure-btn,
.procure-btn-primary {
    border-radius: 10px;
    height: 38px;
    padding: 0 14px;
    font-weight: 600;
}

.procure-btn-primary {
    background: var(--primary-blue);
    box-shadow: none;
}

.procure-btn-primary:hover {
    background: var(--primary-dark);
}

.status-badge.approved {
    background: #eef6f3 !important;
    color: #0f766e !important;
    border-radius: 999px;
    padding: 4px 10px;
    font-weight: 700;
    font-size: 11px;
}

.so-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: none;
}

.so-filter-bar .form-control {
    max-width: 220px;
    height: 38px;
    border-radius: 10px;
}

@media (max-width: 991.98px) {
    .so-wh-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .so-detail-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .so-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .so-field--action .so-label-spacer {
        display: none;
    }

    .so-filter-bar .form-control {
        max-width: 100%;
        width: 100%;
    }
}


