:root {
    --primary: #1E4E79;
    --primary-hover: #163a5a;
    --background: #F5F7FA;
    --surface: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #5A6B7B;
    --border: #E5E7EB;
    --success: #2E7D32;
    --success-bg: #E8F5E9;
    --success-border: #C8E6C9;
    --warning: #ED6C02;
    --warning-bg: #FFF3E0;
    --warning-border: #FFE0B2;
    --danger: #D32F2F;
    --danger-bg: #FFEBEE;
    --danger-border: #FFCDD2;
    --info: #0288D1;
    --info-bg: #E3F2FD;
    --info-border: #BBDEFB;
    --neutral-bg: #F5F5F5;
    --neutral-border: #E0E0E0;
    --focus-ring: rgba(30, 78, 121, 0.2);
    --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.gov-app {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.ph-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.admin-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background-color: var(--background);
}

.admin-sidebar {
    width: var(--sidebar-width, 240px);
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-sidebar-brand {
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    background-color: var(--primary);
    color: white;
    font-size: 18px;
    font-weight: 600;
    gap: 10px;
}

.admin-sidebar-nav {
    padding: 20px 0;
    overflow-y: auto;
}

.admin-nav-group {
    margin-bottom: 20px;
}

.admin-nav-title {
    display: block;
    padding: 0 20px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-main);
    text-decoration: none;
    gap: 12px;
    transition: background 0.2s;
}

.admin-nav-item i {
    font-size: 18px;
    color: var(--text-muted);
}

.admin-nav-item:hover {
    background-color: var(--background);
}

.admin-nav-item.admin-active {
    background-color: #E8F0FE;
    color: var(--primary);
    border-left: 4px solid var(--primary);
    padding-left: 16px;
    font-weight: 500;
}

.admin-nav-item.admin-active i {
    color: var(--primary);
}

.admin-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-top-nav {
    height: 60px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.admin-search-bar {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 12px;
    width: 320px;
}

.admin-search-bar input {
    border: none;
    background: none;
    outline: none;
    margin-left: 8px;
    width: 100%;
    font-family: var(--font-family);
    color: var(--text-main);
}

.admin-top-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.admin-icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.admin-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    font-size: 10px;
    color: white;
    padding: 2px 5px;
    border-radius: 10px;
    font-weight: bold;
    line-height: 1;
}

.admin-badge-warning {
    background-color: var(--warning);
}

.admin-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.admin-user-info {
    display: flex;
    flex-direction: column;
}

.admin-user-name { font-weight: 600; font-size: 13px; }
.admin-user-role { font-size: 11px; color: var(--text-muted); }

.admin-content-wrapper {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.admin-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.admin-btn-primary {
    background-color: var(--primary);
    color: white;
}

.admin-btn-primary:hover {
    background-color: var(--primary-hover);
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.admin-kpi-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 4px;
}

.admin-kpi-header {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.admin-kpi-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 8px;
}

.admin-kpi-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.admin-trend-positive { color: var(--success); }
.admin-trend-neutral { color: var(--text-muted); }
.admin-trend-warning { color: var(--warning); }

.admin-chart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.admin-chart-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
}

.admin-chart-card h3 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.admin-chart-container {
    flex: 1;
    position: relative;
    min-height: 250px;
}

.admin-table-section {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.admin-table-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-table-header h3 {
    font-size: 16px;
}

.admin-table-filter {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-family);
    outline: none;
}

.admin-table-filter:focus {
    border-color: var(--primary);
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background-color: var(--background);
    padding: 12px 20px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.admin-table td {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.admin-table tbody tr:nth-child(even) { background-color: #FAFAFA; }
.admin-table tbody tr:hover { background-color: var(--background); }

.admin-status-badge {
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-status-pending { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.admin-status-active { background-color: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.admin-status-approved { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.admin-status-archived { background-color: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--neutral-border); }

.admin-btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 13px;
}

.admin-btn-text:hover { text-decoration: underline; }

.login-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--background);
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.login-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 100%;
    padding: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand-icon {
    width: 56px;
    height: 56px;
    background-color: var(--primary);
    color: white;
    font-size: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    margin: 0 auto 16px auto;
}

.login-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.login-form-group {
    margin-bottom: 20px;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.login-input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-with-icon > i:first-child {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 18px;
}

.login-input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    font-size: 14px;
    font-family: var(--font-family);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-main);
    background-color: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.login-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.login-toggle-password:hover {
    color: var(--primary);
}

.login-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 13px;
}

.login-checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.login-forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.login-forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}

.login-btn-primary {
    background-color: var(--primary);
    color: white;
}

.login-btn-primary:hover {
    background-color: var(--primary-hover);
}

.login-btn-primary:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
}

.login-btn-block {
    width: 100%;
}

.login-system-warning {
    margin-top: 32px;
    padding: 16px;
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 4px;
    display: flex;
    gap: 12px;
}

.login-system-warning i {
    color: var(--warning);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.login-system-warning p {
    font-size: 12px;
    line-height: 1.5;
    color: #8C3B00;
    margin: 0;
}

.login-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 1024px) {
    .admin-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-chart-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
        overflow-y: auto;
    }

    .admin-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .admin-sidebar-brand {
        justify-content: center;
    }

    .admin-sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .admin-nav-group {
        display: flex;
        margin-bottom: 0;
    }

    .admin-nav-title {
        display: none;
    }

    .admin-nav-item {
        padding: 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .admin-nav-item.admin-active {
        border-left: none;
        border-bottom-color: var(--primary);
        background-color: transparent;
    }

    .admin-main-content {
        overflow: visible;
    }

    .admin-top-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 16px;
        gap: 16px;
    }

    .admin-top-actions {
        width: 100%;
        justify-content: space-between;
        order: 1;
    }

    .admin-search-bar {
        width: 100%;
        order: 2;
    }

    .admin-content-wrapper {
        padding: 16px;
    }

    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .admin-table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-table-filter {
        width: 100%;
    }

    .login-card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .admin-kpi-grid {
        grid-template-columns: 1fr;
    }

    .login-form-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


/* ==========================================================================
   5. APPOINTMENTS MANAGEMENT STYLES (Tiền tố: appointments-)
   ========================================================================== */

/* Header & Typography */
.appointments-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.appointments-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.appointments-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Thống kê nhanh (Stats) */
.appointments-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.appointments-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.appointments-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.appointments-stat-info {
    display: flex;
    flex-direction: column;
}

.appointments-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.appointments-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.2;
}

/* Bộ lọc (Filters) */
.appointments-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.appointments-filter-group {
    display: flex;
    gap: 16px;
    flex: 1;
    flex-wrap: wrap;
}

.appointments-search {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.appointments-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.appointments-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-main);
}

