/* ==========================================================================
   Rezycl Design System
   A modern SaaS design layer built on Bootstrap 5
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables / Design Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Brand Colors - Eco Green Theme */
    --wl-primary: #059669;
    --wl-primary-hover: #047857;
    --wl-primary-light: #ecfdf5;
    --wl-primary-subtle: #a7f3d0;

    /* Accent Colors */
    --wl-success: #10b981;
    --wl-success-light: #d1fae5;
    --wl-warning: #f59e0b;
    --wl-warning-light: #fef3c7;
    --wl-danger: #ef4444;
    --wl-danger-light: #fee2e2;
    --wl-info: #06b6d4;
    --wl-info-light: #cffafe;

    /* Neutral Colors */
    --wl-gray-50: #f9fafb;
    --wl-gray-100: #f3f4f6;
    --wl-gray-200: #e5e7eb;
    --wl-gray-300: #d1d5db;
    --wl-gray-400: #9ca3af;
    --wl-gray-500: #6b7280;
    --wl-gray-600: #4b5563;
    --wl-gray-700: #374151;
    --wl-gray-800: #1f2937;
    --wl-gray-900: #111827;

    /* Background */
    --wl-bg-body: #f1f5f0;
    --wl-bg-surface: #ffffff;
    --wl-bg-elevated: #ffffff;
    --wl-bg-sidebar: linear-gradient(180deg, rgba(255,255,255,0.72) 0%, rgba(236,253,245,0.55) 40%, rgba(255,255,255,0.65) 100%);
    --wl-bg-sidebar-hover: rgba(255, 255, 255, 0.5);
    --wl-bg-sidebar-active: rgba(255, 255, 255, 0.65);

    /* Text */
    --wl-text-primary: #111827;
    --wl-text-secondary: #6b7280;
    --wl-text-muted: #9ca3af;
    --wl-text-inverse: #ffffff;
    --wl-text-link: #059669;

    /* Borders */
    --wl-border-color: #e5e7eb;
    --wl-border-light: #f3f4f6;

    /* Shadows */
    --wl-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --wl-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --wl-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --wl-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --wl-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --wl-sidebar-width: 260px;
    --wl-sidebar-width-collapsed: 72px;
    --wl-navbar-height: 64px;

    /* InfoCard Type Colors */
    --wl-infocard-container: #059669;
    --wl-infocard-container-light: #ecfdf5;
    --wl-infocard-service: #d97706;
    --wl-infocard-service-light: #fef3c7;
    --wl-infocard-equipment: #7c3aed;
    --wl-infocard-equipment-light: #ede9fe;
    --wl-infocard-supply: #2563eb;
    --wl-infocard-supply-light: #dbeafe;
    --wl-infocard-account: #64748b;
    --wl-infocard-account-light: #f1f5f9;

    /* Border Radius */
    --wl-radius-sm: 6px;
    --wl-radius-md: 10px;
    --wl-radius-lg: 14px;
    --wl-radius-xl: 20px;
    --wl-radius-full: 9999px;

    /* Transitions */
    --wl-transition-fast: 150ms ease;
    --wl-transition-base: 200ms ease;
    --wl-transition-slow: 300ms ease;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--wl-bg-body);
    color: var(--wl-text-primary);
    line-height: 1.6;
    margin: 0;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--wl-text-primary);
}

h1 { font-size: 1.875rem; }

/* Navbar page title — injected via SectionContent */
.navbar-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--wl-text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
    color: var(--wl-text-secondary);
}

a {
    color: var(--wl-text-link);
    text-decoration: none;
    transition: color var(--wl-transition-fast);
    --bs-link-color: var(--wl-text-link);
    --bs-link-hover-color: var(--wl-primary-hover);
}

a:hover {
    color: var(--wl-primary-hover);
}

.link-primary {
    color: var(--wl-primary) !important;
}

.link-primary:hover {
    color: var(--wl-primary-hover) !important;
}

.text-primary {
    color: var(--wl-primary) !important;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination {
    --bs-pagination-color: var(--wl-text-primary);
    --bs-pagination-hover-color: var(--wl-primary);
    --bs-pagination-hover-bg: var(--wl-primary-light);
    --bs-pagination-hover-border-color: var(--wl-border-color);
    --bs-pagination-focus-color: var(--wl-primary);
    --bs-pagination-focus-bg: var(--wl-primary-light);
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(5, 150, 105, 0.25);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: var(--wl-primary);
    --bs-pagination-active-border-color: var(--wl-primary);
}

small, .text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--wl-text-muted) !important;
}

.text-secondary {
    color: var(--wl-text-secondary) !important;
}

h1:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-lg);
    box-shadow: var(--wl-shadow-xs);
    transition: box-shadow var(--wl-transition-base);
    overflow: visible;
}

.card:hover {
    box-shadow: var(--wl-shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--wl-border-light);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: var(--wl-gray-50);
    border-top: 1px solid var(--wl-border-light);
    padding: 1rem 1.5rem;
    border-radius: 0 0 var(--wl-radius-lg) var(--wl-radius-lg);
}

