/* ==========================================================================
   Professional Blue Dashboard — Design System
   Software Manajemen Pertambangan v1.0
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
    /* Primary palette */
    --color-primary: #1565C0;
    --color-primary-dark: #0D47A1;
    --color-primary-darker: #0A3D91;
    --color-navy: #1A237E;
    --color-primary-light: #42A5F5;
    --color-primary-lighter: #90CAF9;
    --color-primary-bg: #E3F2FD;
    --color-primary-bg-soft: #F5FAFF;

    /* Semantic colors */
    --color-success: #2E7D32;
    --color-success-light: #4CAF50;
    --color-success-bg: #E8F5E9;
    --color-warning: #F57C00;
    --color-warning-light: #FF9800;
    --color-warning-bg: #FFF3E0;
    --color-danger: #C62828;
    --color-danger-light: #EF5350;
    --color-danger-bg: #FFEBEE;
    --color-info: #0277BD;
    --color-info-light: #29B6F6;
    --color-info-bg: #E1F5FE;
    --color-purple: #6A1B9A;
    --color-purple-light: #AB47BC;
    --color-purple-bg: #F3E5F5;

    /* Neutrals */
    --color-body-bg: #EEF2F7;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F8FAFC;
    --color-border: #E2E8F0;
    --color-border-light: #EDF2F7;
    --color-text: #1E293B;
    --color-text-muted: #64748B;
    --color-text-light: #94A3B8;
    --color-text-inverse: #FFFFFF;

    /* Layout */
    --sidebar-width: 260px;
    --navbar-height: 64px;
    --footer-height: 48px;
    --content-max-width: 1400px;

    /* Typography */
    --font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Border radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
    --shadow-sidebar: 4px 0 24px rgba(26, 35, 126, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* Z-index layers */
    --z-sidebar: 1040;
    --z-navbar: 1030;
    --z-overlay: 1025;
    --z-dropdown: 1050;
    --z-modal: 1060;
    --z-toast: 1070;
    --z-loading: 1080;
}

/* --------------------------------------------------------------------------
   Base & Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-body-bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(21, 101, 192, 0.07), transparent 55%),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(26, 35, 126, 0.05), transparent 50%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.sidebar-open {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   App Shell Layout
   -------------------------------------------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.app-content {
    flex: 1;
    padding: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.app-content-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    z-index: var(--z-overlay);
    opacity: 0;
    transition: opacity var(--transition-base);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--color-navy) 0%, var(--color-primary-dark) 100%);
    color: var(--color-text-inverse);
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sidebar);
    transition: transform var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-inverse);
    text-decoration: none;
}

.sidebar-logo:hover {
    color: var(--color-text-inverse);
    opacity: 0.95;
}

.sidebar-logo-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.sidebar-logo-text {
    flex: 1;
    min-width: 0;
}

.sidebar-logo-title {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logo-subtitle {
    display: block;
    font-size: var(--font-size-xs);
    opacity: 0.75;
    margin-top: 2px;
}

.sidebar-user {
    padding: 1rem;
    margin: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--font-size-xs);
    opacity: 0.7;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.5rem 0.75rem 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    color: rgba(255, 255, 255, 0.85);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: var(--color-text-inverse);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav .nav-link.active {
    color: var(--color-text-inverse);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 3px 0 0 var(--color-primary-light);
}

.sidebar-nav .nav-link.active i {
    opacity: 1;
}

.sidebar-nav .nav-link[data-bs-toggle="collapse"] {
    position: relative;
}

.sidebar-nav .nav-link[data-bs-toggle="collapse"]::after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
    opacity: 0.7;
}

.sidebar-nav .nav-link[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

.sidebar-submenu {
    padding-left: 0.5rem;
    margin-top: 0.125rem;
}

.sidebar-submenu .nav-link {
    padding: 0.5rem 0.875rem 0.5rem 2.25rem;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-normal);
}

.sidebar-submenu .nav-link.active {
    background: rgba(66, 165, 245, 0.25);
    box-shadow: inset 3px 0 0 var(--color-primary-light);
}

.sidebar-footer {
    padding: 0.875rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer-version {
    font-size: var(--font-size-xs);
    opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.app-navbar {
    position: sticky;
    top: 0;
    height: var(--navbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    z-index: var(--z-navbar);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
}

.navbar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.navbar-toggle:hover {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.navbar-search {
    flex: 1;
    max-width: 420px;
}

.navbar-search .form-control {
    border-radius: var(--radius-full);
    padding-left: 2.5rem;
    background: var(--color-body-bg);
    border-color: transparent;
}

.navbar-search .form-control:focus {
    background: var(--color-surface);
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.navbar-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.navbar-action-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.navbar-action-btn:hover {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-light);
    color: var(--color-primary);
}

.navbar-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.65rem;
    font-weight: var(--font-weight-bold);
    line-height: 18px;
    text-align: center;
    background: var(--color-danger);
    color: white;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-surface);
}

.navbar-user-dropdown .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.navbar-user-dropdown .dropdown-toggle:hover,
.navbar-user-dropdown .dropdown-toggle.show {
    border-color: var(--color-primary-light);
    background: var(--color-primary-bg-soft);
}

.navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary), var(--color-navy));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
}

.navbar-user-name {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.navbar-dropdown-menu {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 220px;
}

.navbar-dropdown-menu .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: var(--font-size-sm);
}

.navbar-dropdown-menu .dropdown-item i {
    width: 20px;
    margin-right: 0.5rem;
    color: var(--color-text-muted);
}

.navbar-dropdown-menu .dropdown-item:hover {
    background: var(--color-primary-bg);
    color: var(--color-primary-dark);
}

.navbar-dropdown-menu .dropdown-item:hover i {
    color: var(--color-primary);
}

.navbar-notification-dropdown {
    width: 320px;
    padding: 0;
}

.navbar-notification-header {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-border);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.navbar-notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast);
}

.navbar-notification-item:hover {
    background: var(--color-surface-hover);
}

.navbar-notification-item:last-child {
    border-bottom: none;
}

.navbar-notification-footer {
    padding: 0.625rem 1rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Page Header & Breadcrumb
   -------------------------------------------------------------------------- */
