/* 
 * SIMATA - Sistem Informasi Manajemen Administrasi dan Tata Kelola Pengajuan Kepegawaian
 * Main Stylesheet
 */

/* ==========================================================================
   1. CSS Variables & Reset
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    /* Design System Colors */
    --primary: #1a3a6b;
    --primary-light: #2c528e;
    --primary-dark: #0f2347;
    --secondary: #2563eb;
    --accent: #f59e0b;
    
    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Neutral Colors */
    --bg-main: #f0f4f8;
    --bg-white: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Layout Dimensions */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --topbar-height: 65px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 8px 25px rgba(0,0,0,0.12);
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

body {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

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

a:hover {
    color: var(--secondary);
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* ==========================================================================
   2. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ==========================================================================
   3. Layout - Sidebar
   ========================================================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    z-index: 1000;
    overflow-y: auto;
    transition: all var(--transition-normal);
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: var(--bg-white);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-brand img {
    height: 32px;
    margin-right: 12px;
}

.sidebar-brand .badge {
    font-size: 10px;
    padding: 3px 6px;
    margin-left: 8px;
    background: var(--accent);
    vertical-align: middle;
}

.sidebar-section-title {
    padding: 1.5rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    padding: 0.2rem 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: rgba(255,255,255,0.8);
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.sidebar-nav .nav-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
    text-align: center;
    transition: transform var(--transition-fast);
}

.sidebar-nav .nav-link:hover {
    color: var(--bg-white);
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.sidebar-nav .nav-link:hover i {
    transform: translateX(3px);
}

.sidebar-nav .nav-link.active {
    color: var(--primary);
    background: var(--bg-white);
    font-weight: 600;
}

.sidebar-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--secondary);
    border-radius: 4px 0 0 4px;
}

.sidebar-nav .collapse .nav-link.active,
.sidebar-nav .collapse .nav-link.text-white {
    background: transparent !important;
    color: #fff !important;
}
.sidebar-nav .collapse .nav-link.active::before {
    display: none !important;
}

/* Sidebar Collapsed State */
.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand span,
.sidebar-collapsed .sidebar-brand .badge,
.sidebar-collapsed .sidebar-section-title,
.sidebar-collapsed .sidebar-nav .nav-link span {
    display: none;
}

.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .sidebar-brand img {
    margin-right: 0;
}

.sidebar-collapsed .sidebar-nav .nav-item {
    padding: 0.2rem 0.5rem;
}

.sidebar-collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
    font-size: 1.2rem;
}

/* ==========================================================================
   4. Layout - Topbar & Main Content
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

.topbar {
    position: sticky;
    top: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.topbar-left {
    display: flex;
    align-items: center;
}

.btn-toggle-sidebar {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.btn-toggle-sidebar:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar-item {
    position: relative;
}

.topbar-item .nav-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.topbar-item .nav-icon:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    transform: translate(25%, -25%);
    border: 2px solid var(--bg-white);
    display: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background var(--transition-fast);
}

.user-profile:hover {
    background: var(--bg-main);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==========================================================================
   5. Page Content & Components
   ========================================================================== */
.page-content {
    padding: 1.5rem;
    flex-grow: 1;
}

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

.page-title {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    font-size: 0.85rem;
}

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

