/* ===== CSS Variables ===== */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;
    
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 40px rgba(0, 0, 0, 0.1);
    --font-family: 'Be Vietnam Pro', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    background: var(--bg-secondary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== Main Layout (Global) ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
}

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: #1e293b !important;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 9999;
    transition: width 0.25s ease, min-width 0.25s ease, max-width 0.25s ease;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #0f172a !important;
    border-bottom: 1px solid #334155;
    min-height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    transition: opacity 0.25s ease, width 0.25s ease;
}

.sidebar-collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.toggle-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: #334155;
    border: none;
    border-radius: 8px;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

.toggle-btn:hover {
    background: #6366f1;
    color: white;
}

.toggle-btn svg {
    width: 18px;
    height: 18px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: #1e293b !important;
}

.nav-section {
    margin-bottom: 16px;
}

.nav-section-title {
    display: block;
    padding: 0 20px;
    margin-bottom: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
    white-space: nowrap;
    transition: opacity 0.25s ease;
}

.sidebar-collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 4px 12px;
    border-radius: 8px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.25s ease;
    background: transparent;
}

.nav-item:hover {
    background: #334155;
    color: #ffffff;
}

.nav-item.active {
    background: #6366f1 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-icon {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
}

.nav-text {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: opacity 0.25s ease, width 0.25s ease;
}

.sidebar-collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    margin: 4px 8px;
}

.sidebar-footer {
    padding: 16px;
    background: #0f172a !important;
    border-top: 1px solid #334155;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: #334155;
    border-radius: 10px;
    overflow: hidden;
}

.user-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.user-avatar svg {
    width: 18px;
    height: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s ease, width 0.25s ease;
}

.sidebar-collapsed .user-details {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
}

.user-role {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

.logout-form {
    margin-left: auto;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    padding: 8px;
    border-radius: 8px;
    color: #f87171;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.logout-btn svg {
    width: 18px;
    height: 18px;
}

.login-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.login-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.login-link svg {
    width: 18px;
    height: 18px;
}

.sidebar-collapsed .login-link span {
    display: none;
}

.sidebar-collapsed .logout-btn {
    margin-left: 0;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left 0.25s ease;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
    z-index: 1;
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.top-header {
    height: 64px;
    min-height: 64px;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 40px;
    height: 40px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
}

.header-btn:hover {
    background: #eef2ff;
    border-color: #6366f1;
    color: #6366f1;
}

.header-btn svg {
    width: 20px;
    height: 20px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.content-area {
    flex: 1;
    padding: 24px;
    background: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ===== Dashboard Cards ===== */
.dashboard-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.dashboard-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-2px);
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color) 0%, #059669 100%);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color) 0%, #d97706 100%);
}

.stat-card.danger::before {
    background: linear-gradient(90deg, var(--danger-color) 0%, #dc2626 100%);
}

.stat-card .stat-value {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Rating Badges ===== */
.rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.rating-a {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.rating-b {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.rating-c {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.rating-d {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ===== Page Header ===== */
.page-header {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== Chart Container ===== */
.chart-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-color);
}

/* ===== Radzen DataGrid Override ===== */
.rz-datatable {
    border-radius: 12px !important;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
}

.rz-datatable-thead {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%) !important;
}

.rz-datatable-thead .rz-column-title {
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.rz-datatable-data tr {
    transition: var(--transition);
}

.rz-datatable-data tr:hover {
    background: var(--primary-light) !important;
}

/* ===== Radzen Buttons Override ===== */
.rz-button {
    border-radius: 10px !important;
    font-weight: 600 !important;
    transition: var(--transition) !important;
}

.rz-button.rz-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.rz-button.rz-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4) !important;
}

.rz-button.rz-secondary {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

.rz-button.rz-secondary:hover {
    background: var(--border-color) !important;
}

.rz-button.rz-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%) !important;
    border: none !important;
}

.rz-button.rz-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%) !important;
    border: none !important;
}

.rz-button.rz-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #2563eb 100%) !important;
    border: none !important;
}

/* ===== Radzen Form Inputs Override ===== */
.rz-textbox,
.rz-dropdown,
.rz-inputtext {
    border-radius: 10px !important;
    border: 2px solid var(--border-color) !important;
    transition: var(--transition) !important;
}

.rz-textbox:focus,
.rz-dropdown:focus,
.rz-inputtext:focus,
.rz-textbox:focus-within,
.rz-dropdown:focus-within {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px var(--primary-light) !important;
}

/* ===== Radzen Badge Override ===== */
.rz-badge {
    font-weight: 600 !important;
    border-radius: 8px !important;
}

/* ===== Progress Bar ===== */
.rz-progressbar {
    border-radius: 9999px !important;
    height: 10px !important;
    background: var(--bg-secondary) !important;
}

.rz-progressbar-value {
    border-radius: 9999px !important;
}

/* ===== Dialog Styling ===== */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.dialog-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    min-width: 400px;
    max-width: 500px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.dialog-large {
    min-width: 600px;
    max-width: 800px;
}