.page-header {
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.page-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.breadcrumb-wrapper {
    margin-bottom: 1rem;
}

.breadcrumb {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    font-size: var(--font-size-sm);
}

.breadcrumb-item a {
    color: var(--color-text-muted);
}

.breadcrumb-item a:hover {
    color: var(--color-primary);
}

.breadcrumb-item.active {
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.card.card-lift:hover,
.dashboard-widget-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(21, 101, 192, 0.12);
}

.card-header {
    padding: 1rem 1.25rem;
    background: transparent;
    border-bottom: 1px solid var(--color-border-light);
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.875rem 1.25rem;
    background: var(--color-surface-hover);
    border-top: 1px solid var(--color-border-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.card-title {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0;
}

/* Stat cards */
.stat-card {
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-text-inverse);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -15%;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
}

.stat-card .card-body {
    position: relative;
    z-index: 1;
    padding: 1.25rem;
}

.stat-label,
.stat-card-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: 0.375rem;
}

.stat-value,
.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.stat-trend,
.stat-card-trend {
    font-size: var(--font-size-xs);
    opacity: 0.85;
}

.stat-deco {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    pointer-events: none;
}

.stat-ghost-icon {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 2.5rem;
    opacity: 0.15;
    pointer-events: none;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: 0;
}

.stat-card-trend {
    font-size: var(--font-size-xs);
    margin-top: 0.5rem;
    opacity: 0.85;
}

.stat-card-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.stat-card-success {
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success) 100%);
}

.stat-card-warning {
    background: linear-gradient(135deg, var(--color-warning-light) 0%, var(--color-warning) 100%);
}

.stat-card-danger {
    background: linear-gradient(135deg, var(--color-danger-light) 0%, var(--color-danger) 100%);
}

.stat-card-info {
    background: linear-gradient(135deg, var(--color-info-light) 0%, var(--color-info) 100%);
}

.stat-card-purple {
    background: linear-gradient(135deg, var(--color-purple-light) 0%, var(--color-purple) 100%);
}

/* Dashboard widgets */
.chart-container {
    position: relative;
    width: 100%;
}

.chart-container-lg {
    height: 280px;
}

.chart-container-md {
    height: 260px;
}

.dashboard-widget-card .card-header h5 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
}