.breadcrumb-item.active {
    color: var(--primary);
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.card-stat {
    border-radius: 12px;
    border: none;
    box-shadow: var(--shadow-card);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
    position: relative;
    background: var(--bg-white);
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
}

.card-stat .card-body {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-info {
    text-align: right;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stat Color Variants */
.card-stat-primary .stat-icon { background: rgba(26,58,107,0.1); color: var(--primary); }
.card-stat-success .stat-icon { background: rgba(16,185,129,0.1); color: var(--success); }
.card-stat-warning .stat-icon { background: rgba(245,158,11,0.1); color: var(--warning); }
.card-stat-danger .stat-icon { background: rgba(239,68,68,0.1); color: var(--danger); }
.card-stat-info .stat-icon { background: rgba(59,130,246,0.1); color: var(--info); }

/* ==========================================================================
   6. Status Badges
   ========================================================================== */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 500;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

/* Status variants */
.badge-status-DRAFT { background-color: #94a3b8; color: white; }
.badge-status-DIAJUKAN { background-color: #3b82f6; color: white; }
.badge-status-VERIFIKASI_BKD { background-color: #f97316; color: white; }
.badge-status-PERLU_PERBAIKAN { background-color: #ef4444; color: white; }
.badge-status-DITERIMA_BKD { background-color: #14b8a6; color: white; }
.badge-status-VERIFIKASI_BAGIAN_HUKUM { background-color: #a855f7; color: white; }
.badge-status-DITOLAK_BAGIAN_HUKUM { background-color: #991b1b; color: white; }
.badge-status-VERIFIKASI_ASISTEN_3 { background-color: #6366f1; color: white; }
.badge-status-DITOLAK_ASISTEN_3 { background-color: #be123c; color: white; }
.badge-status-VERIFIKASI_SEKDA { background-color: #1e3a8a; color: white; }
.badge-status-DITOLAK_SEKDA { background-color: #7f1d1d; color: white; }
.badge-status-DISETUJUI { background-color: #22c55e; color: white; }
.badge-status-SELESAI { background-color: #166534; color: white; }
.badge-status-MENUNGGU_RESPONDEN { background-color: #0ea5e9; color: white; }
.badge-status-PENILAIAN_RESPONDEN { background-color: #f59e0b; color: white; }
.badge-status-PENILAIAN_SELESAI { background-color: #10b981; color: white; }

/* ==========================================================================
   7. Timeline
   ========================================================================== */
.proposal-timeline {
    position: relative;
    padding-left: 40px;
    margin-top: 1.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 0;
    bottom: -24px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-dot {
    position: absolute;
    left: -34px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-white);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-dot.success { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-dot.danger { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }
.timeline-dot.warning { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-dot.info { background: var(--info); box-shadow: 0 0 0 2px var(--info); }

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.timeline-content {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.timeline-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ==========================================================================
   8. Workflow Position Indicator
   ========================================================================== */
.workflow-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.workflow-step {
    display: flex;
    align-items: center;
    padding: 10px 15px 10px 25px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    position: relative;
    flex: 1;
    justify-content: center;
    text-align: center;
}

.workflow-step:first-child {
    padding-left: 15px;
}

.workflow-step::after {
    content: '';
    position: absolute;
    right: -14px;
    top: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 14px solid #f1f5f9;
    z-index: 2;
}

.workflow-step::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 15px solid white;
    z-index: 1;
}

.workflow-step:last-child::after,
.workflow-step:last-child::before {
    display: none;
}

.workflow-step.completed {
    background: #d1fae5;
    color: #065f46;
}
.workflow-step.completed::after { border-left-color: #d1fae5; }

.workflow-step.active {
    background: var(--primary);
    color: white;
    font-weight: 600;
}
.workflow-step.active::after { border-left-color: var(--primary); }

.workflow-step.rejected {
    background: #fee2e2;
    color: #991b1b;
}
.workflow-step.rejected::after { border-left-color: #fee2e2; }

/* ==========================================================================
   9. Proposal Type Cards
   ========================================================================== */
.proposal-type-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    background: var(--bg-white);
    position: relative;
    overflow: hidden;
    height: 100%;
}

.proposal-type-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(26,58,107,0.15);
}

.proposal-type-card.selected {
    border-color: var(--primary);
    background: #f8fafc;
}

.proposal-type-card .icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
    background: rgba(26,58,107,0.05);
    color: var(--primary);
    transition: all var(--transition-normal);
}

.proposal-type-card:hover .icon-wrapper {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.proposal-type-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.proposal-type-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* ==========================================================================
   10. Login Page
   ========================================================================== */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #1e40af 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Background animated circles */
.login-page::before, .login-page::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    z-index: 1;
}

.login-page::before {
    top: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite;
}

.login-page::after {
    bottom: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(20px); }
    100% { transform: translateY(0px); }
}

.login-card {
    background: rgba(255,255,255,0.98);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo img {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.login-logo h3 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.login-form .form-floating {
    margin-bottom: 1.25rem;
}

.login-form .form-control {
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 1rem 0.75rem;
}

.login-form .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(26, 58, 107, 0.25);
}

.btn-login {
    background: var(--primary);
    color: white;
    border-radius: 10px;
    padding: 0.8rem;
    font-weight: 600;
    font-size: 1rem;
    width: 100%;
    transition: all var(--transition-fast);
}

.btn-login:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26,58,107,0.3);
}

/* ==========================================================================
   11. Tables (DataTable)
   ========================================================================== */
.table {
    vertical-align: middle;
}

.table th {
    background-color: var(--primary);
    color: white;
    font-weight: 500;
    padding: 1rem;
    border: none;
}

.table th:first-child { border-top-left-radius: 8px; }
.table th:last-child { border-top-right-radius: 8px; }

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(240, 244, 248, 0.5);
}

.table-hover tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

/* DataTable specific fixes */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary);
    color: white !important;
    border: 1px solid var(--primary);
    border-radius: 6px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-light);
    color: white !important;
    border: 1px solid var(--primary-light);
}

/* ==========================================================================
   12. Forms & Inputs
   ========================================================================== */
.form-label {
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(26, 58, 107, 0.1);
}

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

/* File Upload Area */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(26,58,107,0.02);
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.file-preview-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

/* ==========================================================================
   13. Components (Kuesioner, Score, Toasts)
   ========================================================================== */
/* Kuesioner Score Buttons */
.kuesioner-options {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.score-btn {
    flex: 1;
    min-width: 60px;
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem;
    transition: all 0.2s;
}

.score-btn:hover {
    transform: translateY(-2px);
}

.score-btn.active {
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.question-item {
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background: white;
}

/* Progress Bar */
.progress-container {
    background: #e2e8f0;
    border-radius: 10px;
    height: 12px;
    overflow: hidden;
}

.progress-bar {
    background: var(--success);
    height: 100%;
    transition: width 0.3s ease;
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1050;
}

.toast {
    box-shadow: var(--shadow-lg);
    border-radius: 8px;
}

/* ==========================================================================
   14. Responsive (Mobile)
   ========================================================================== */
@media (max-width: 991.98px) {
    .workflow-step {
        font-size: 10px;
        padding: 8px 10px 8px 20px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .main-content.expanded {
        margin-left: 0;
    }
    
    .btn-toggle-sidebar.desktop-only {
        display: none;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    
    .card-stat {
        margin-bottom: 1rem;
    }
    
    .workflow-indicator {
        flex-direction: column;
        border: none;
    }
    
    .workflow-step {
        width: 100%;
        margin-bottom: 5px;
        border-radius: 6px;
        padding: 10px;
    }
    
    .workflow-step::after, .workflow-step::before {
        display: none;
    }
    
    .table-responsive {
        border: 0;
    }
}

/* ==========================================================================
   15. Print Styles
   ========================================================================== */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .sidebar, .topbar, .no-print, .btn, .footer, .toast-container, .modal {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
        margin-bottom: 1rem !important;
    }
    
    .print-container {
        max-width: 210mm; /* A4 width */
        margin: 0 auto;
        font-family: 'Times New Roman', Times, serif;
    }
    
    .print-header {
        border-bottom: 3px double #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .print-header h2, .print-header h3 {
        margin: 0;
        color: black;
    }
    
    .badge {
        border: 1px solid #000;
        color: #000 !important;
        background: transparent !important;
    }
    
    table {
        width: 100% !important;
        border-collapse: collapse;
    }
    
    table th, table td {
        border: 1px solid #000 !important;
        padding: 8px;
    }
    
    table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .page-break {
        page-break-before: always;
    }
}

/* ==========================================================================
   16. Utilities
   ========================================================================== */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.text-justify { text-align: justify; }

.cursor-pointer { cursor: pointer; }

/* Custom Scrollbar for elements */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #c1c1c1; 
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8; 
}

/* Sidebar User styling */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.15);
}
.sidebar-user .user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    border: 2px solid rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}
.sidebar-user .user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
.sidebar-user .role-badge {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 2px;
}
/* Collapsed state styling for sidebar user */
.sidebar-collapsed .sidebar-user {
    padding: 1rem 0;
    justify-content: center;
}
.sidebar-collapsed .sidebar-user .user-info {
    display: none;
}

/* Custom status badges colors */
.bg-purple { background-color: #6f42c1 !important; color: white !important; }
.bg-indigo { background-color: #6610f2 !important; color: white !important; }
.bg-teal { background-color: #20c997 !important; color: white !important; }

/* Sidebar section headers for ADMIN */
.sidebar-nav .nav-header {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    padding: 8px 20px 4px;
    margin-top: 8px;
    list-style: none;
}