.dialog-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detail-item {
    margin-bottom: 1rem;
}

.detail-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.detail-item span {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* ===== Score Display ===== */
.score-display {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .page-header {
        padding: 1rem 1.5rem;
    }
    
    .page-header h2 {
        font-size: 1.25rem;
    }
    
    .dialog-content {
        min-width: 90vw;
        margin: 1rem;
    }
    
    .dialog-large {
        min-width: 90vw;
    }
}

/* ===== Standard DataGrid Styles ===== */
/* Áp dụng cho tất cả RadzenDataGrid trong hệ thống */
.rz-datatable {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    font-family: var(--font-family);
}

/* Header */
.rz-datatable-thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid var(--border-color);
}

.rz-datatable-thead > tr > th {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    background: transparent !important;
    white-space: nowrap;
}

.rz-datatable-thead > tr > th:first-child {
    border-top-left-radius: 12px;
}

.rz-datatable-thead > tr > th:last-child {
    border-top-right-radius: 12px;
}

/* Sortable header */
.rz-datatable-thead > tr > th.rz-sortable-column {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.rz-datatable-thead > tr > th.rz-sortable-column:hover {
    background: rgba(99, 102, 241, 0.05) !important;
    color: var(--primary-color);
}

.rz-datatable-thead > tr > th.rz-sortable-column.rz-sortable-column-active {
    color: var(--primary-color);
    font-weight: 700;
}

/* Body rows */
.rz-datatable-tbody > tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.rz-datatable-tbody > tr:last-child {
    border-bottom: none;
}

/* Striped rows */
.rz-datatable-tbody > tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

/* Hover effect */
.rz-datatable-tbody > tr:hover {
    background: rgba(99, 102, 241, 0.05) !important;
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Body cells */
.rz-datatable-tbody > tr > td {
    padding: 1rem 1.25rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    border: none;
    vertical-align: middle;
}

/* Selected row */
.rz-datatable-tbody > tr.rz-state-selected {
    background: rgba(99, 102, 241, 0.1) !important;
    border-left: 3px solid var(--primary-color);
}

.rz-datatable-tbody > tr.rz-state-selected:hover {
    background: rgba(99, 102, 241, 0.15) !important;
}

/* Pagination */
.rz-paginator {
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-radius: 0 0 12px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.rz-paginator .rz-paginator-element {
    min-width: 2.5rem;
    height: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rz-paginator .rz-paginator-element:hover:not(.rz-state-disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.rz-paginator .rz-paginator-element.rz-state-active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.rz-paginator .rz-paginator-element.rz-state-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Pagination info */
.rz-paginator .rz-paginator-rpp-options,
.rz-paginator .rz-paginator-current {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Filter row */
.rz-datatable-filter-row {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.rz-datatable-filter-row > td {
    padding: 0.75rem 1.25rem;
}

.rz-datatable-filter-row input,
.rz-datatable-filter-row select {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.rz-datatable-filter-row input:focus,
.rz-datatable-filter-row select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Empty state */
.rz-datatable-tbody > tr.rz-datatable-emptymessage-row > td {
    padding: 3rem 1.25rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Loading state */
.rz-datatable-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Action buttons in cells */
.rz-datatable-tbody > tr > td .rz-button {
    margin: 0 0.25rem;
    transition: all 0.2s ease;
}

.rz-datatable-tbody > tr > tr > td .rz-button:hover {
    transform: scale(1.1);
}

/* Badge in cells */
.rz-datatable-tbody > tr > td .rz-badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Responsive DataGrid */
@media (max-width: 768px) {
    .rz-datatable {
        border-radius: 8px;
    }
    
    .rz-datatable-thead > tr > th,
    .rz-datatable-tbody > tr > td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    .rz-paginator {
        flex-direction: column;
        align-items: stretch;
    }
    
    .rz-paginator .rz-paginator-element {
        min-width: 2rem;
        height: 2rem;
        font-size: 0.8125rem;
    }
}

/* Custom scrollbar for DataGrid */
.rz-datatable-wrapper::-webkit-scrollbar {
    height: 8px;
}

.rz-datatable-wrapper::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.rz-datatable-wrapper::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

.rz-datatable-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== Utility Classes for DataGrid ===== */
/* Class để áp dụng style chuẩn cho DataGrid */
.standard-datagrid {
    border-radius: 12px;
    overflow: hidden;
}

.standard-datagrid .rz-datatable {
    border: none;
    box-shadow: none;
}

/* Compact DataGrid (cho dialog hoặc không gian nhỏ) */
.compact-datagrid .rz-datatable-thead > tr > th,
.compact-datagrid .rz-datatable-tbody > tr > td {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
}

.compact-datagrid .rz-paginator {
    padding: 0.75rem 1rem;
}

/* Full-width DataGrid */
.fullwidth-datagrid {
    width: 100%;
}

.fullwidth-datagrid .rz-datatable {
    width: 100%;
}