.appointments-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-main);
    background-color: var(--surface);
    min-width: 180px;
    outline: none;
}

.appointments-select:focus, .appointments-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Bảng dữ liệu (Table) */
.appointments-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow-x: auto;
}

.appointments-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 900px; /* Force scroll on small screens */
}

.appointments-table th {
    background-color: var(--background);
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.appointments-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.appointments-table tbody tr:hover {
    background-color: var(--background);
}

.appointments-citizen {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--primary);
}

.appointments-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.appointments-time-created {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.appointments-datetime {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appointments-date, .appointments-time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
}

.appointments-date { font-weight: 500; color: var(--text-main); }

/* Status Badges */
.appointments-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
}

.appointments-badge-pending { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.appointments-badge-approved { background-color: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.appointments-badge-completed { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.appointments-badge-cancelled { background-color: var(--neutral-bg); color: var(--text-muted); border: 1px solid var(--neutral-border); }

/* Actions (Nút thao tác) */
.appointments-actions {
    display: flex;
    gap: 8px;
}

.appointments-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.appointments-btn-icon:hover { background-color: var(--border); color: var(--text-main); }
.appointments-color-info:hover { color: var(--info); }
.appointments-color-success:hover { color: var(--success); }
.appointments-color-danger:hover { color: var(--danger); }

/* Tiện ích (Utilities) */
.appointments-fw-500 { font-weight: 500; }

/* ==========================================================================
   MODAL CHI TIẾT
   ========================================================================== */
.appointments-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.appointments-modal.active {
    display: flex;
}

.appointments-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.5); /* Backdrop */
    backdrop-filter: blur(2px);
}

.appointments-modal-content {
    position: relative;
    background: var(--surface);
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.appointments-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FAFAFA;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.appointments-modal-title {
    font-size: 16px;
    font-weight: 600;
}

.appointments-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.appointments-modal-close:hover { color: var(--danger); }

.appointments-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.appointments-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.appointments-modal-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.appointments-full-width {
    grid-column: 1 / -1;
}

.appointments-modal-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.appointments-modal-value {
    font-size: 14px;
    color: var(--text-main);
}

.appointments-modal-note {
    background: #FFF9C4;
    padding: 12px;
    border-left: 3px solid #FBC02D;
    font-size: 13px;
    color: #424242;
    border-radius: 0 4px 4px 0;
}

.appointments-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}


/* ==========================================================================
   RESPONSIVE CHO TRANG LỊCH HẸN
   ========================================================================== */
@media (max-width: 1200px) {
    .appointments-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .appointments-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .appointments-header {
        flex-direction: column;
        gap: 16px;
    }

    .appointments-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .appointments-modal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .appointments-stats-grid {
        grid-template-columns: 1fr; /* Gập thành 1 cột trên mobile nhỏ */
    }

    .appointments-search input, .appointments-select {
        width: 100%; /* Tràn viền input */
    }
}

/* ==========================================================================
   6. PAGINATION COMPONENT STYLES
   ========================================================================== */

/* Component Phân trang cốt lõi */
.gov-pagination-list {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.gov-pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

/* Trạng thái Hover cho nút thường */
.gov-pagination-item:not(.disabled):not(.active) .gov-pagination-link:hover {
    background-color: #E8F0FE;
    border-color: var(--primary);
    color: var(--primary);
}

/* Trạng thái Đang chọn (Active) */
.gov-pagination-item.active .gov-pagination-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    cursor: default;
}

/* Trạng thái Vô hiệu hóa (Disabled) */
.gov-pagination-item.disabled .gov-pagination-link {
    color: var(--text-muted);
    background-color: var(--neutral-bg);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.7;
}

/* Kiểu riêng cho dấu ... */
.gov-pagination-link.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
    min-width: auto;
    padding: 0 4px;
}

