/* ==========================================================================
   Mail Management System (MMS) - Design System & Stylesheet
   North Central Provincial Council & Governor's Office
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+Sinhala:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --font-main: 'Inter', 'Noto Sans Sinhala', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', 'Noto Sans Sinhala', sans-serif;
    --font-sinhala: 'Noto Sans Sinhala', 'Inter', sans-serif;

    /* Color Palette */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #0f172a;
    --bg-sidebar-hover: #1e293b;
    --bg-sidebar-active: #2563eb;
    
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-glow: rgba(37, 99, 235, 0.18);

    --accent: #6366f1;
    --accent-light: #eef2ff;

    --success: #10b981;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;

    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;

    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;

    --info: #0ea5e9;
    --info-light: #f0f9ff;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-white: #ffffff;

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

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --sidebar-width: 270px;
    --navbar-height: 70px;
    --transition-speed: 0.25s;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

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

/* Sinhala Font Helper */
.sinhala-text {
    font-family: var(--font-sinhala);
}

/* ==========================================================================
   Layout - App Shell
   ========================================================================== */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0b1329 0%, #0f172a 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-speed) ease;
}

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

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}

.sidebar-brand-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.sidebar-brand-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Mini Profile in Sidebar */
.sidebar-user-badge {
    padding: 16px 20px;
    margin: 14px 14px 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

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

.sidebar-user-role {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 2px;
}

.role-admin { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.role-operator { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.role-subject { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

/* Sidebar Navigation Menu */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    list-style: none;
}

.sidebar-menu::-webkit-scrollbar {
    width: 5px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.menu-category {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    margin: 18px 0 8px 12px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: #94a3b8;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.menu-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color var(--transition-speed);
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

.menu-link:hover i {
    color: #60a5fa;
}

.menu-item.active .menu-link {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.menu-item.active .menu-link i {
    color: #ffffff;
}

.menu-badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: #f87171;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.btn-sidebar-logout:hover {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

/* Main Content Area */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    max-width: calc(100% - var(--sidebar-width));
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg-main);
    transition: margin var(--transition-speed) ease;
}

/* Top Navbar */
.app-navbar {
    height: var(--navbar-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.navbar-page-title {
    display: flex;
    flex-direction: column;
}

.navbar-page-title h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

.navbar-page-title span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.navbar-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.navbar-user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
}

.navbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* Page Container */
.app-content {
    flex: 1;
    padding: 28px;
}

/* ==========================================================================
   Cards, Widgets & Metrics
   ========================================================================== */

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--primary);
}

.card-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Stat Widgets Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

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

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.1;
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 4px;
}

.stat-sub {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* Stat Card Color Themes */
.stat-primary .stat-icon-wrapper { background: #eff6ff; color: #2563eb; }
.stat-success .stat-icon-wrapper { background: #ecfdf5; color: #10b981; }
.stat-warning .stat-icon-wrapper { background: #fffbeb; color: #f59e0b; }
.stat-danger .stat-icon-wrapper { background: #fef2f2; color: #ef4444; }
.stat-purple .stat-icon-wrapper { background: #f5f3ff; color: #8b5cf6; }
.stat-cyan .stat-icon-wrapper { background: #ecfeff; color: #06b6d4; }

/* Status Stacks (Pending, In-Progress, Completed) */
.status-stacks-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.status-stack-card {
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    position: relative;
    border-top: 4px solid transparent;
}

.stack-pending { border-top-color: var(--warning); }
.stack-inprogress { border-top-color: var(--primary); }
.stack-completed { border-top-color: var(--success); }

.stack-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stack-title {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stack-count {
    font-size: 1.6rem;
    font-weight: 800;
    font-family: var(--font-heading);
}

.stack-pending .stack-count { color: var(--warning); }
.stack-inprogress .stack-count { color: var(--primary); }
.stack-completed .stack-count { color: var(--success); }

/* ==========================================================================
   Forms & Controls
   ========================================================================== */

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-control, .form-select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
    outline: none;
}

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

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

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

/* Radio Option Cards / Segmented Controls */
.source-type-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 18px;
}

@media (max-width: 860px) {
    .source-type-selector {
        grid-template-columns: 1fr;
    }
}

.source-radio-card {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-speed);
    background: #ffffff;
}

.source-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.source-radio-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.source-radio-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.source-radio-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all var(--transition-speed);
    flex-shrink: 0;
}

.source-radio-card.active .source-radio-icon {
    background: var(--primary);
    color: white;
}

.source-radio-content h4 {
    font-size: 0.90rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.source-radio-content p {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* Mail Type Origin Badges */
.mail-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.mail-type-badge.type-internal {
    background: #ede9fe;
    color: #6366f1;
    border: 1px solid #ddd6fe;
}

.mail-type-badge.type-external {
    background: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

.mail-type-badge.type-public {
    background: #ecfeff;
    color: #0891b2;
    border: 1px solid #a5f3fc;
}

/* Sinhala Autocomplete Dropdown */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    max-height: 260px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 10px 14px;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: var(--font-sinhala);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background var(--transition-speed);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover, .autocomplete-item.selected {
    background-color: var(--primary-light);
    color: var(--primary);
}

.autocomplete-item .badge-dept {
    font-size: 0.7rem;
    font-family: var(--font-main);
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
}

/* File Upload Zone */
.file-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.file-dropzone:hover, .file-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-dropzone i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.file-dropzone-text {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.file-dropzone-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-success {
    background: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background: #059669;
    color: #ffffff;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-secondary {
    background: #f1f5f9;
    border-color: var(--border-color);
    color: #475569;
}
.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   Data Tables & Columns System
   ========================================================================== */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.table-responsive::-webkit-scrollbar {
    height: 7px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.data-table {
    width: 100%;
    min-width: 850px;
    border-collapse: collapse;
    text-align: left;
    background: #ffffff;
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 13px 16px;
    border-bottom: 2px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    font-size: 0.86rem;
    color: #334155;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color 0.15s ease;
}

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

.data-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Dedicated Column Layout & Width Specifications */
.data-table .col-ref {
    width: 155px;
    min-width: 145px;
    white-space: nowrap;
}

.ref-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    background: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 3px 9px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}
.ref-badge-link:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.data-table .col-date {
    width: 105px;
    min-width: 95px;
    font-size: 0.82rem;
    color: #475569;
    white-space: nowrap;
}

.data-table .col-channel {
    width: 125px;
    min-width: 120px;
}

.data-table .col-source {
    width: 220px;
    min-width: 180px;
    max-width: 260px;
    line-height: 1.35;
}
.data-table .col-source .source-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #334155;
    margin-top: 4px;
    word-break: break-word;
}

/* REASON / SUBJECT COLUMN: High Legibility & Generous Space */
.data-table .col-reason {
    min-width: 300px;
    width: auto;
    line-height: 1.5;
}

.mail-reason-title,
.mail-reason-text {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.90rem;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    font-family: var(--font-sinhala), var(--font-main);
}

.mail-reason-desc,
.mail-desc-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
    font-family: var(--font-sinhala), var(--font-main);
    word-break: normal;
    overflow-wrap: break-word;
}
.mail-reason-desc i,
.mail-desc-text i {
    color: #94a3b8;
    margin-top: 2px;
    font-size: 0.72rem;
}

.data-table .col-officer {
    width: 170px;
    min-width: 150px;
}

.data-table .col-category {
    width: 185px;
    min-width: 175px;
}

.data-table .col-priority {
    width: 110px;
    min-width: 100px;
    white-space: nowrap;
}

.data-table .col-sla {
    width: 140px;
    min-width: 130px;
    white-space: nowrap;
}

.data-table .col-status {
    width: 130px;
    min-width: 120px;
    white-space: nowrap;
}

.data-table .col-doc {
    width: 65px;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

.data-table .col-action {
    width: 130px;
    min-width: 115px;
    text-align: right;
    white-space: nowrap;
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.table-search-box {
    position: relative;
    min-width: 260px;
}

.table-search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.table-search-box input {
    width: 100%;
    padding: 9px 12px 9px 36px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    outline: none;
}

.table-search-box input:focus {
    border-color: var(--primary);
}

/* Status & Priority Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.badge-pending {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.badge-approval {
    background: #ede9fe;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.badge-instructions {
    background: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

.badge-lettersent {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.badge-filed,
.badge-completed {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.badge-inprogress {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.priority-normal {
    background: #f1f5f9;
    color: #475569;
}

.priority-urgent {
    background: #ffedd5;
    color: #c2410c;
}

.priority-very-urgent {
    background: #fee2e2;
    color: #b91c1c;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.75; }
}

/* Mail Type Badge */
.mail-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}
.type-internal { background: #e0e7ff; color: #3730a3; }
.type-public { background: #fef3c7; color: #92400e; }

/* Address Type Badge (Direct vs Copy) */
.badge-address {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.badge-address-direct {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.badge-address-copy {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

/* Received Type Badge (By Hand, Normal Post, Social Media, Email) */
.badge-received {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}
.badge-received-hand {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.badge-received-post {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #ffedd5;
}
.badge-received-social {
    background: #fdf2f8;
    color: #be185d;
    border: 1px solid #fce7f3;
}
.badge-received-email {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
}

/* SLA & Due Date Highlighted Badges */
.sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.sla-completed {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.sla-ontrack {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.sla-duesoon {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-weight: 800;
}
.sla-overdue {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.35);
    font-weight: 800;
}

/* Overdue Pulsing Glowing Animation */
@keyframes pulseOverdue {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
        transform: scale(1.02);
    }
}

.animated-pulse-alert {
    animation: pulseOverdue 2s infinite ease-in-out;
}

/* Table Row Overdue Highlighting */
.data-table tr.row-overdue {
    background-color: #fff8f8 !important;
    border-left: 3.5px solid #ef4444 !important;
}
.data-table tr.row-overdue:hover {
    background-color: #fee2e2 !important;
}

/* Overdue Alert Banner */
.overdue-highlight-banner {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #f87171;
    border-left: 5px solid #dc2626;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.12);
}

/* Option Button Group Selector */
.option-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 6px;
}

.option-radio-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.option-radio-card:hover {
    border-color: #93c5fd;
    background: #f8fafc;
}

.option-radio-card.active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.option-radio-card input[type="radio"] {
    display: none;
}

.option-radio-card .opt-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.option-radio-card.active .opt-icon {
    background: #2563eb;
    color: #ffffff;
}

.option-radio-card .opt-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.option-radio-card.active .opt-title {
    color: #1d4ed8;
}

.option-radio-card .opt-sub {
    font-size: 0.72rem;
    color: #64748b;
}

/* Top Navbar Notifications Component */
.navbar-notification-wrapper {
    position: relative;
}

.navbar-notification-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

.navbar-notification-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

.navbar-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    font-size: 0.68rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.7);
    border: 2px solid #ffffff;
    animation: pulseOverdue 2s infinite ease-in-out;
}

.notification-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 380px;
    max-width: 92vw;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid #e2e8f0;
    z-index: 1050;
    display: none;
    overflow: hidden;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.notification-dropdown-menu.show {
    display: block;
}

.notif-header {
    padding: 14px 18px;
    background: #0f172a;
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-header h4 {
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-body {
    max-height: 360px;
    overflow-y: auto;
    padding: 0;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.notif-overdue {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.notif-item.notif-overdue:hover {
    background: #fee2e2;
}

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notif-icon.icon-overdue {
    background: #fee2e2;
    color: #dc2626;
}

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

.notif-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.notif-desc {
    font-size: 0.74rem;
    color: #64748b;
    line-height: 1.35;
    margin-bottom: 4px;
}

.notif-time {
    font-size: 0.68rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.notif-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
}

/* ==========================================================================
   Alerts & Notifications
   ========================================================================== */

.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.88rem;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success-border);
    color: #065f46;
}

.alert-error, .alert-danger {
    background: var(--danger-light);
    border: 1px solid var(--danger-border);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning-border);
    color: #92400e;
}

.alert-info {
    background: var(--info-light);
    border: 1px solid #bae6fd;
    color: #0369a1;
}

/* ==========================================================================
   Modals
   ========================================================================== */

.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-backdrop.active {
    display: flex;
}

.modal-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    animation: modalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1024px) {
    .status-stacks-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
        width: 100%;
        max-width: 100%;
    }

    .btn-toggle-sidebar {
        display: block;
    }

    .app-content {
        padding: 16px;
    }

    .source-type-selector {
        grid-template-columns: 1fr;
    }

    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   High-Definition Scanned Document Studio & PDF Viewer Styles
   ========================================================================== */

.studio-modal-box {
    max-width: 860px;
    width: 95%;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: #ffffff;
}

/* Studio Top Control Toolbar */
.studio-toolbar {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.studio-page-badge {
    background: #0f172a;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.studio-filters-tray {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    background: #e2e8f0;
    padding: 3px;
    border-radius: 20px;
}

.btn-studio-filter {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-studio-filter:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.6);
}

.btn-studio-filter.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

/* Studio Main Viewport (A4 Document Frame) */
.studio-main-viewport {
    background: #0f172a;
    padding: 24px 16px;
    min-height: 420px;
    max-height: 56vh;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.studio-document-sheet {
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    max-height: 50vh;
    max-width: 90%;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    transition: transform 0.2s ease-out;
}

/* Multi-Page Filmstrip Carousel */
.studio-filmstrip {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    background: #f1f5f9;
    border-top: 1px solid var(--border-color);
    overflow-x: auto;
    align-items: center;
}

.studio-filmstrip-card {
    position: relative;
    width: 68px;
    height: 80px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.studio-filmstrip-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.studio-filmstrip-card.active {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

.studio-filmstrip-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.filmstrip-page-num {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    z-index: 2;
}

/* Attached PDF Success Card */
.attached-pdf-success-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #86efac;
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.25s ease-in;
}

.pdf-card-icon {
    font-size: 2.4rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-card-info {
    flex: 1;
    min-width: 220px;
}

.pdf-filename {
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-meta {
    font-size: 0.78rem;
    color: #475569;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.badge-page-count {
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.badge-ready {
    background: #dcfce7;
    color: #15803d;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.pdf-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Floating Toast Notification */
.scanner-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.scanner-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Interactive Report & Analytics Badges/Cards */
.status-stack-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.status-stack-card-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.report-badge-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: transform 0.15s ease;
}
.report-badge-link:hover .status-badge {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    filter: brightness(0.95);
}

.report-count-link {
    text-decoration: none;
    color: #0f172a;
    display: inline-block;
    transition: color 0.15s ease, transform 0.15s ease;
}
.report-count-link:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.report-row-link {
    text-decoration: none;
    color: inherit;
    font-weight: 700;
    transition: color 0.15s ease;
}
.report-row-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.report-rate-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.report-rate-link:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}
.report-rate-link:hover .rate-percent-text {
    color: #1d4ed8;
}

/* ==========================================================================
   Responsive Pagination Styles
   ========================================================================== */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.pagination-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-summary {
    font-size: 0.84rem;
    color: #64748b;
}

.pagination-perpage {
    display: flex;
    align-items: center;
    gap: 6px;
}

.per-page-dropdown {
    padding: 4px 10px;
    font-size: 0.80rem;
    width: auto;
    height: auto;
    border-radius: var(--radius-md);
    border-color: var(--border-color);
    background-color: var(--bg-card);
    color: var(--text-dark);
    cursor: pointer;
}

.pagination-nav {
    display: flex;
    align-items: center;
}

.pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-dark);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
    user-select: none;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: #f1f5f9;
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
    cursor: default;
}

.pagination-btn.disabled {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    opacity: 0.65;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 32px;
    color: #94a3b8;
    font-weight: 700;
}

/* MMS Modern Page Link Animations */
.mms-page-link {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.mms-page-link:hover {
    background: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.mms-pagination-nav-list li {
    list-style: none !important;
}

@media (max-width: 768px) {
    .mms-pagination-container {
        flex-direction: column;
        align-items: stretch !important;
        gap: 16px !important;
    }
}

/* ==========================================================================
   Officer Categories & Custom Classification Badges
   ========================================================================== */
.category-badge {
    --cat-color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--cat-color);
    border: 1px solid rgba(37, 99, 235, 0.25);
    background-color: color-mix(in srgb, var(--cat-color) 12%, transparent);
    border-color: color-mix(in srgb, var(--cat-color) 35%, transparent);
    white-space: nowrap;
    transition: all 0.15s ease;
}

.category-badge i {
    font-size: 0.7rem;
    opacity: 0.9;
}

.category-badge:hover {
    filter: brightness(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.badge-uncategorized {
    background: #f8fafc !important;
    color: #94a3b8 !important;
    border: 1px dashed #cbd5e1 !important;
    font-weight: 600;
}

.color-swatch-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.color-swatch-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px #cbd5e1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.7rem;
    transition: all 0.15s ease;
}

.color-swatch-item:hover {
    transform: scale(1.15);
}

.color-swatch-item.active {
    box-shadow: 0 0 0 2.5px #0f172a;
    transform: scale(1.12);
}

.category-mgmt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.15s ease;
}

.category-mgmt-item:hover {
    border-color: #cbd5e1;
    background: #fafafa;
}

.category-mgmt-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}