/* Stat Card */
.stat-card {
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--wl-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card .stat-icon.primary {
    background: var(--wl-primary-light);
    color: var(--wl-primary);
}

.stat-card .stat-icon.success {
    background: var(--wl-success-light);
    color: var(--wl-success);
}

.stat-card .stat-icon.warning {
    background: var(--wl-warning-light);
    color: var(--wl-warning);
}

.stat-card .stat-icon.danger {
    background: var(--wl-danger-light);
    color: var(--wl-danger);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--wl-text-primary);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: var(--wl-text-secondary);
    margin-bottom: 0.25rem;
}

.stat-card .stat-trend {
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--wl-radius-full);
}

.stat-card .stat-trend.up {
    background: var(--wl-success-light);
    color: var(--wl-success);
}

.stat-card .stat-trend.down {
    background: var(--wl-danger-light);
    color: var(--wl-danger);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--wl-radius-sm);
    transition: all var(--wl-transition-fast);
    font-size: 0.875rem;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:focus {
    box-shadow: 0 0 0 3px var(--wl-primary-subtle);
}

.btn-primary {
    --bs-btn-bg: var(--wl-primary);
    --bs-btn-color: white;
    --bs-btn-border-color: var(--wl-primary);
    --bs-btn-hover-bg: var(--wl-primary-hover);
    --bs-btn-hover-border-color: var(--wl-primary-hover);
    --bs-btn-hover-color: white;
    --bs-btn-active-bg: var(--wl-primary-hover);
    --bs-btn-active-border-color: var(--wl-primary-hover);
    --bs-btn-active-color: white;
    --bs-btn-focus-shadow-rgb: 5, 150, 105;
    --bs-btn-disabled-bg: var(--wl-primary);
    --bs-btn-disabled-border-color: var(--wl-primary);
}

.btn-secondary {
    --bs-btn-bg: var(--wl-gray-100);
    --bs-btn-color: var(--wl-text-primary);
    --bs-btn-border-color: var(--wl-gray-200);
    --bs-btn-hover-bg: var(--wl-gray-200);
    --bs-btn-hover-border-color: var(--wl-gray-300);
    --bs-btn-hover-color: var(--wl-text-primary);
    --bs-btn-active-bg: var(--wl-gray-200);
    --bs-btn-active-border-color: var(--wl-gray-300);
    --bs-btn-active-color: var(--wl-text-primary);
    --bs-btn-focus-shadow-rgb: 156, 163, 175;
}

.btn-outline-secondary {
    --bs-btn-color: var(--wl-text-secondary);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--wl-gray-100);
    --bs-btn-hover-border-color: var(--wl-gray-300);
    --bs-btn-hover-color: var(--wl-text-primary);
    --bs-btn-active-bg: var(--wl-gray-200);
    --bs-btn-active-border-color: var(--wl-gray-300);
    --bs-btn-active-color: var(--wl-text-primary);
    --bs-btn-focus-shadow-rgb: 156, 163, 175;
}

.btn-outline-primary {
    --bs-btn-color: var(--wl-primary);
    --bs-btn-border-color: var(--wl-primary);
    --bs-btn-hover-bg: var(--wl-primary);
    --bs-btn-hover-border-color: var(--wl-primary);
    --bs-btn-hover-color: white;
    --bs-btn-active-bg: var(--wl-primary);
    --bs-btn-active-border-color: var(--wl-primary);
    --bs-btn-active-color: white;
    --bs-btn-focus-shadow-rgb: 5, 150, 105;
    --bs-btn-disabled-color: var(--wl-primary);
    --bs-btn-disabled-border-color: var(--wl-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--wl-text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--wl-gray-100);
    color: var(--wl-text-primary);
}

.btn-danger {
    --bs-btn-bg: var(--wl-danger);
    --bs-btn-color: white;
    --bs-btn-border-color: var(--wl-danger);
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
    --bs-btn-hover-color: white;
    --bs-btn-active-bg: #dc2626;
    --bs-btn-active-border-color: #dc2626;
    --bs-btn-active-color: white;
    --bs-btn-focus-shadow-rgb: 239, 68, 68;
}

.btn-outline-danger {
    --bs-btn-color: var(--wl-danger);
    --bs-btn-border-color: var(--wl-danger);
    --bs-btn-hover-bg: var(--wl-danger);
    --bs-btn-hover-border-color: var(--wl-danger);
    --bs-btn-hover-color: white;
    --bs-btn-active-bg: #dc2626;
    --bs-btn-active-border-color: #dc2626;
    --bs-btn-active-color: white;
    --bs-btn-focus-shadow-rgb: 239, 68, 68;
    --bs-btn-disabled-color: var(--wl-danger);
    --bs-btn-disabled-border-color: var(--wl-danger);
}

.btn-success {
    --bs-btn-bg: var(--wl-success);
    --bs-btn-color: white;
    --bs-btn-border-color: var(--wl-success);
    --bs-btn-hover-bg: #059669;
    --bs-btn-hover-border-color: #059669;
    --bs-btn-hover-color: white;
    --bs-btn-active-bg: #059669;
    --bs-btn-active-border-color: #059669;
    --bs-btn-active-color: white;
    --bs-btn-focus-shadow-rgb: 16, 185, 129;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* Toolbar Action Button — reusable for filter toggles, export, etc. */
/* btn-filter-action is a semantic alias used on filter toggle buttons. */
.btn-toolbar-action,
.btn-filter-action {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-md);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--wl-text-secondary);
    cursor: pointer;
    transition: all var(--wl-transition-fast);
}