/* Chỉnh icon bên trong để cân đối */
.gov-pagination-link i {
    font-size: 14px;
}

/* Responsive Mobile */
@media (max-width: 600px) {
    .pagination-wrapper {
        justify-content: center; /* Đẩy ra giữa trên màn hình nhỏ */
        padding: 12px;
    }

    .gov-pagination-list {
        gap: 2px;
    }

    .gov-pagination-link {
        padding: 0 8px;
        min-width: 28px;
        height: 28px;
        font-size: 12px;
    }

    /* Ẩn chữ "Trước", "Sau" trên mobile nhỏ, chỉ giữ lại icon */
    .gov-pagination-link i + text,
    .gov-pagination-link text + i {
        display: none;
    }
}

/* ==========================================================================
   7. PROFILES MANAGEMENT STYLES (Tiền tố: profiles-)
   ========================================================================== */

/* Header & Typography */
.profiles-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.profiles-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.profiles-subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

/* Thống kê nhanh (Stats Grid - 6 Cột) */
.profiles-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.profiles-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.profiles-stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.profiles-stat-info {
    display: flex;
    flex-direction: column;
}

.profiles-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.profiles-stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
    line-height: 1.2;
    margin-top: 2px;
}

/* Bộ lọc (Filter Bar) */
.profiles-filter-bar {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.profiles-filter-group {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.profiles-search {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.profiles-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.profiles-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s;
}

.profiles-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-family);
    font-size: 13px;
    color: var(--text-main);
    background-color: var(--surface);
    min-width: 160px;
    outline: none;
    transition: all 0.2s;
}

.profiles-search input:focus,
.profiles-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Bảng dữ liệu (Table) */
.profiles-table-wrapper {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow-x: auto;
}

.profiles-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 1100px; /* Bắt buộc cuộn ngang trên màn nhỏ do có nhiều cột */
}

