/**
 * EDMS Khmer - Modern Office Administrative Design System
 * Primary: Royal Blue | Neutral: White & Slate | Khmer Fonts: Kantumruy Pro & Battambang
 */

@import url('https://fonts.googleapis.com/css2?family=Battambang:wght@400;700&family=Kantumruy+Pro:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --font-primary: 'Kantumruy Pro', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-formal: 'Battambang', serif;

    /* Light Mode Palette - Police Style */
    --primary: #0f172a; /* Deep Navy Blue */
    --primary-hover: #1e293b;
    --primary-light: #f1f5f9;
    --primary-border: #cbd5e1;
    
    --secondary: #d4af37; /* Police Gold / Yellow */
    --secondary-light: #fef9c3;

    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-hover: #f8fafc;

    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --sidebar-bg: #0f172a; /* Deep Navy */
    --sidebar-text: #94a3b8;
    --sidebar-hover: #1e293b;
    --sidebar-active-bg: #d4af37; /* Gold Accent for Active Menu */
    --sidebar-active-text: #0f172a; /* Navy Text on Gold */

    /* Statuses - Refined for Professional Look */
    --urgent-bg: #fee2e2;
    --urgent-text: #991b1b;
    --urgent-border: #fca5a5;

    --processing-bg: #fef9c3;
    --processing-text: #854d0e;
    --processing-border: #fde047;

    --completed-bg: #d1fae5;
    --completed-text: #065f46;
    --completed-border: #6ee7b7;

    --pending-bg: #e0f2fe;
    --pending-text: #075985;
    --pending-border: #7dd3fc;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --sidebar-collapsed-width: 80px;
    --topbar-height: 68px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Palette */
[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    --primary-border: rgba(59, 130, 246, 0.3);

    --secondary: #94a3b8;
    --secondary-light: #1e293b;

    --bg-body: #0b1120;
    --bg-surface: #131d33;
    --bg-surface-elevated: #1a2642;
    --bg-subtle: #1e293b;
    --bg-hover: #22304d;

    --border-color: #243452;
    --border-subtle: #334468;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;

    --sidebar-bg: #0b1120;
    --sidebar-text: #94a3b8;
    --sidebar-hover: #17233f;
    --sidebar-active-bg: #2563eb;
    --sidebar-active-text: #ffffff;

    --urgent-bg: rgba(239, 68, 68, 0.2);
    --urgent-text: #fca5a5;
    --urgent-border: rgba(239, 68, 68, 0.4);

    --processing-bg: rgba(245, 158, 11, 0.2);
    --processing-text: #fcd34d;
    --processing-border: rgba(245, 158, 11, 0.4);

    --completed-bg: rgba(16, 185, 129, 0.2);
    --completed-text: #6ee7b7;
    --completed-border: rgba(16, 185, 129, 0.4);

    --pending-bg: rgba(56, 189, 248, 0.2);
    --pending-text: #7dd3fc;
    --pending-border: rgba(56, 189, 248, 0.4);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

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

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: width var(--transition), transform var(--transition);
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 0.85rem;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.3rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.brand-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.brand-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.25rem;
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--sidebar-text);
    font-weight: 500;
    font-size: 0.92rem;
    gap: 0.85rem;
    transition: var(--transition);
    position: relative;
}

.nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nav-badge {
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-weight: 600;
}

.nav-badge.urgent {
    background-color: #ef4444;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-sm {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.user-mini-info {
    overflow: hidden;
}

.user-mini-name {
    font-size: 0.86rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-mini-role {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition);
}

/* Top Navbar */
.app-topbar {
    height: var(--topbar-height);
    background-color: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(12px);
    transition: background-color var(--transition), border-color var(--transition);
}

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

.btn-sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Theme Switcher Button */
.btn-theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-theme-toggle:hover {
    background-color: var(--bg-subtle);
    color: var(--primary);
    border-color: var(--primary-border);
}

/* Notifications Dropdown */
.notif-dropdown-wrapper {
    position: relative;
}

.btn-notif {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.15rem;
    position: relative;
    transition: var(--transition);
}

.btn-notif:hover {
    background-color: var(--bg-subtle);
    color: var(--primary);
}

.notif-pulse-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #ef4444;
    border: 2px solid var(--bg-surface);
}

.notif-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    z-index: 120;
    overflow: hidden;
    animation: fadeInDown 0.2s ease;
}

.notif-menu.show {
    display: flex;
}

.notif-header {
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-subtle);
}

.notif-header h4 {
    font-size: 0.92rem;
    font-weight: 700;
}

.notif-list {
    max-height: 350px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-primary);
}

.notif-item:hover {
    background-color: var(--bg-subtle);
}

.notif-item.unread {
    background-color: var(--primary-light);
}

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