.btn-toolbar-action:hover,
.btn-filter-action:hover {
    border-color: var(--wl-gray-400);
    color: var(--wl-text-primary);
}

.btn-toolbar-action:disabled,
.btn-filter-action:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-toolbar-action.active,
.btn-filter-action.active {
    background: var(--wl-primary-light);
    border-color: var(--wl-primary);
    color: var(--wl-primary);
}

.btn-toolbar-action.accent,
.btn-filter-action.accent {
    border-color: var(--wl-primary);
    color: var(--wl-primary);
}

.btn-toolbar-action .chevron,
.btn-filter-action .chevron {
    font-size: 0.625rem;
    transition: transform var(--wl-transition-fast);
    margin-left: 0.125rem;
}

.btn-toolbar-action.active .chevron,
.btn-filter-action.active .chevron {
    transform: rotate(180deg);
}

.btn-toolbar-action .toolbar-badge,
.btn-filter-action .toolbar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 0.25rem;
    background: var(--wl-primary);
    color: white;
    border-radius: var(--wl-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .btn-toolbar-action .btn-label,
    .btn-filter-action .btn-label {
        display: none;
    }
}

/* Toolbar Search Input — reusable search box for table headers */
.toolbar-search-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-md);
    transition: all var(--wl-transition-fast);
    flex: 1;
    min-width: 150px;
    max-width: 320px;
}

.toolbar-search-input:focus-within {
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 3px var(--wl-primary-subtle);
}

.toolbar-search-input i {
    color: var(--wl-text-muted);
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.toolbar-search-input input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.8125rem;
    color: var(--wl-text-primary);
    width: 100%;
    min-width: 0;
}

.toolbar-search-input input::placeholder {
    color: var(--wl-text-muted);
}

.toolbar-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--wl-text-muted);
    cursor: pointer;
    border-radius: var(--wl-radius-full);
    transition: all var(--wl-transition-fast);
    flex-shrink: 0;
}

.toolbar-search-clear:hover {
    background: var(--wl-gray-200);
    color: var(--wl-text-primary);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color var(--wl-transition-fast), box-shadow var(--wl-transition-fast);
    background-color: var(--wl-bg-surface);
}

.form-control:focus, .form-select:focus {
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 3px var(--wl-primary-subtle);
    outline: none;
}

.form-control::placeholder {
    color: var(--wl-text-muted);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--wl-text-primary);
    margin-bottom: 0.5rem;
}

.form-text {
    font-size: 0.8125rem;
    color: var(--wl-text-muted);
}

.input-group {
    position: relative;
}

.input-group .form-control {
    padding-left: 2.5rem;
}

.input-group-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wl-text-muted);
    z-index: 4;
    pointer-events: none;
}

/* Floating labels */
.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.875rem;
}

.form-floating > label {
    padding: 1rem 0.875rem;
    color: var(--wl-text-muted);
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--wl-text-secondary);
}

/* Checkbox & Radio */
.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    border: 1.5px solid var(--wl-gray-300);
    border-radius: 4px;
}

.form-check-input:checked {
    background-color: var(--wl-primary);
    border-color: var(--wl-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--wl-primary-subtle);
    border-color: var(--wl-primary);
}

.form-switch .form-check-input {
    width: 2.5rem;
    height: 1.375rem;
    border-radius: var(--wl-radius-full);
}

.form-check.form-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: auto;
    padding-left: 0;
}

.form-check.form-switch > .form-check-input {
    float: none;
    margin-left: 0;
    margin-top: 0;
}

.form-check.form-switch > .form-check-label {
    margin-bottom: 0;
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: none;
    border-color: var(--wl-success);
}

.invalid {
    outline: none;
    border-color: var(--wl-danger);
}