.profiles-table th {
    background-color: var(--background);
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.profiles-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

.profiles-table tbody tr:hover {
    background-color: var(--background);
}

/* Các tiện ích định dạng text trong bảng */
.profiles-text-center { text-align: center; }
.profiles-fw-600 { font-weight: 600; }
.profiles-fw-500 { font-weight: 500; }
.profiles-color-primary { color: var(--primary); }
.profiles-color-muted { color: var(--text-muted); }

.profiles-text-small {
    font-size: 11px;
    display: block;
    margin-top: 4px;
}

.profiles-citizen-info {
    display: flex;
    flex-direction: column;
}

.profiles-truncate {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.profiles-officer {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
}
.profiles-officer i { color: var(--text-muted); font-size: 16px; }

/* Status Badges */
.profiles-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
}

/* Custom Colors for Profiles */
.profiles-badge-received { background-color: var(--info-bg); color: var(--info); border: 1px solid var(--info-border); }
.profiles-badge-processing { background-color: #EDE7F6; color: #673AB7; border: 1px solid #D1C4E9; } /* Tím nhạt - Đang xử lý */
.profiles-badge-waiting { background-color: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.profiles-badge-completed { background-color: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.profiles-badge-rejected { background-color: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

/* Nút Thao tác (Actions) */
.profiles-actions {
    display: flex;
    gap: 6px;
}

.profiles-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.profiles-btn-icon:hover { background-color: var(--border); color: var(--text-main); }
.profiles-btn-icon.profiles-color-primary:hover { color: var(--primary); }
.profiles-btn-icon.profiles-color-info:hover { color: var(--info); }
.profiles-btn-icon.profiles-color-warning:hover { color: var(--warning); }
.profiles-btn-icon.profiles-color-success:hover { color: var(--success); }
.profiles-btn-icon.profiles-color-danger:hover { color: var(--danger); }

/* Vùng chứa Pagination */
.pagination-wrapper {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: var(--surface);
    border-radius: 0 0 6px 6px;
}

/* ==========================================================================
   MODAL CHI TIẾT HỒ SƠ
   ========================================================================== */
.profiles-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.profiles-modal.active {
    display: flex;
}

.profiles-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(31, 41, 55, 0.5); /* Backdrop mờ */
    backdrop-filter: blur(2px);
}

.profiles-modal-content {
    position: relative;
    background: var(--surface);
    width: 100%;
    max-width: 700px; /* Modal to hơn một chút do nhiều thông tin */
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    margin: 20px;
}

.profiles-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FAFAFA;
    border-radius: 8px 8px 0 0;
}

.profiles-modal-title {
    font-size: 16px;
    font-weight: 600;
}

.profiles-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.profiles-modal-close:hover { color: var(--danger); }

.profiles-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.profiles-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profiles-modal-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profiles-full-width {
    grid-column: 1 / -1;
}

.profiles-modal-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.profiles-modal-value {
    font-size: 14px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profiles-modal-value i {
    color: var(--text-muted);
    font-size: 16px;
}

.profiles-modal-desc {
    background: var(--background);
    padding: 14px;
    border-left: 3px solid var(--primary);
    font-size: 13px;
    color: var(--text-main);
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
}

.profiles-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-radius: 0 0 8px 8px;
}


/* ==========================================================================
   RESPONSIVE (Mobile / Tablet)
   ========================================================================== */

/* Tablet & Màn hình vừa */
@media (max-width: 1300px) {
    .profiles-stats-grid {
        grid-template-columns: repeat(3, 1fr); /* Giảm từ 6 cột xuống 3 cột */
    }
}

@media (max-width: 992px) {
    .profiles-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Điện thoại Mobile */
@media (max-width: 768px) {
    .profiles-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .profiles-stats-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cột trên điện thoại dọc/ngang */
    }

    .profiles-search input,
    .profiles-select {
        width: 100%;
    }

    .profiles-modal-grid {
        grid-template-columns: 1fr; /* Modal thành 1 cột */
    }
}

@media (max-width: 480px) {
    .profiles-stats-grid {
        grid-template-columns: 1fr; /* Nếu màn hình cực nhỏ, dồn về 1 cột */
    }
}

