/* ============================================
   COMPONENTS - Reusable UI Components
   ============================================ */

/* ============================================
   BUTTONS - Design System Component
   ============================================ */

/* Base Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  padding: var(--space-2, 8px) var(--space-4, 16px);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-md, 14px);
  font-weight: 500;
  border-radius: var(--radius-md, 6px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
  min-height: 36px;
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

/* Backward Compatibility - Old class names (btn-primary, btn-sm, etc) */
.btn-primary { background-color: var(--cde-blue, #1460b8); color: #ffffff; border-color: var(--cde-blue, #1460b8); }
.btn-primary:hover:not(:disabled) { background-color: #0e51a0; border-color: #0e51a0; }
.btn-secondary { background-color: var(--cde-surface, #ffffff); color: var(--cde-text2, #4b5263); border-color: var(--cde-border, #e1e4e8); }
.btn-secondary:hover:not(:disabled) { background-color: var(--cde-s2, #f7f8fa); border-color: var(--cde-border2, #cdd1d8); }
.btn-ghost { background-color: transparent; color: var(--cde-text2, #4b5263); border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background-color: var(--cde-s2, #f7f8fa); }
.btn-danger { background-color: var(--cde-red, #c0392b); color: #ffffff; border-color: var(--cde-red, #c0392b); }
.btn-danger:hover:not(:disabled) { background-color: #a33025; border-color: #a33025; }
.btn-success { background-color: var(--cde-publish, #157a35); color: #ffffff; border-color: var(--cde-publish, #157a35); }
.btn-success:hover:not(:disabled) { background-color: #12662c; border-color: #12662c; }
.btn-warning { background-color: var(--cde-wip, #b86e00); color: #ffffff; border-color: var(--cde-wip, #b86e00); }
.btn-warning:hover:not(:disabled) { background-color: #9a5c00; border-color: #9a5c00; }

.btn-sm { padding: var(--space-1, 4px) var(--space-3, 12px); font-size: var(--font-size-sm, 12px); min-height: 28px; border-radius: var(--radius-sm, 4px); }
.btn-md { padding: var(--space-2, 8px) var(--space-4, 16px); font-size: var(--font-size-md, 14px); min-height: 36px; }
.btn-lg { padding: var(--space-3, 12px) var(--space-5, 20px); font-size: var(--font-size-lg, 15px); min-height: 44px; border-radius: var(--radius-lg, 8px); }
.btn-icon { padding: var(--space-2, 8px); min-width: 36px; }
.btn-back { background: transparent; border: none; font-size: 18px; cursor: pointer; }
.btn-back:hover { opacity: 0.7; }

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(20, 96, 184, 0.15);
}

.btn:disabled,
.btn--disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Button Sizes */
.btn--sm {
  padding: var(--space-1, 4px) var(--space-3, 12px);
  font-size: var(--font-size-sm, 12px);
  min-height: 28px;
  border-radius: var(--radius-sm, 4px);
}

.btn--md {
  padding: var(--space-2, 8px) var(--space-4, 16px);
  font-size: var(--font-size-md, 14px);
  min-height: 36px;
}

.btn--lg {
  padding: var(--space-3, 12px) var(--space-5, 20px);
  font-size: var(--font-size-lg, 15px);
  min-height: 44px;
  border-radius: var(--radius-lg, 8px);
}

/* Button Variants */
.btn--primary {
  background-color: var(--cde-blue, #1460b8);
  color: #ffffff;
  border-color: var(--cde-blue, #1460b8);
}

.btn--primary:hover:not(:disabled) {
  background-color: #0e51a0;
  border-color: #0e51a0;
}

.btn--primary:active:not(:disabled) {
  background-color: #0a4080;
}

.btn--secondary {
  background-color: var(--cde-surface, #ffffff);
  color: var(--cde-text2, #4b5263);
  border-color: var(--cde-border, #e1e4e8);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--cde-s2, #f7f8fa);
  border-color: var(--cde-border2, #cdd1d8);
}

.btn--secondary:active:not(:disabled) {
  background-color: var(--cde-s3, #eef0f3);
}

.btn--ghost {
  background-color: transparent;
  color: var(--cde-text2, #4b5263);
  border-color: transparent;
}

.btn--ghost:hover:not(:disabled) {
  background-color: var(--cde-s2, #f7f8fa);
}

.btn--ghost:active:not(:disabled) {
  background-color: var(--cde-s3, #eef0f3);
}

.btn--danger {
  background-color: var(--cde-red, #c0392b);
  color: #ffffff;
  border-color: var(--cde-red, #c0392b);
}

.btn--danger:hover:not(:disabled) {
  background-color: #a33025;
  border-color: #a33025;
}

.btn--danger:active:not(:disabled) {
  background-color: #8a2820;
}

.btn--success {
  background-color: var(--cde-publish, #157a35);
  color: #ffffff;
  border-color: var(--cde-publish, #157a35);
}

.btn--success:hover:not(:disabled) {
  background-color: #12662c;
  border-color: #12662c;
}

.btn--warning {
  background-color: var(--cde-wip, #b86e00);
  color: #ffffff;
  border-color: var(--cde-wip, #b86e00);
}

.btn--warning:hover:not(:disabled) {
  background-color: #9a5c00;
  border-color: #9a5c00;
}

.btn--link {
  background-color: transparent;
  color: var(--cde-blue, #1460b8);
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  min-height: auto;
}

.btn--link:hover:not(:disabled) {
  color: #0e51a0;
  text-decoration: underline;
}

/* Button Shapes */
.btn--round {
  border-radius: var(--radius-full, 9999px);
}

.btn--square {
  border-radius: 0;
}

/* Button Full Width */
.btn--full {
  width: 100%;
}

/* Button Loading State */
.btn--loading {
  pointer-events: none;
}

.btn__spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn__loading-text {
  opacity: 0.7;
}

/* Button Icon */
.btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn__icon--svg svg {
  width: 18px;
  height: 18px;
}

.btn--sm .btn__icon--svg svg {
  width: 14px;
  height: 14px;
}

.btn--lg .btn__icon--svg svg {
  width: 22px;
  height: 22px;
}

/* Button Group */
.btn-group {
  display: inline-flex;
  gap: 0;
  border-radius: var(--radius-md, 6px);
  overflow: hidden;
}

.btn-group .btn {
  border-radius: 0;
  margin: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius-md, 6px) 0 0 var(--radius-md, 6px);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md, 6px) var(--radius-md, 6px) 0;
}

/* Icon Button */
.btn-icon {
  padding: var(--space-2, 8px);
  min-width: 36px;
}

/* ============================================
   INPUTS - Design System Component
   ============================================ */

/* Input Wrapper */
.input-wrapper {
  display: inline-flex;
  flex-direction: column;
  gap: var(--space-1, 4px);
  font-family: var(--font-family-primary);
}

.input-wrapper--full {
  width: 100%;
}

/* Input Label */
.input-label {
  font-size: var(--font-size-sm, 13px);
  font-weight: 500;
  color: var(--cde-text2, #4b5263);
}

.input-required {
  color: var(--cde-red, #c0392b);
  margin-left: 2px;
}

/* Input Container */
.input-container {
  display: flex;
  align-items: center;
  gap: var(--space-2, 8px);
  background: var(--cde-surface, #ffffff);
  border: 1px solid var(--cde-border, #e1e4e8);
  border-radius: var(--radius-md, 6px);
  padding: 0 var(--space-3, 12px);
  transition: all var(--transition-fast, 0.15s ease);
}

.input-container:focus-within {
  border-color: var(--cde-blue, #1460b8);
  box-shadow: 0 0 0 3px rgba(20, 96, 184, 0.1);
}

/* Input Sizes */
.input-wrapper--sm .input-container {
  padding: 0 var(--space-2, 8px);
  border-radius: var(--radius-sm, 4px);
}

.input-wrapper--sm .input-field {
  height: 28px;
  font-size: var(--font-size-sm, 12px);
}

.input-wrapper--md .input-field {
  height: 36px;
  font-size: var(--font-size-md, 14px);
}

.input-wrapper--lg .input-container {
  padding: 0 var(--space-4, 16px);
  border-radius: var(--radius-lg, 8px);
}

.input-wrapper--lg .input-field {
  height: 44px;
  font-size: var(--font-size-lg, 15px);
}

/* Input Field */
.input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  color: var(--cde-text, #24292e);
  min-width: 0;
}

.input-field::placeholder {
  color: var(--cde-muted, #8c94a3);
}

.input-field:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Input States */
.input-wrapper--error .input-container {
  border-color: var(--cde-red, #c0392b);
}

.input-wrapper--error .input-container:focus-within {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.input-wrapper--success .input-container {
  border-color: var(--cde-publish, #157a35);
}

.input-wrapper--success .input-container:focus-within {
  box-shadow: 0 0 0 3px rgba(21, 122, 53, 0.1);
}

.input-wrapper--disabled .input-container {
  background: var(--cde-s2, #f7f8fa);
  cursor: not-allowed;
}

/* Input Icon */
.input-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cde-muted, #8c94a3);
  flex-shrink: 0;
}

.input-wrapper--icon-left .input-icon {
  order: 0;
}

.input-wrapper--icon-left .input-field {
  order: 1;
}

.input-wrapper--icon-right .input-icon {
  order: 2;
}

.input-wrapper--icon-right .input-field {
  order: 1;
}

/* Input Prefix/Suffix */
.input-prefix,
.input-suffix {
  font-size: var(--font-size-sm, 13px);
  color: var(--cde-muted, #8c94a3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Input Helper Text */
.input-helper {
  font-size: var(--font-size-xs, 11px);
  color: var(--cde-muted, #8c94a3);
  padding-left: var(--space-1, 4px);
}

.input-helper--error {
  color: var(--cde-red, #c0392b);
}

.input-helper--success {
  color: var(--cde-publish, #157a35);
}

/* Textarea */
.textarea-wrapper .input-container {
  padding: var(--space-2, 8px) var(--space-3, 12px);
  align-items: flex-start;
}

.textarea-field {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.textarea-field--noresize {
  resize: none;
}

/* Select */
.select-wrapper .input-container {
  padding-right: var(--space-5, 20px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238c94a3' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.select-field {
  appearance: none;
  cursor: pointer;
  background: transparent;
}

.select-field:focus {
  outline: none;
}

/* ============================================
   STANDARD FORM SELECT / DROPLIST
   Unified styling for all dropdown selects
   ============================================ */

/* Base Select - Standard Size */
.form-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  display: inline-block;
  width: 100%;
  padding: var(--select-padding-y, 6px) var(--spacing-xl, 18px) var(--select-padding-y, 6px) var(--select-padding-x, 10px);
  font-family: var(--font-family-primary);
  font-size: var(--select-font-size, 13px);
  line-height: var(--select-line-height, 1.4);
  color: var(--select-text-color, #1f2937);
  background-color: var(--select-bg-color, #ffffff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  border: 1px solid var(--select-border-color, #e1e4e8);
  border-radius: var(--select-border-radius, 6px);
  cursor: pointer;
  transition: var(--select-transition);
  min-width: var(--select-min-width, 100px);
  box-sizing: border-box;
}

/* Select Hover State */
.form-select:hover {
  border-color: var(--select-hover-border, #60a5fa);
}

/* Select Focus State */
.form-select:focus {
  outline: none;
  border-color: var(--select-focus-border, #1460b8);
  box-shadow: 0 0 0 3px var(--select-focus-shadow, rgba(20, 96, 184, 0.15));
}

/* Select Disabled State */
.form-select:disabled {
  background-color: var(--gray-100, #f3f4f6);
  color: var(--text-muted, #6b7280);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Small Select Variant */
.form-select-sm {
  padding: var(--select-padding-y-sm, 4px) var(--spacing-lg, 14px) var(--select-padding-y-sm, 4px) var(--select-padding-x-sm, 8px);
  font-size: var(--select-font-size-sm, 12px);
  min-width: var(--select-min-width-sm, 80px);
  background-position: right 6px center;
  background-size: 12px;
  border-radius: var(--select-border-radius-sm, 4px);
}

/* Large Select Variant */
.form-select-lg {
  padding: 8px 36px 8px 14px;
  font-size: var(--font-size-md, 14px);
  min-width: 120px;
  background-position: right 12px center;
  background-size: 16px;
}

/* Select with custom arrow (no default arrow) */
.form-select--no-arrow {
  background-image: none;
  padding-right: var(--select-padding-x, 10px);
}

/* Select Dropdown Options Styling (for browser native dropdown) */
.form-select option {
  padding: 8px 12px;
  background-color: var(--bg-surface, #ffffff);
  color: var(--text-primary, #1f2937);
  font-family: var(--font-family-primary);
  font-size: var(--select-font-size, 13px);
}

/* Select Dropdown Options Hover */
.form-select option:hover,
.form-select option:focus {
  background-color: var(--cde-blue-bg, #eef5ff);
  color: var(--cde-blue, #1460b8);
}

/* Select Dropdown Selected Option */
.form-select option:checked,
.form-select option[selected] {
  background-color: var(--cde-blue, #1460b8);
  color: #ffffff;
}

/* ============================================
   CHECKBOX & RADIO
   ============================================ */
.checkbox,
.radio {
  width: 16px;
  height: 16px;
  accent-color: var(--cde-blue, #1460b8);
  cursor: pointer;
}

/* ============================================
   CARDS
   ============================================ */
.card {
  background-color: var(--cde-surface, #ffffff);
  border: 1px solid var(--cde-border, #e1e4e8);
  border-radius: var(--radius-lg, 10px);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
}

.card-header {
  padding: var(--space-4, 16px);
  border-bottom: 1px solid var(--cde-border, #e1e4e8);
  font-weight: 600;
}

.card-body {
  padding: var(--space-4, 16px);
}

.card-footer {
  padding: var(--space-4, 16px);
  border-top: 1px solid var(--cde-border, #e1e4e8);
  background-color: var(--cde-s2, #f7f8fa);
}

/* ============================================
   TABLES
   ============================================ */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-md, 14px);
}

.table th,
.table td {
  padding: var(--space-2, 8px) var(--space-3, 12px);
  text-align: left;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.table th {
  font-weight: 600;
  background-color: var(--bg-hover, #f3f4f6);
  color: var(--text-secondary, #374151);
}

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

/* Table Striped */
.table-striped tbody tr:nth-child(even) {
  background-color: var(--gray-50, #f9fafb);
}

/* Table Bordered */
.table-bordered th,
.table-bordered td {
  border: 1px solid var(--gray-200, #e5e7eb);
}

/* ============================================
   BADGES
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--font-size-xs, 10px);
  font-weight: 500;
  border-radius: var(--radius-full, 9999px);
  text-transform: uppercase;
}

.badge-primary {
  background-color: var(--blue-100, #dbeafe);
  color: var(--blue-800, #1e40af);
}

.badge-success {
  background-color: var(--color-success-bg, #eefaf3);
  color: var(--color-success, #16a34a);
}

.badge-warning {
  background-color: var(--color-warning-bg, #fffbeb);
  color: var(--color-warning, #d97706);
}

.badge-danger {
  background-color: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger, #dc2626);
}

/* ============================================
   ALERTS
   ============================================ */
.alert {
  padding: var(--space-3, 12px) var(--space-4, 16px);
  border-radius: var(--radius-md, 6px);
  border: 1px solid transparent;
  font-size: var(--font-size-md, 14px);
}

.alert-success {
  background-color: var(--color-success-bg, #eefaf3);
  border-color: var(--color-success-border, #86efac);
  color: #166534;
}

.alert-warning {
  background-color: var(--color-warning-bg, #fffbeb);
  border-color: var(--color-warning-border, #fcd34d);
  color: #92400e;
}

.alert-danger {
  background-color: var(--color-danger-bg, #fef2f2);
  border-color: var(--color-danger-border, #fca5a5);
  color: #991b1b;
}

.alert-info {
  background-color: var(--color-info-bg, #f0f9ff);
  border-color: var(--color-info-border, #7dd3fc);
  color: #075985;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
}

.tab {
  padding: var(--space-3, 12px) var(--space-4, 16px);
  font-size: var(--font-size-md, 14px);
  font-weight: 500;
  color: var(--text-muted, #6b7280);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.tab:hover {
  color: var(--text-primary, #111827);
}

.tab.active {
  color: var(--color-primary, #0066cc);
  border-bottom-color: var(--color-primary, #0066cc);
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  gap: var(--space-1, 4px);
  align-items: center;
}

.pagination-item {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-2, 8px);
  font-size: var(--font-size-sm, 11px);
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius-md, 6px);
  background-color: var(--bg-surface, #ffffff);
  color: var(--text-secondary, #374151);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.pagination-item:hover:not(:disabled) {
  background-color: var(--bg-hover, #f3f4f6);
  border-color: var(--gray-400, #9ca3af);
}

.pagination-item.active {
  background-color: var(--color-primary, #0066cc);
  border-color: var(--color-primary, #0066cc);
  color: #ffffff;
}

/* ============================================
   LOADING / SPINNER
   ============================================ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-top-color: var(--color-primary, #0066cc);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   TOOLTIP
   ============================================ */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--space-1, 4px) var(--space-2, 8px);
  font-size: var(--font-size-xs, 10px);
  white-space: nowrap;
  background-color: var(--gray-800, #1f2937);
  color: #ffffff;
  border-radius: var(--radius-sm, 4px);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast, 0.15s ease);
  z-index: var(--z-tooltip, 10002);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   DATA TABLE - Design System Component
   "Linh hồn" của CDE App
   ============================================ */

.data-table {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--cde-surface, #ffffff);
}

.data-table__wrapper {
  flex: 1;
  overflow: auto;
  position: relative;
}

.data-table__table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Header */
.data-table__thead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--cde-s2, #f7f8fa);
}

.data-table__thead .data-table__header-row {
  border-bottom: 2px solid var(--cde-border2, #cdd1d8);
}

.data-table__th {
  padding: 0;
  font-size: var(--font-size-sm, 12px);
  font-weight: 700;
  color: var(--cde-text2, #4b5263);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
  position: relative;
  background: transparent;
}

.data-table__th--checkbox {
  width: 40px;
  text-align: center;
}

.data-table__th-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.1s ease;
  height: 40px;
}

.data-table__th-inner:hover {
  background: var(--cde-s3, #eef0f3);
}

.data-table__th-inner--left { justify-content: flex-start; }
.data-table__th-inner--center { justify-content: center; }
.data-table__th-inner--right { justify-content: flex-end; }

.data-table__th-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table__sort-icon {
  opacity: 0.3;
  font-size: var(--font-size-xs, 11px);
  width: 16px;
  text-align: center;
  transition: opacity 0.15s ease;
}

.data-table__th[data-sortable="true"] .data-table__sort-icon {
  opacity: 0.5;
}

.data-table__th[data-sortable="true"]:hover .data-table__sort-icon {
  opacity: 0.8;
}

.data-table__th.sorted .data-table__sort-icon {
  opacity: 1;
  color: var(--cde-blue, #1460b8);
}

.data-table__sort-icon--asc::after { content: '↑'; }
.data-table__sort-icon--desc::after { content: '↓'; }

/* Column Resize Handle */
.data-table__resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  background: transparent;
  z-index: 10;
  transition: background 0.15s ease;
}

.data-table__resize-handle:hover,
.data-table__resize-handle.active {
  background: var(--cde-blue, #1460b8);
}

/* Body */
.data-table__tbody {
  background: var(--cde-surface, #ffffff);
}

.data-table__row {
  border-bottom: 1px solid var(--cde-border, #e1e4e8);
  transition: background 0.08s ease;
  cursor: pointer;
}

.data-table__row:hover {
  background: var(--cde-s2, #f7f8fa);
}

.data-table__row--selected {
  background: #eef5ff;
}

.data-table__row--selected:hover {
  background: #e0ebff;
}

/* Zone Header Row */
.data-table__zone-row {
  background: var(--cde-s2, #f7f8fa);
  cursor: default;
  border-bottom: 2px solid var(--cde-border2, #cdd1d8);
}

.data-table__zone-row td {
  padding: 8px 16px;
  font-weight: 700;
  font-size: var(--font-size-xs, 11px);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cde-text2, #4b5263);
}

.data-table__zone-label {
  margin-right: 8px;
}

.data-table__zone-count {
  font-family: var(--font-family-mono);
  opacity: 0.7;
}

/* Cells */
.data-table__td {
  padding: 0;
  vertical-align: middle;
  overflow: hidden;
}

.data-table__td--checkbox {
  width: 40px;
  text-align: center;
}

.data-table__td-inner {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  overflow: hidden;
}

.data-table__td-inner--left { justify-content: flex-start; }
.data-table__td-inner--center { justify-content: center; }
.data-table__td-inner--right { justify-content: flex-end; }

/* Checkbox */
.data-table__checkbox {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--cde-blue, #1460b8);
}

/* Empty State */
.data-table__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--cde-muted, #8c94a3);
  font-size: var(--font-size-md, 14px);
}

/* Loading State */
.data-table__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--cde-muted, #8c94a3);
}

.data-table__spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--cde-border, #e1e4e8);
  border-top-color: var(--cde-blue, #1460b8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ============================================
   CDE STATUS BADGES & CHIPS
   Theo ISO 19650 standards
   ============================================ */

/* CDE Zone Pill - dùng cho zone column */
.cde-zone-pill {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  color: #ffffff;
  flex-shrink: 0;
}

.cde-zone-pill--wip { background: var(--cde-wip, #b86e00); }
.cde-zone-pill--shared { background: var(--cde-shared, #1460b8); }
.cde-zone-pill--publish { background: var(--cde-publish, #157a35); }
.cde-zone-pill--archive { background: var(--cde-archive, #6530b0); }

/* CDE Status Chip - dùng cho review status column */
.cde-chip {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}

.cde-chip--s0 { background: #f4f4f4; border-color: #cccccc; color: #888888; }
.cde-chip--s1 { background: var(--cde-shared-bg, #eef5ff); border-color: var(--cde-shared-border, #a8c8f8); color: var(--cde-shared, #1460b8); }
.cde-chip--s2 { background: #e8f2ff; border-color: #99c0f0; color: #1460b8; }
.cde-chip--s3 { background: #deeeff; border-color: #88b8f0; color: #0e4fa0; }
.cde-chip--s4 { background: #fff0ee; border-color: #f0b0a8; color: var(--cde-red, #c0392b); }
.cde-chip--a1 { background: var(--cde-publish-bg, #eefaf3); border-color: var(--cde-publish-border, #7ecfa0); color: var(--cde-publish, #157a35); }
.cde-chip--b1 { background: var(--cde-wip-bg, #fff8ec); border-color: var(--cde-wip-border, #f5d080); color: var(--cde-wip, #b86e00); }
.cde-chip--none { display: none; }

/* CDE Review Status */
.cde-review {
  font-size: var(--font-size-xs, 11px);
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid;
  white-space: nowrap;
}

.cde-review--none { color: var(--cde-muted2, #c4c9d4); border-color: var(--cde-muted2, #c4c9d4); background: transparent; }
.cde-review--approved { color: var(--cde-publish, #157a35); border-color: var(--cde-publish-border, #7ecfa0); background: var(--cde-publish-bg, #eefaf3); }
.cde-review--pending { color: var(--cde-wip, #b86e00); border-color: var(--cde-wip-border, #f5d080); background: var(--cde-wip-bg, #fff8ec); }
.cde-review--rejected { color: var(--cde-red, #c0392b); border-color: #f0b0a8; background: #fff0ee; }

/* CDE Permission Chip */
.cde-perm {
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.cde-perm--full { background: #e8faf0; border-color: #7ecfa0; color: var(--cde-publish, #157a35); }
.cde-perm--edit { background: var(--cde-shared-bg, #eef5ff); border-color: var(--cde-shared-border, #a8c8f8); color: var(--cde-shared, #1460b8); }
.cde-perm--view { background: var(--cde-s2, #f7f8fa); border-color: var(--cde-border2, #cdd1d8); color: var(--cde-text2, #4b5263); }
.cde-perm--approve { background: var(--cde-wip-bg, #fff8ec); border-color: var(--cde-wip-border, #f5d080); color: var(--cde-wip, #b86e00); }
.cde-perm--none { background: #fff0ee; border-color: #f0b0a8; color: var(--cde-red, #c0392b); }
.cde-perm--upload { background: var(--cde-archive-bg, #f4eeff); border-color: var(--cde-archive-border, #c0a0e8); color: var(--cde-archive, #6530b0); }

/* CDE Version Dot */
.cde-version-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family-mono);
  font-size: var(--font-size-xs, 11px);
  font-weight: 700;
}

.cde-version-dot--past { border-color: var(--cde-border2, #cdd1d8); color: var(--cde-muted, #8c94a3); background: var(--cde-s2, #f7f8fa); }
.cde-version-dot--current { border-color: var(--cde-shared, #1460b8); color: var(--cde-shared, #1460b8); background: var(--cde-shared-bg, #eef5ff); }
.cde-version-dot--final { border-color: var(--cde-publish, #157a35); color: var(--cde-publish, #157a35); background: var(--cde-publish-bg, #eefaf3); }

/* ============================================
   SECTION LAYOUT - Design System
   ============================================ */

/* Section Container */
.section {
  display: none;
  height: 100%;
  overflow: hidden;
}

.section.active {
  display: flex;
  flex-direction: column;
}

/* Section Tabs */
.section-tabs {
  display: flex;
  gap: var(--space-1, 4px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: var(--bg-surface, #ffffff);
  border-bottom: 1px solid var(--cde-border, #e1e4e8);
}

.section-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
  padding: var(--space-2, 8px) var(--space-4, 16px);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-md, 14px);
  font-weight: 500;
  color: var(--cde-text2, #4b5263);
  background: transparent;
  border: none;
  border-radius: var(--radius-md, 6px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.section-tab:hover {
  background: var(--cde-s2, #f7f8fa);
  color: var(--cde-text1, #24272e);
}

.section-tab.active {
  background: var(--cde-blue, #1460b8);
  color: #ffffff;
}

.section-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-tab-icon svg {
  width: 16px;
  height: 16px;
}

/* Section Filters */
.section-filters {
  display: flex;
  align-items: center;
  gap: var(--space-3, 12px);
  padding: var(--space-3, 12px) var(--space-4, 16px);
  background: var(--bg-surface, #ffffff);
  border-bottom: 1px solid var(--cde-border, #e1e4e8);
  flex-wrap: wrap;
}

.section-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 280px;
}

.section-search-icon {
  position: absolute;
  left: var(--space-3, 12px);
  color: var(--cde-muted, #8c94a3);
  pointer-events: none;
}

.section-search-icon svg {
  width: 16px;
  height: 16px;
}

.section-search-input {
  width: 100%;
  padding: var(--space-2, 8px) var(--space-3, 12px);
  padding-left: 36px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-md, 14px);
  color: var(--cde-text1, #24272e);
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--cde-border, #e1e4e8);
  border-radius: var(--radius-md, 6px);
  outline: none;
  transition: border-color var(--transition-fast, 0.15s ease);
}

.section-search-input:focus {
  border-color: var(--cde-blue, #1460b8);
  box-shadow: 0 0 0 3px rgba(20, 96, 184, 0.1);
}

.section-search-input::placeholder {
  color: var(--cde-muted, #8c94a3);
}

.section-filter-buttons {
  display: flex;
  gap: var(--space-2, 8px);
}

.section-filter-btn {
  padding: var(--space-2, 8px) var(--space-3, 12px);
  font-family: var(--font-family-primary);
  font-size: var(--font-size-sm, 13px);
  font-weight: 500;
  color: var(--cde-text2, #4b5263);
  background: var(--cde-s2, #f7f8fa);
  border: 1px solid var(--cde-border2, #cdd1d8);
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s ease);
}

.section-filter-btn:hover {
  background: var(--cde-s3, #edeef1);
}

.section-filter-btn.active {
  background: var(--cde-blue, #1460b8);
  color: #ffffff;
  border-color: var(--cde-blue, #1460b8);
}

.section-actions {
  display: flex;
  gap: var(--space-2, 8px);
  margin-left: auto;
}

.section-action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2, 8px);
}

.section-action-icon {
  display: flex;
  align-items: center;
}

.section-action-icon svg {
  width: 14px;
  height: 14px;
}

/* Summary Cards */
.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4, 16px);
  padding: var(--space-4, 16px);
  background: var(--bg-surface, #ffffff);
}

.summary-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-4, 16px);
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--cde-border, #e1e4e8);
  border-radius: var(--radius-lg, 8px);
  transition: box-shadow var(--transition-fast, 0.15s ease);
}

.summary-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-card--success .summary-card-value { color: var(--cde-publish, #157a35); }
.summary-card--warning .summary-card-value { color: var(--cde-wip, #b86e00); }
.summary-card--danger .summary-card-value { color: var(--cde-red, #c0392b); }
.summary-card--info .summary-card-value { color: var(--cde-blue, #1460b8); }

.summary-card-title {
  font-size: var(--font-size-sm, 13px);
  font-weight: 500;
  color: var(--cde-text2, #4b5263);
  margin-bottom: var(--space-2, 8px);
}

.summary-card-value {
  font-size: var(--font-size-2xl, 24px);
  font-weight: 700;
  color: var(--cde-text1, #24272e);
  line-height: 1.2;
}

.summary-card-subtitle {
  font-size: var(--font-size-xs, 11px);
  color: var(--cde-muted, #8c94a3);
  margin-top: var(--space-1, 4px);
}

/* Section Content */
.section-content {
  flex: 1;
  overflow: auto;
  padding: var(--space-4, 16px);
}

.section-content--table {
  padding: 0;
}

.section-content--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4, 16px);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5, 32px);
  text-align: center;
  min-height: 200px;
}

.empty-state-icon {
  margin-bottom: var(--space-4, 16px);
  color: var(--cde-muted, #8c94a3);
}

.empty-state-icon svg {
  width: 48px;
  height: 48px;
}

.empty-state-title {
  font-size: var(--font-size-lg, 16px);
  font-weight: 600;
  color: var(--cde-text1, #24272e);
  margin-bottom: var(--space-2, 8px);
}

.empty-state-description {
  font-size: var(--font-size-md, 14px);
  color: var(--cde-text2, #4b5263);
  margin-bottom: var(--space-4, 16px);
}

.empty-state-action {
  margin-top: var(--space-2, 8px);
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-5, 32px);
  min-height: 150px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--cde-border2, #cdd1d8);
  border-top-color: var(--cde-blue, #1460b8);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-message {
  margin-top: var(--space-3, 12px);
  font-size: var(--font-size-md, 14px);
  color: var(--cde-text2, #4b5263);
}