.validation-message {
    color: var(--wl-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-container {
    background: var(--wl-bg-surface);
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table > thead {
    background: transparent;
}

.table > thead > tr > th {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--wl-text-muted, #9ca3af);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--wl-border-light, #f3f4f6);
    white-space: nowrap;
}

.table > tbody > tr > td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--wl-border-light, #f3f4f6);
    font-size: 0.8rem;
    color: var(--wl-text-primary);
}

.table > tbody > tr:last-child > td {
    border-bottom: none;
}

.table > tbody > tr:hover {
    background: var(--wl-gray-50, #f9fafb);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   Badges & Tags
   -------------------------------------------------------------------------- */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: var(--wl-radius-full);
}

.badge-primary,
.badge.bg-primary {
    background: var(--wl-primary-light) !important;
    color: var(--wl-primary) !important;
}

.badge-success,
.badge.bg-success {
    background: var(--wl-success-light) !important;
    color: var(--wl-success) !important;
}

.badge-warning,
.badge.bg-warning {
    background: var(--wl-warning-light) !important;
    color: #b45309 !important;
}

.badge-danger,
.badge.bg-danger {
    background: var(--wl-danger-light) !important;
    color: var(--wl-danger) !important;
}

.badge-secondary,
.badge.bg-secondary {
    background: var(--wl-gray-100) !important;
    color: var(--wl-text-secondary) !important;
}

.badge.bg-info {
    background: var(--wl-primary-light) !important;
    color: var(--wl-primary) !important;
}

.badge.bg-light {
    background: var(--wl-gray-100) !important;
    color: var(--wl-text-secondary) !important;
}

/* InfoCard Type Badges */
.badge-container {
    background: var(--wl-infocard-container-light) !important;
    color: var(--wl-infocard-container) !important;
}

.badge-service {
    background: var(--wl-infocard-service-light) !important;
    color: var(--wl-infocard-service) !important;
}

.badge-equipment {
    background: var(--wl-infocard-equipment-light) !important;
    color: var(--wl-infocard-equipment) !important;
}

.badge-supply {
    background: var(--wl-infocard-supply-light) !important;
    color: var(--wl-infocard-supply) !important;
}

.badge-account {
    background: var(--wl-infocard-account-light) !important;
    color: var(--wl-infocard-account) !important;
}

/* Status Dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background: var(--wl-success); }
.status-dot.pending { background: var(--wl-warning); }
.status-dot.inactive { background: var(--wl-gray-400); }
.status-dot.error { background: var(--wl-danger); }

/* --------------------------------------------------------------------------
   Avatars
   -------------------------------------------------------------------------- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--wl-radius-full);
    background: var(--wl-primary-light);
    color: var(--wl-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    margin-left: -0.5rem;
    border: 2px solid var(--wl-bg-surface);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* --------------------------------------------------------------------------
   Dropdown
   -------------------------------------------------------------------------- */
.dropdown-menu {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.97) 0%,
        rgba(245, 252, 249, 0.95) 50%,
        rgba(255, 255, 255, 0.96) 100%
    );
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--wl-radius-lg);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 3px rgba(5, 150, 105, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    padding: 0.375rem;
    min-width: 200px;
    --bs-dropdown-link-hover-bg: transparent;
    --bs-dropdown-link-hover-color: var(--wl-text-primary);
    --bs-dropdown-link-active-bg: transparent;
    --bs-dropdown-link-active-color: var(--wl-primary);
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: var(--wl-radius-sm);
    font-size: 0.875rem;
    color: var(--wl-text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background 150ms ease, color 150ms ease;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: rgba(5, 150, 105, 0.05);
    color: var(--wl-text-primary);
}

.dropdown-item:active {
    background: rgba(236, 253, 245, 0.6);
    color: var(--wl-primary);
}

.dropdown-item.active {
    background: rgba(5, 150, 105, 0.08);
    color: var(--wl-primary);
}

.dropdown-item i {
    font-size: 1rem;
    color: var(--wl-text-muted);
    transition: color 150ms ease;
}

.dropdown-item:hover i {
    color: var(--wl-primary);
}

.dropdown-divider {
    margin: 0.375rem 0;
    border-color: rgba(5, 150, 105, 0.06);
}

/* --------------------------------------------------------------------------
   Tabs / Pills
   -------------------------------------------------------------------------- */
.nav-tabs {
    border-bottom: 1px solid var(--wl-border-color);
    gap: 0;
}

.nav-tabs .nav-link {
    color: var(--wl-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.875rem 1.25rem;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--wl-text-primary);
    border-color: transparent;
    background: transparent;
}

.nav-tabs .nav-link.active {
    color: var(--wl-primary);
    border-bottom-color: var(--wl-primary);
    background: transparent;
}

.nav-pills {
    gap: 0.5rem;
}

.nav-pills .nav-link {
    color: var(--wl-text-secondary);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--wl-radius-sm);
    background: transparent;
}

.nav-pills .nav-link:hover {
    background: var(--wl-gray-100);
    color: var(--wl-text-primary);
}

.nav-pills .nav-link.active {
    background: var(--wl-primary);
    color: white;
}

/* Vertical Nav Pills */
.nav-pills-vertical {
    flex-direction: column;
    gap: 0.25rem;
}

.nav-pills-vertical .nav-link {
    text-align: left;
    justify-content: flex-start;
}

/* --------------------------------------------------------------------------
   Activity List
   -------------------------------------------------------------------------- */
.activity-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--wl-border-light);
}

.activity-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.activity-item:first-child {
    padding-top: 0;
}

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--wl-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.875rem;
    color: var(--wl-text-primary);
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.activity-description {
    font-size: 0.8125rem;
    color: var(--wl-text-secondary);
    margin: 0;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--wl-text-muted);
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Page Header
   -------------------------------------------------------------------------- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.breadcrumb {
    margin-bottom: 0;
    font-size: 0.8125rem;
}

.breadcrumb-item {
    color: var(--wl-text-muted);
}

.breadcrumb-item a {
    color: var(--wl-text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--wl-primary);
}