.notif-icon.danger { background: var(--urgent-bg); color: var(--urgent-text); }
.notif-icon.warning { background: var(--processing-bg); color: var(--processing-text); }
.notif-icon.info { background: var(--pending-bg); color: var(--pending-text); }

.notif-body h5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
}

.notif-body p {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.35;
}

.notif-body span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* User Menu Dropdown */
.user-dropdown-wrapper {
    position: relative;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: transparent;
    border: 1px solid var(--border-color);
    padding: 0.35rem 0.75rem 0.35rem 0.45rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
}

.user-profile-btn:hover {
    background-color: var(--bg-subtle);
    border-color: var(--primary-border);
}

.user-avatar-top {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.user-top-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 220px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: none;
    flex-direction: column;
    padding: 0.5rem;
    z-index: 120;
    animation: fadeInDown 0.2s ease;
}

.user-menu.show {
    display: flex;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition);
}

.user-menu-item:hover {
    background-color: var(--bg-subtle);
    color: var(--primary);
}

.user-menu-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.35rem 0;
}

.user-menu-item.logout {
    color: #ef4444;
}

.user-menu-item.logout:hover {
    background-color: var(--urgent-bg);
    color: #b91c1c;
}

/* Page Body Container */
.page-content {
    flex: 1;
    padding: 1.75rem;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.page-subtitle {
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-family: inherit;
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(30, 64, 175, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.35);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--bg-subtle);
    border-color: var(--border-subtle);
}

.btn-success {
    background-color: #059669;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #047857;
    color: #ffffff;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #b91c1c;
    color: #ffffff;
}

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

/* Stat Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.15rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}

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

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

.stat-icon.blue { background: var(--pending-bg); color: var(--primary); }
.stat-icon.green { background: var(--completed-bg); color: #059669; }
.stat-icon.amber { background: var(--processing-bg); color: #d97706; }
.stat-icon.red { background: var(--urgent-bg); color: #dc2626; }
.stat-icon.purple { background: rgba(147, 51, 234, 0.15); color: #9333ea; }

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

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    font-feature-settings: "tnum";
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

/* Surface Cards */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: background-color var(--transition), border-color var(--transition);
}

.card-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Filter Bar */
.filter-bar {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 180px;
}

.filter-input, .filter-select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.88rem;
    outline: none;
    transition: var(--transition);
}

.filter-input:focus, .filter-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background-color: var(--bg-subtle);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition);
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.table-bordered {
    border-collapse: collapse;
}

.table-bordered th, .table-bordered td {
    border: 1px solid #000000 !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-urgent { background-color: var(--urgent-bg); color: var(--urgent-text); border: 1px solid var(--urgent-border); }
.badge-processing { background-color: var(--processing-bg); color: var(--processing-text); border: 1px solid var(--processing-border); }
.badge-completed { background-color: var(--completed-bg); color: var(--completed-text); border: 1px solid var(--completed-border); }
.badge-pending { background-color: var(--pending-bg); color: var(--pending-text); border: 1px solid var(--pending-border); }

.badge-incoming { background-color: rgba(37, 99, 235, 0.12); color: #2563eb; border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-outgoing { background-color: rgba(16, 185, 129, 0.12); color: #059669; border: 1px solid rgba(16, 185, 129, 0.3); }

/* File Icons */
.file-icon-pdf { color: #ef4444; }
.file-icon-word { color: #2563eb; }
.file-icon-excel { color: #059669; }
.file-icon-img { color: #9333ea; }
.file-icon-default { color: #64748b; }

/* Table Action Buttons */
.action-buttons {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--bg-subtle);
    color: var(--primary);
    border-color: var(--primary-border);
}

.btn-icon.delete:hover {
    background-color: var(--urgent-bg);
    color: var(--urgent-text);
    border-color: var(--urgent-border);
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.modal-dialog {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.show .modal-dialog {
    transform: scale(1);
}

.modal-dialog-lg {
    max-width: 850px;
}

.modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-subtle);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-close:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-subtle);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: #ef4444;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 85px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Alerts & Flash Messages */
.alert {
    padding: 0.95rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid transparent;
}

.alert-success { background: var(--completed-bg); color: var(--completed-text); border-color: var(--completed-border); }
.alert-danger { background: var(--urgent-bg); color: var(--urgent-text); border-color: var(--urgent-border); }
.alert-warning { background: var(--processing-bg); color: var(--processing-text); border-color: var(--processing-border); }
.alert-info { background: var(--pending-bg); color: var(--pending-text); border-color: var(--pending-border); }

/* Animation Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Document Icons Enhancement */
.doc-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.doc-icon-pdf { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }
.doc-icon-word { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.doc-icon-excel { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.doc-icon-img { background-color: rgba(168, 85, 247, 0.1); color: #a855f7; }
.doc-icon-default { background-color: rgba(100, 116, 139, 0.1); color: #64748b; }