.dashboard-widget-table thead th {
    font-size: var(--font-size-xs);
    padding: 0.625rem 0.875rem;
    white-space: nowrap;
}

.dashboard-widget-table tbody td {
    font-size: var(--font-size-xs);
    padding: 0.625rem 0.875rem;
}

.dashboard-widget-table tbody tr:last-child td {
    border-bottom: none;
}

/* Compact DataTables inside cards (full-page tables) */
.card .dataTables_wrapper > .row:first-child {
    margin-bottom: 0.75rem !important;
    align-items: center;
}

.card .dataTables_wrapper .dataTables_length,
.card .dataTables_wrapper .dataTables_filter {
    margin-bottom: 0;
}

.card .dataTables_wrapper .dataTables_filter {
    text-align: right;
}

.card .dataTables_wrapper .dataTables_filter label,
.card .dataTables_wrapper .dataTables_length label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    font-size: var(--font-size-xs);
}

.card .dataTables_wrapper .dataTables_paginate {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.25rem;
}

@media (max-width: 767.98px) {
    .card .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-top: 0.5rem;
    }

    .chart-container-lg,
    .chart-container-md {
        height: 220px;
    }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-color: var(--color-primary-dark);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-navy) 100%);
    border-color: var(--color-navy);
    color: white;
    box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success-light) 0%, var(--color-success) 100%);
    border-color: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--color-success) 0%, #1B5E20 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.35);
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning-light) 0%, var(--color-warning) 100%);
    border-color: var(--color-warning);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, var(--color-warning) 0%, #E65100 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger-light) 0%, var(--color-danger) 100%);
    border-color: var(--color-danger);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--color-danger) 0%, #B71C1C 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.35);
}

.btn-info {
    background: linear-gradient(135deg, var(--color-info-light) 0%, var(--color-info) 100%);
    border-color: var(--color-info);
    color: white;
}

.btn-outline-primary {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-outline-primary:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.btn-light {
    background: var(--color-surface);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-light:hover {
    background: var(--color-primary-bg);
    border-color: var(--color-primary-light);
    color: var(--color-primary-dark);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: var(--font-size-base);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: 0.375rem;
}

.form-control,
.form-select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.form-control::placeholder {
    color: var(--color-text-light);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--color-danger);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: var(--color-success);
}

.invalid-feedback,
.valid-feedback {
    font-size: var(--font-size-xs);
}

.input-group-text {
    background: var(--color-body-bg);
    border-color: var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    border-radius: var(--radius-sm);
}

.form-check-input:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.form-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Select2 overrides */
.select2-container--bootstrap-5 .select2-selection {
    border-color: var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
    min-height: 38px;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--color-primary-light) !important;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15) !important;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-xs);
    padding: 0.35em 0.65em;
    border-radius: var(--radius-full);
}

.badge-soft-primary {
    background: var(--color-primary-bg);
    color: var(--color-primary-dark);
}

.badge-soft-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-soft-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-soft-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-soft-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.badge-soft-purple {
    background: var(--color-purple-bg);
    color: var(--color-purple);
}

.badge-soft-secondary {
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

.badge-status {
    font-size: 0.7rem;
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
}

.badge-pending {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-approved,
.badge-active {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge-rejected,
.badge-cancelled {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.badge-draft {
    background: var(--color-border-light);
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Alerts
   -------------------------------------------------------------------------- */
.alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1.125rem;
    font-size: var(--font-size-sm);
    border-left: 4px solid transparent;
    animation: slideUp 0.3s ease;
}

.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-left-color: var(--color-success);
}

.alert-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-left-color: var(--color-danger);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-left-color: var(--color-warning);
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border-left-color: var(--color-info);
}

.alert-primary {
    background: var(--color-primary-bg);
    color: var(--color-primary-dark);
    border-left-color: var(--color-primary);
}

.alert-dismissible .btn-close {
    padding: 1rem;
}

/* Toast container */
.toast-container {
    z-index: var(--z-toast);
}

.toast {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-surface) 100%);
    border-bottom: 1px solid var(--color-border-light);
    padding: 1rem 1.25rem;
}

.modal-title {
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary-dark);
}

.modal-body {
    padding: 1.25rem;
}