.breadcrumb-item.active {
    color: var(--wl-text-primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--wl-text-muted);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--wl-radius-lg);
    background: var(--wl-gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
    color: var(--wl-text-muted);
}

.empty-state h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--wl-text-muted);
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-input {
    position: relative;
}

.search-input .form-control {
    padding-left: 2.5rem;
}

.search-input .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--wl-text-muted);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Modal — Liquid Glass
   -------------------------------------------------------------------------- */

/* Backdrop: softer, green-tinted blur */
.modal.show {
    background: rgba(15, 23, 42, 0.35) !important;
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
}

/* Content panel: frosted glass card */
.modal-content {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.95) 0%,
        rgba(245, 252, 249, 0.92) 50%,
        rgba(255, 255, 255, 0.94) 100%
    );
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--wl-radius-xl, 20px);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(5, 150, 105, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

/* Specular highlight on content */
.modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 50% 30% at 20% 10%,
        rgba(255, 255, 255, 0.4) 0%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

/* Header */
.modal-header {
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(5, 150, 105, 0.06);
    padding: 1.25rem 1.5rem;
    background: transparent;
}

.modal-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--wl-text-primary, #111827);
    letter-spacing: -0.01em;
}

.modal-title i {
    color: var(--wl-primary, #059669);
}

/* Close button */
.modal-header .btn-close {
    opacity: 0.5;
    transition: opacity var(--wl-transition-fast, 150ms ease);
}

.modal-header .btn-close:hover {
    opacity: 0.8;
}

/* Body */
.modal-body {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
}

/* Footer */
.modal-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(5, 150, 105, 0.06);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(245, 252, 249, 0.3) 100%
    );
}

/* Footer buttons — glass style */
.modal-footer .btn-secondary,
.modal-footer .btn-outline-secondary {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(5, 150, 105, 0.1);
    color: var(--wl-text-secondary, #6b7280);
    border-radius: var(--wl-radius-md, 10px);
    font-size: 0.8125rem;
    font-weight: 500;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: all var(--wl-transition-fast, 150ms ease);
}

.modal-footer .btn-secondary:hover,
.modal-footer .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(5, 150, 105, 0.2);
    color: var(--wl-text-primary, #111827);
}

.modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--wl-primary, #059669), #06b6d4);
    border: none;
    border-radius: var(--wl-radius-md, 10px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: white;
    box-shadow:
        0 1px 3px rgba(5, 150, 105, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all var(--wl-transition-base, 200ms ease);
}

.modal-footer .btn-primary:hover {
    filter: brightness(1.06);
    box-shadow:
        0 2px 8px rgba(5, 150, 105, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.modal-footer .btn-danger {
    background: linear-gradient(135deg, #dc2626, #f43f5e);
    border: none;
    border-radius: var(--wl-radius-md, 10px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: white;
    box-shadow:
        0 1px 3px rgba(220, 38, 38, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transition: all var(--wl-transition-base, 200ms ease);
}

.modal-footer .btn-danger:hover {
    filter: brightness(1.06);
    box-shadow:
        0 2px 8px rgba(220, 38, 38, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* Form controls inside modals — glass style */
.modal-body .form-control,
.modal-body .form-select {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(5, 150, 105, 0.1);
    border-radius: var(--wl-radius-md, 10px);
    transition: all var(--wl-transition-fast, 150ms ease);
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--wl-primary, #059669);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.08);
}

/* List items inside modals — glass cards */
.modal-body .list-group-item {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(5, 150, 105, 0.06);
    border-radius: var(--wl-radius-md, 10px) !important;
    margin-bottom: 0.375rem;
    transition: all var(--wl-transition-fast, 150ms ease);
}

.modal-body .list-group-item:hover {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(5, 150, 105, 0.15);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    border-radius: var(--wl-radius-md);
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
}

.alert-primary {
    background: var(--wl-primary-light);
    color: #065f46;
}

.alert-success {
    background: var(--wl-success-light);
    color: #065f46;
}

.alert-warning {
    background: var(--wl-warning-light);
    color: #92400e;
}

.alert-danger {
    background: var(--wl-danger-light);
    color: #991b1b;
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #047857 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
}

.login-brand-content {
    position: relative;
    z-index: 1;
    max-width: 480px;
}

.login-brand h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.login-brand p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
}

.login-features {
    margin-top: 3rem;
}

.login-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.login-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--wl-radius-md);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.login-feature h4 {
    font-size: 1rem;
    color: white;
    margin-bottom: 0.25rem;
}

.login-feature p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.login-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--wl-bg-surface);
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.login-form h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-form .text-muted {
    margin-bottom: 2rem;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--wl-text-muted);
    font-size: 0.8125rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--wl-border-color);
}

.login-divider span {
    padding: 0 1rem;
}

@media (max-width: 991.98px) {
    .login-brand {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   Workspace Picker Page
   -------------------------------------------------------------------------- */
.workspace-picker-form {
    width: 100%;
    max-width: 480px;
}

.workspace-picker-list {
    max-height: 400px;
    overflow-y: auto;
}

.workspace-org-section {
    margin-bottom: 1rem;
}

.workspace-org-section:last-child {
    margin-bottom: 0;
}

.workspace-org-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wl-text-secondary);
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}

.workspace-picker-card {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-md);
    cursor: pointer;
    transition: all var(--wl-transition-fast);
    text-align: left;
}

.workspace-picker-card:hover:not(:disabled) {
    border-color: var(--wl-primary);
    background: var(--wl-primary-light);
}

.workspace-picker-card:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.workspace-picker-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--wl-radius-md);
    background: var(--wl-primary-light);
    color: var(--wl-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.workspace-picker-info {
    flex: 1;
    min-width: 0;
}

.workspace-picker-name {
    font-weight: 500;
    color: var(--wl-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.workspace-picker-card > .bi-chevron-right {
    color: var(--wl-text-muted);
    transition: transform var(--wl-transition-fast);
}

.workspace-picker-card:hover > .bi-chevron-right {
    transform: translateX(2px);
    color: var(--wl-primary);
}

/* Spin animation for loading */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Settings Page
   -------------------------------------------------------------------------- */
.settings-sidebar {
    min-width: 200px;
}

.settings-content {
    flex: 1;
    min-width: 0;
}

.settings-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--wl-border-light);
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.settings-section p {
    font-size: 0.875rem;
    color: var(--wl-text-muted);
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.bg-surface { background: var(--wl-bg-surface) !important; }
.bg-body { background: var(--wl-bg-body) !important; }

.border-light { border-color: var(--wl-border-light) !important; }
.border-default { border-color: var(--wl-border-color) !important; }

.rounded-sm { border-radius: var(--wl-radius-sm) !important; }
.rounded-md { border-radius: var(--wl-radius-md) !important; }
.rounded-lg { border-radius: var(--wl-radius-lg) !important; }
.rounded-xl { border-radius: var(--wl-radius-xl) !important; }
.no-border-radius { border-radius: 0 !important; }

.shadow-xs { box-shadow: var(--wl-shadow-xs) !important; }
.shadow-sm { box-shadow: var(--wl-shadow-sm) !important; }
.shadow-md { box-shadow: var(--wl-shadow-md) !important; }
.shadow-lg { box-shadow: var(--wl-shadow-lg) !important; }

.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }

/* --------------------------------------------------------------------------
   Procurement Detail
   -------------------------------------------------------------------------- */

/* --- Layout --- */
.procurement-detail-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.procurement-detail-header {
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-md);
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--wl-shadow-xs);
    flex-shrink: 0;
}

.procurement-detail-split {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0.75rem;
}

.procurement-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--wl-bg-surface);
    border: 1px solid var(--wl-border-color);
    border-radius: var(--wl-radius-md);
    overflow: hidden;
    box-shadow: var(--wl-shadow-xs);
}

.procurement-pane-body {
    flex: 1;
    overflow: auto;
    min-height: 0;
}

.procurement-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--wl-border-color);
    background: var(--wl-gray-50);
    flex-shrink: 0;
}

/* --- Procurement Table (dense data grid) --- */
.procurement-table {
    font-size: 0.75rem;
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

.procurement-table > thead {
    position: sticky;
    top: 0;
    z-index: 4;
}

.procurement-table > thead > tr > th {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--wl-text-secondary);
    padding: 0.5rem 0.625rem;
    border-bottom: 1px solid var(--wl-border-color);
    background: var(--wl-gray-50);
    white-space: nowrap;
    position: relative;
}

.procurement-table > tbody > tr > td {
    padding: 0.4rem 0.625rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--wl-border-light);
    font-size: 0.75rem;
    color: var(--wl-text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}

.procurement-table > tbody > tr:last-child > td {
    border-bottom: none;
}

.procurement-table > tbody > tr:hover > td {
    background: rgba(0, 0, 0, 0.015);
}

.procurement-table > tfoot > tr > td {
    padding: 0.5rem 0.625rem;
    font-size: 0.75rem;
    border-top: 2px solid var(--wl-border-color);
    background: var(--wl-gray-50);
    font-variant-numeric: tabular-nums;
}

/* --- Column Group Header Row --- */
.procurement-group-row > th {
    text-transform: none !important;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase !important;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    text-align: center;
    border-bottom: none;
}

/* Identity group (Info Card) — no label, no special styling */
.pgroup-identity {
    background: var(--wl-gray-50) !important;
}

/* Container group — neutral */
.pgroup-container {
    background: var(--wl-gray-100) !important;
    color: var(--wl-gray-600) !important;
    border-top: 2px solid var(--wl-gray-300) !important;
}

/* Unit Prices group — brand green accent */
.pgroup-prices {
    background: #ecfdf5 !important;
    color: #047857 !important;
    border-top: 2px solid #059669 !important;
}

/* Operational group — warm amber accent */
.pgroup-operational {
    background: #fffbeb !important;
    color: #92400e !important;
    border-top: 2px solid #d97706 !important;
}

/* Yearly Totals group — cool blue accent */
.pgroup-totals {
    background: #eff6ff !important;
    color: #1e40af !important;
    border-top: 2px solid #3b82f6 !important;
}

/* --- Column Group Dividers --- */
.pgroup-divider {
    border-left: 1px solid var(--wl-border-color) !important;
}