.modal-footer {
    padding: 0.875rem 1.25rem;
    background: var(--color-surface-hover);
    border-top: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Tables & DataTables
   -------------------------------------------------------------------------- */
.table {
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

.table thead th {
    background: var(--color-primary-bg-soft);
    color: var(--color-primary-dark);
    font-weight: var(--font-weight-semibold);
    border-bottom: 2px solid var(--color-primary-bg);
    padding: 0.75rem 1rem;
    white-space: nowrap;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-color: var(--color-border-light);
    color: var(--color-text);
}

.table tbody tr:hover {
    background: var(--color-primary-bg-soft);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(240, 244, 248, 0.5);
}

.table-hover > tbody > tr:hover > * {
    background-color: var(--color-primary-bg-soft);
}

.table-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: nowrap;
}

.table-card .card-body {
    padding: 0;
}

.table-card .table thead th:first-child {
    border-radius: var(--radius-md) 0 0 0;
}

.table-responsive {
    border-radius: var(--radius-md);
}

/* DataTables styling */
.dataTables_wrapper {
    font-size: var(--font-size-sm);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
    margin: 0 0.375rem;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    margin-left: 0.5rem;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--color-primary-light);
    outline: none;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}

.dataTables_wrapper .dataTables_info {
    color: var(--color-text-muted);
    padding-top: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate {
    padding-top: 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    border: 1px solid var(--color-border) !important;
    padding: 0.375rem 0.75rem !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%) !important;
    border-color: var(--color-primary-dark) !important;
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--color-primary-bg) !important;
    border-color: var(--color-primary-light) !important;
    color: var(--color-primary-dark) !important;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 0.375rem;
}

div.dataTables_processing {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    color: var(--color-primary);
    font-weight: var(--font-weight-medium);
}

/* --------------------------------------------------------------------------
   POS Grid Layout
   -------------------------------------------------------------------------- */
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pos-item {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.pos-item:hover {
    border-color: var(--color-primary-light);
    background: var(--color-primary-bg-soft);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pos-item.active {
    border-color: var(--color-primary);
    background: var(--color-primary-bg);
    box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}

.pos-item-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-bg);
    color: var(--color-primary);
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
}

.pos-item-label {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.pos-item-price {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.pos-cart {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pos-cart-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border-light);
    font-weight: var(--font-weight-semibold);
}

.pos-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pos-cart-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-surface-hover);
}

.pos-cart-total {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-dark);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.app-footer {
    padding: 0.875rem 1.5rem;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Loading Overlay
   -------------------------------------------------------------------------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    z-index: var(--z-loading);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-primary-bg);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

/* --------------------------------------------------------------------------
   Login Page
   -------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-primary-dark) 50%, var(--color-primary) 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-full);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

.login-card-header {
    background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-surface) 100%);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border-light);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-navy) 100%);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.75rem;
}

.login-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-primary-dark);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: 0;
}

.login-card-body {
    padding: 2rem;
}

.login-footer-text {
    text-align: center;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-primary { color: var(--color-primary) !important; }
.text-muted { color: var(--color-text-muted) !important; }
.bg-primary-soft { background-color: var(--color-primary-bg) !important; }
.bg-body { background-color: var(--color-body-bg) !important; }
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }

.divider {
    height: 1px;
    background: var(--color-border);
    margin: 1rem 0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease;
}

.animate-slide-up {
    animation: slideUp 0.4s ease;
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */
@media print {
    .app-sidebar,
    .app-navbar,
    .app-footer,
    .sidebar-overlay,
    .navbar-toggle,
    .btn,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate,
    .dataTables_wrapper .dt-buttons,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .app-main {
        margin-left: 0 !important;
    }

    .app-content {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .table thead th {
        background: #f0f0f0 !important;
        color: black !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    a[href]::after {
        content: none;
    }

    @page {
        margin: 1.5cm;
    }
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (≤991px)
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .navbar-toggle {
        display: flex;
    }

    .navbar-search {
        display: none;
    }

    .navbar-user-name {
        display: none;
    }

    .page-title {
        font-size: var(--font-size-xl);
    }

    .stat-card-value {
        font-size: var(--font-size-xl);
    }

    .pos-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (≤575px)
   -------------------------------------------------------------------------- */
@media (max-width: 575.98px) {
    .app-content {
        padding: 1rem;
    }

    .app-navbar {
        padding: 0 1rem;
    }

    .page-header {
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: var(--font-size-lg);
    }

    .card-body {
        padding: 1rem;
    }

    .card-header {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .table thead th,
    .table tbody td {
        padding: 0.5rem 0.625rem;
        font-size: var(--font-size-xs);
    }

    .btn {
        padding: 0.4375rem 0.75rem;
    }

    .login-card-body {
        padding: 1.5rem;
    }

    .login-card-header {
        padding: 1.5rem 1.5rem 1rem;
    }

    .pos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        text-align: left;
        margin-bottom: 0.5rem;
    }

    .navbar-notification-dropdown {
        width: 280px;
    }
}

/* Crusher / Processing module */
.processing-hero {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-navy) 55%, var(--color-primary) 100%);
    border-radius: var(--radius-lg);
    color: #fff;
    padding: 1.75rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.processing-hero .hero-title {
    font-size: 1.35rem;
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.35rem;
}

.processing-hero .hero-sub {
    opacity: 0.9;
    font-size: var(--font-size-sm);
    margin: 0;
}

.processing-module-grid .module-tile {
    display: block;
    height: 100%;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-light);
    background: var(--color-surface);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.processing-module-grid .module-tile:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.processing-module-grid .module-tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    color: #fff;
}

.processing-module-grid .module-tile-title {
    font-weight: var(--font-weight-semibold);
    margin-bottom: 0.25rem;
}

.processing-module-grid .module-tile-desc {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.form-section-card {
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--color-primary-bg) 0%, var(--color-surface) 100%);
}