/* Ensure dividers also show in body/footer rows */
.procurement-table > tbody > tr > td.pgroup-divider,
.procurement-table > tfoot > tr > td.pgroup-divider {
    border-left: 1px solid var(--wl-border-color);
}

/* --- Sub-header column row inherits tint from group above --- */
/* The second thead row (column names) sits directly under group headers.
   We tint the background based on column position via the divider pattern. */
.procurement-table > thead > tr:nth-child(2) > th {
    border-top: none;
    font-size: 0.625rem;
}

/* --- Location Grouping Row --- */
.procurement-location-row > td {
    background: var(--wl-gray-50) !important;
    font-weight: 600;
    font-size: 0.6875rem;
    color: var(--wl-text-secondary);
    padding: 0.3rem 0.625rem !important;
    border-bottom: 1px solid var(--wl-border-color) !important;
    letter-spacing: 0.01em;
}

.procurement-location-row > td > i {
    color: var(--wl-primary);
    font-size: 0.625rem;
}

/* Suppress hover on location rows */
.procurement-table > tbody > tr.procurement-location-row:hover > td {
    background: var(--wl-gray-50) !important;
}

/* --- Scenario Editable Cells --- */
.procurement-table .form-control-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.375rem;
    height: auto;
    min-height: 0;
    line-height: 1.4;
    border-radius: 3px;
    font-variant-numeric: tabular-nums;
    background: transparent;
    transition: background var(--wl-transition-fast), border-color var(--wl-transition-fast);
}

.procurement-table .form-control-sm:hover {
    background: #fff;
    border-color: var(--wl-border-color) !important;
}

.procurement-table .form-control-sm:focus {
    background: white;
    border-color: var(--wl-primary) !important;
    box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.15);
}

/* Overridden field highlight (from scenario) */
.procurement-table .form-control-sm.bg-warning-subtle {
    background: #fef9c3 !important;
    border-left: 2px solid #d97706 !important;
}

.procurement-table .form-control-sm.bg-warning-subtle:focus {
    background: white !important;
}

/* --- Scenario Comparison Metrics --- */
.scenario-metrics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.scenario-metric {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--wl-gray-50);
    border: 1px solid var(--wl-border-light);
    border-radius: var(--wl-radius-sm);
    font-size: 0.75rem;
    line-height: 1;
}

.scenario-metric .metric-label {
    color: var(--wl-text-muted);
    font-weight: 400;
}

.scenario-metric .metric-value {
    font-weight: 600;
    color: var(--wl-text-primary);
    font-variant-numeric: tabular-nums;
}

.scenario-metric .metric-currency {
    color: var(--wl-text-muted);
    font-weight: 400;
    font-size: 0.6875rem;
}

/* Scenario tab buttons */
.procurement-pane-header .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
}

/* --- Hide spin buttons on number inputs in the procurement table --- */
.procurement-table input[type="number"]::-webkit-inner-spin-button,
.procurement-table input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.procurement-table input[type="number"] {
    -moz-appearance: textfield;
}

/* --------------------------------------------------------------------------
   Blazor Error UI
   -------------------------------------------------------------------------- */
.blazor-error-boundary {
    background: var(--wl-danger-light);
    padding: 1rem 1rem 1rem 3rem;
    color: var(--wl-danger);
    border-radius: var(--wl-radius-md);
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--wl-danger);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

#blazor-error-ui .reload {
    color: white;
    text-decoration: underline;
    margin-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .card-body {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 0.5rem;
    }
}

/* --------------------------------------------------------------------------
   Document Preview - PDF Viewer
   -------------------------------------------------------------------------- */
.pdf-preview {
    background: var(--wl-gray-100);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdf-toolbar {
    z-index: 20;
}

.pdf-viewer-container {
    background: var(--wl-gray-200);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    padding: 1rem;
    flex: 1;
    width: 100%;
}

.pdf-canvas {
    box-shadow: var(--wl-shadow-lg);
    background: white;
}

.pdf-overlay {
    pointer-events: none;
}

.pdf-toolbar .btn {
    color: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    background: transparent;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.pdf-toolbar .btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.pdf-toolbar .page-indicator {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
}

.pdf-toolbar .form-control {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.75rem;
    padding: 0.15rem 0.35rem;
}

.pdf-toolbar .form-control:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    box-shadow: none;
}

.pdf-toolbar .input-group-text {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.7rem;
    padding: 0.15rem 0.35rem;
}

/* --------------------------------------------------------------------------
   Document Preview - XML Viewer
   -------------------------------------------------------------------------- */
.xml-preview {
    background: var(--wl-bg-surface);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.xml-toolbar {
    background: var(--wl-bg-surface) !important;
    z-index: 10;
    flex-shrink: 0;
}

.xml-viewer-container {
    background: var(--wl-gray-200);
    flex: 1;
    width: 100%;
    overflow: auto;
    padding: 1rem;
}

.xml-raw {
    background: var(--wl-gray-50);
    border-radius: var(--wl-radius-sm);
    padding: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* XML Syntax Highlighting */
.xml-tag {
    color: #0550ae;
}

.xml-attr {
    color: #116329;
}

.xml-value {
    color: #0a3069;
}

.xml-comment {
    color: #6e7781;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Collapsed Sidebar - Navigation Items
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .app-layout.sidebar-collapsed .sidebar-nav {
        overflow: hidden;
    }

    .app-layout.sidebar-collapsed .nav-section-title {
        display: none;
    }

    .app-layout.sidebar-collapsed .nav-section {
        padding: 0 0.5rem;
    }

    .app-layout.sidebar-collapsed .sidebar .nav-link span,
    .app-layout.sidebar-collapsed .sidebar .nav-badge,
    .app-layout.sidebar-collapsed .sidebar .nav-badge-icon {
        display: none;
    }

    .app-layout.sidebar-collapsed .nav-link {
        justify-content: center;
        padding: 0.75rem !important;
    }

    .app-layout.sidebar-collapsed .nav-link i {
        margin: 0;
        font-size: 1.25rem;
    }

    /* Footer in collapsed state */
    .app-layout.sidebar-collapsed .nav-footer {
        padding: 1rem 0.5rem;
    }

    .app-layout.sidebar-collapsed .workspace-selector {
        justify-content: center;
        padding: 0.75rem;
    }

    .app-layout.sidebar-collapsed .workspace-info,
    .app-layout.sidebar-collapsed .workspace-selector > i.bi-chevron-expand {
        display: none;
    }

    /* --- Hover-expand: restore nav content when sidebar hovered --- */
    .app-layout.sidebar-collapsed .sidebar:hover .sidebar-nav {
        overflow: visible;
        overflow-y: auto;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-section-title {
        display: block;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-section {
        padding: 0 0.75rem;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-link span,
    .app-layout.sidebar-collapsed .sidebar:hover .nav-badge,
    .app-layout.sidebar-collapsed .sidebar:hover .nav-badge-icon {
        display: inline;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-link {
        justify-content: flex-start;
        padding: 0.625rem 0.75rem !important;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-link i {
        font-size: 1.125rem;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .nav-footer {
        padding: 1rem 0.75rem;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .workspace-selector {
        justify-content: flex-start;
        padding: 0.625rem 0.75rem;
    }

    .app-layout.sidebar-collapsed .sidebar:hover .workspace-info,
    .app-layout.sidebar-collapsed .sidebar:hover .workspace-selector > i.bi-chevron-expand {
        display: block;
    }
}


/* ==========================================================================
   Dialogs
   Shared by the Styringstavle detail page and its panels. These live here
   rather than in a scoped stylesheet because a dialog is rendered by whichever
   component owns it — and scoped CSS does not cross component boundaries, so a
   panel's dialog would otherwise pick up none of the page's rules.
   ========================================================================== */
.info-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1055;
    padding: 1.5rem;
}

.info-modal {
    background: #fff;
    border-radius: var(--wl-radius-lg, 14px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    width: min(38rem, 100%);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.info-modal-sm {
    width: min(30rem, 100%);
}

.info-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.info-modal-header h5 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.info-modal-body {
    padding: 1rem 1.25rem 1.25rem;
    overflow-y: auto;
}

.info-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.info-entry + .info-entry {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.info-criteria {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
    color: var(--wl-text-primary, #111827);
}

.info-criteria li + li {
    margin-top: 0.2rem;
}

.info-description {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
}

.info-empty {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--wl-text-muted, #9ca3af);
}

.group-badge {
    display: inline-block;
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8125rem;
    background: rgba(5, 150, 105, 0.1);
    color: var(--wl-primary, #059669);
    border: 1px solid rgba(5, 150, 105, 0.25);
}

.dialog-fields {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dialog-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wl-text-secondary, #6b7280);
    margin-top: 0.5rem;
}

/* InfoCard lookup inside a dialog. The results are a plain block below the input rather than an
   absolutely positioned dropdown — the dialog has the room, and a dropdown would have to escape
   the modal's own stacking context. */
.infocard-search {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.infocard-results {
    max-height: 11rem;
    overflow-y: auto;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: var(--wl-radius-sm, 8px);
    background: rgba(248, 250, 252, 0.7);
}

.infocard-result {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.65rem;
    border: 0;
    background: transparent;
    text-align: left;
    font-size: 0.8125rem;
}

.infocard-result:hover {
    background: rgba(5, 150, 105, 0.08);
}

.infocard-result + .infocard-result {
    border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.infocard-ref {
    font-weight: 600;
    color: var(--wl-primary, #059669);
    white-space: nowrap;
}

.infocard-name {
    color: var(--wl-text-primary, #111827);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.infocard-result-empty {
    padding: 0.6rem 0.65rem;
    font-size: 0.8125rem;
    color: var(--wl-text-muted, #9ca3af);
    text-align: center;
}

.infocard-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid rgba(5, 150, 105, 0.25);
    border-radius: var(--wl-radius-sm, 8px);
    background: rgba(5, 150, 105, 0.08);
    font-size: 0.8125rem;
}

.infocard-chip-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.infocard-chip .btn-close {
    flex: 0 0 auto;
    font-size: 0.65rem;
}