.form-section-card .section-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-primary-dark);
    margin-bottom: 1rem;
}

.form-section-card .section-title i {
    margin-right: 0.35rem;
}

/* --------------------------------------------------------------------------
   Dashboard Management (role-based)
   -------------------------------------------------------------------------- */
.dm-hero {
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.dm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.15), transparent 45%);
    pointer-events: none;
}

.dm-hero-content {
    position: relative;
    z-index: 1;
}

.dm-hero-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.92;
}

.dm-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
}

.dm-hero-sub {
    opacity: 0.88;
    max-width: 42rem;
}

.dm-role-select {
    min-width: 11rem;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.dm-hero-executive {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 45%, #00838f 100%);
}

.dm-hero-manager {
    background: linear-gradient(135deg, #e65100 0%, #f57c00 50%, #ff8f00 100%);
}

.dm-hero-supervisor {
    background: linear-gradient(135deg, #4527a0 0%, #5e35b1 55%, #3949ab 100%);
}

.dm-hero-finance {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 45%, #00695c 100%);
}

.dm-hero-hse {
    background: linear-gradient(135deg, #b71c1c 0%, #c62828 40%, #006064 100%);
}

.dm-hero-default {
    background: linear-gradient(135deg, #37474f 0%, #455a64 50%, #546e7a 100%);
}

.dm-kpi {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.15rem 1.25rem;
    border-radius: var(--radius-lg, 12px);
    background: var(--color-surface, #fff);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dm-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1);
}

.dm-kpi-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dm-kpi-primary .dm-kpi-icon { background: rgba(21, 101, 192, 0.12); color: #1565c0; }
.dm-kpi-success .dm-kpi-icon { background: rgba(46, 125, 50, 0.12); color: #2e7d32; }
.dm-kpi-warning .dm-kpi-icon { background: rgba(245, 124, 0, 0.14); color: #ef6c00; }
.dm-kpi-danger .dm-kpi-icon { background: rgba(198, 40, 40, 0.12); color: #c62828; }
.dm-kpi-info .dm-kpi-icon { background: rgba(0, 131, 143, 0.12); color: #00838f; }
.dm-kpi-purple .dm-kpi-icon { background: rgba(94, 53, 177, 0.12); color: #5e35b1; }

.dm-kpi-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dm-kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text, #0f172a);
    margin-top: 0.15rem;
}

.dm-kpi-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
    margin-top: 0.35rem;
}

.dm-panel {
    border-radius: var(--radius-lg, 12px);
}

.dm-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #64748b);
    border-bottom-width: 1px;
    background: rgba(15, 23, 42, 0.02);
}

@media print {
    .dm-kpi {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* --------------------------------------------------------------------------
   UI Refresh — global polish
   -------------------------------------------------------------------------- */
.app-shell .app-content {
    padding: 1.25rem 1.5rem 2rem;
}

.app-alerts:empty {
    display: none;
    margin: 0 !important;
}

.app-alert {
    border: none;
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid transparent;
}

.app-alert.alert-success { border-left-color: var(--color-success); background: var(--color-success-bg); color: #1b5e20; }
.app-alert.alert-danger { border-left-color: var(--color-danger); background: var(--color-danger-bg); color: #b71c1c; }
.app-alert.alert-warning { border-left-color: var(--color-warning); background: var(--color-warning-bg); color: #e65100; }
.app-alert.alert-info { border-left-color: var(--color-info); background: var(--color-info-bg); color: #01579b; }

.breadcrumb-bar {
    padding: 0.625rem 1rem;
    background: var(--color-surface);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.page-header-shell {
    padding: 1.25rem 1.5rem;
    background: var(--color-surface);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.page-header-shell .page-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.page-header-shell .page-subtitle,
.page-header-shell .text-muted {
    font-size: var(--font-size-sm);
}

.page-header-shell .d-flex,
.page-header-shell .btn-toolbar {
    gap: 0.5rem;
}

.sidebar-search-wrap {
    position: relative;
}

.sidebar-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    opacity: 0.55;
    pointer-events: none;
}

.sidebar-search-input {
    padding-left: 2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: var(--radius-sm);
}

.sidebar-search-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.sidebar-search-input:focus {
    background: rgba(0, 0, 0, 0.28);
    border-color: rgba(66, 165, 245, 0.55);
    box-shadow: 0 0 0 2px rgba(66, 165, 245, 0.2);
    color: #fff;
}

.sidebar-nav .nav-item.sidebar-menu-hidden {
    display: none !important;
}

.sidebar-nav .sidebar-menu-empty {
    padding: 1rem 0.875rem;
    font-size: var(--font-size-xs);
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.app-navbar.navbar-scrolled {
    box-shadow: var(--shadow-md);
    border-bottom-color: transparent;
}

.app-navbar {
    transition: box-shadow var(--transition-base);
}

.btn {
    border-radius: var(--radius-sm);
}

.btn-primary {
    box-shadow: 0 1px 2px rgba(13, 71, 161, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    min-height: 2.5rem;
}

.form-control-sm,
.form-select-sm {
    min-height: 2rem;
}

.table thead th {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: rgba(15, 23, 42, 0.025);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: var(--font-size-sm);
}

.table-hover > tbody > tr {
    transition: background var(--transition-fast);
}

.card-header {
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, var(--color-surface) 100%);
    font-size: var(--font-size-sm);
}

.card .dataTables_wrapper .dataTables_filter input,
.card .dataTables_wrapper .dataTables_length select {
    border-radius: var(--radius-sm);
    border-color: var(--color-border);
    padding: 0.35rem 0.65rem;
    font-size: var(--font-size-sm);
}

.card .dataTables_wrapper .page-item .page-link {
    border-radius: var(--radius-sm) !important;
    margin: 0 1px;
}

.app-footer {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
}

.login-card {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card .form-control {
    min-height: 2.75rem;
}

.login-card .btn-primary {
    border-radius: var(--radius-md);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;
}

@media (max-width: 991.98px) {
    .page-header-shell {
        padding: 1rem 1.125rem;
    }

    .breadcrumb-bar {
        padding: 0.5rem 0.75rem;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Procurement module */
.proc-card,
.proc-kpi,
.proc-quick {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.proc-kpi:hover,
.proc-quick:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.proc-pipeline .proc-step {
    padding: 0.35rem 0.25rem;
    border-radius: var(--radius-md);
}

.proc-pipeline .proc-step:hover {
    background: rgba(79, 70, 229, 0.04);
}

.proc-quick {
    border-radius: var(--radius-md);
    padding: 1.25rem;
    color: inherit;
}

.proc-quick:hover {
    color: inherit;
}

.proc-approval-card {
    border-left: 4px solid var(--color-warning);
    border-radius: var(--radius-md);
}

@media print {
    .proc-card .no-print,
    .no-print {
        display: none !important;
    }
}
