/* ===== Design Tokens ===== */
:root {
  /* Brand Colors */
  --color-primary-50: #EFF6FF;
  --color-primary-100: #DBEAFE;
  --color-primary-200: #BFDBFE;
  --color-primary-300: #93C5FD;
  --color-primary-400: #60A5FA;
  --color-primary-500: #3B82F6;
  --color-primary-600: #2563EB;
  --color-primary-700: #1D4ED8;
  --color-primary-800: #1E40AF;
  --color-primary-900: #1E3A8A;

  /* Neutral / Gray Scale */
  --color-gray-50: #F8FAFC;
  --color-gray-100: #F1F5F9;
  --color-gray-200: #E2E8F0;
  --color-gray-300: #CBD5E1;
  --color-gray-400: #94A3B8;
  --color-gray-500: #64748B;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1E293B;
  --color-gray-900: #0F172A;

  /* Status Colors */
  --state-success: #10B981;
  --state-success-light: #ECFDF5;
  --state-warning: #F59E0B;
  --state-warning-light: #FFFBEB;
  --state-error: #EF4444;
  --state-error-light: #FEF2F2;
  --state-info: #3B82F6;
  --state-info-light: #EFF6FF;

  /* Sidebar */
  --sidebar-bg: #1E293B;
  --sidebar-text: #CBD5E1;
  --sidebar-hover: #334155;
  --sidebar-active: #2563EB;
  --sidebar-active-text: #FFFFFF;
  --sidebar-width: 240px;

  /* Layout */
  --bg-page: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-header: #FFFFFF;
  --border: #E2E8F0;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 12px;
  --border-radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 40px;
  --space-3xl: 48px;
}

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

html, body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-gray-900);
  background-color: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ===== Admin Layout ===== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  overflow-y: auto;
  transition: width 0.3s ease, min-width 0.3s ease;
}

.admin-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.admin-header {
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-lg);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.admin-content {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

/* ===== Sidebar Components ===== */
.sidebar-logo {
  padding: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 64px;
}

.sidebar-logo svg, .sidebar-logo img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.sidebar-logo span {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: #FFFFFF;
  white-space: nowrap;
  transition: opacity 0.3s ease;
}

.sidebar-nav {
  padding: var(--space-sm) 0;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px var(--space-lg);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: #FFFFFF;
}

.sidebar-nav-item.active {
  background: rgba(37, 99, 235, 0.15);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active);
}

.sidebar-nav-item .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.sidebar-nav-item.active .nav-icon {
  opacity: 1;
}

.sidebar-nav-item span {
  transition: opacity 0.3s ease;
}

.sidebar-nav-label {
  padding: 8px var(--space-lg) 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gray-400);
  font-weight: var(--font-semibold);
  transition: opacity 0.3s ease;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ===== Page Header ===== */
.page-header {
  margin-bottom: var(--space-lg);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-gray-900);
  margin: 0 0 var(--space-xs) 0;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin: 0;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card:has(.table-container) {
  overflow: hidden;
}

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

.card-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-gray-900);
  margin: 0;
}

/* ===== Stat Cards ===== */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

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

.stat-card .stat-label {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  margin: 0 0 var(--space-xs) 0;
}

.stat-card .stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-gray-900);
  margin: 0;
}

.stat-card .stat-change {
  font-size: var(--text-xs);
  margin-top: var(--space-xs);
}

.stat-card .stat-change.up { color: var(--state-success); }
.stat-card .stat-change.down { color: var(--state-error); }

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

.card:has(> .table-container) {
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table-container table {
  table-layout: fixed;
}

.table-container td.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

thead th {
  background: var(--color-gray-50);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 12px var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  border-bottom: 1px solid var(--color-gray-100);
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: var(--color-gray-50);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-primary-600);
  color: #FFFFFF;
  border-color: var(--color-primary-600);
}

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

.btn-secondary {
  background: var(--bg-card);
  color: var(--color-gray-700);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

.btn-ghost {
  background: transparent;
  color: var(--color-gray-600);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--color-gray-100);
}

.btn-danger {
  background: var(--state-error);
  color: #FFFFFF;
  border-color: var(--state-error);
}

.btn-danger:hover {
  background: #DC2626;
  border-color: #DC2626;
}

.btn-sm {
  padding: 4px 10px;
  font-size: var(--text-xs);
}

.btn-lg {
  padding: 12px 24px;
  font-size: var(--text-base);
}

/* ===== Status Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--border-radius-full);
  white-space: nowrap;
}

.badge-success {
  background: var(--state-success-light);
  color: #059669;
}

.badge-warning {
  background: var(--state-warning-light);
  color: #D97706;
}

.badge-error {
  background: var(--state-error-light);
  color: #DC2626;
}

.badge-info {
  background: var(--state-info-light);
  color: var(--color-primary-700);
}

.badge-neutral {
  background: var(--color-gray-100);
  color: var(--color-gray-600);
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-gray-700);
  margin-bottom: var(--space-xs);
}

.form-input, .form-select {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-gray-900);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
}

.form-input:focus, .form-select:focus {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
  color: var(--color-gray-400);
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--color-gray-50);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  padding: 6px 12px;
  width: 320px;
  transition: all 0.15s ease;
}

.search-bar:focus-within {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: var(--bg-card);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--color-gray-900);
  min-width: 0;
}

.search-bar input::placeholder {
  color: var(--color-gray-400);
}

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.filter-select {
  padding: 6px 10px;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  color: var(--color-gray-700);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.filter-select:focus {
  border-color: var(--color-primary-400);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

.pagination-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.pagination-actions button {
  padding: 6px 12px;
  font-size: var(--text-sm);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  color: var(--color-gray-700);
  cursor: pointer;
  transition: all 0.15s ease;
}

.pagination-actions button:hover:not(:disabled) {
  background: var(--color-gray-50);
}

.pagination-actions button.active {
  background: var(--color-primary-600);
  color: #FFFFFF;
  border-color: var(--color-primary-600);
}

.pagination-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-gray-500);
}

.breadcrumb a {
  color: var(--color-gray-500);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.breadcrumb .separator {
  color: var(--color-gray-300);
}

.breadcrumb .current {
  color: var(--color-gray-900);
  font-weight: var(--font-medium);
}

/* ===== Header Actions ===== */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  border: none;
  background: transparent;
  color: var(--color-gray-500);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease;
}

.header-btn:hover {
  background: var(--color-gray-100);
}

.header-btn .badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--state-error);
  border-radius: 50%;
  border: 2px solid white;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary-600);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background 0.15s ease;
}

.admin-avatar:hover {
  background: var(--color-primary-700);
}

/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===== Grid ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* ===== Chart Placeholder ===== */
.chart-placeholder {
  width: 100%;
  height: 240px;
  background: linear-gradient(180deg, var(--color-primary-50) 0%, var(--color-gray-50) 100%);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-400);
  font-size: var(--text-sm);
  border: 1px dashed var(--color-gray-300);
}

.chart-placeholder.small {
  height: 100px;
}

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
}

.login-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  padding: var(--space-3xl);
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.login-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  text-align: center;
  margin: 0 0 var(--space-xs) 0;
  color: var(--color-gray-900);
}

.login-subtitle {
  font-size: var(--text-sm);
  color: var(--color-gray-500);
  text-align: center;
  margin: 0 0 var(--space-xl) 0;
}

.input-wrapper {
  position: relative;
}

.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-gray-400);
  pointer-events: none;
}

.form-input.with-icon {
  padding-left: 36px;
}

.login-footer {
  text-align: center;
  margin-top: var(--space-xl);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

/* ===== Review Card ===== */
.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.review-meta {
  font-size: var(--text-xs);
  color: var(--color-gray-500);
}

.review-actions {
  display: flex;
  gap: var(--space-xs);
  flex-shrink: 0;
}

/* ===== Book Cover Placeholder ===== */
.book-cover-placeholder {
  width: 60px;
  height: 80px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.book-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.book-title-text {
  color: var(--color-gray-700);
}

.action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

/* ===== Tag List ===== */
.tag-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag-item {
  display: inline-flex;
  padding: 1px 8px;
  font-size: 11px;
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-radius: var(--border-radius-full);
}

/* ===== User Avatar ===== */
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

/* ===== Quick Action Card ===== */
.quick-action-card {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

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

.quick-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ===== Activity Item ===== */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

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

/* ===== Ranking Item ===== */
.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

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

.ranking-num {
  width: 20px;
  height: 20px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

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

.modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  color: var(--color-gray-500);
  transition: background 0.15s ease;
}

.modal-close:hover {
  background: var(--color-gray-100);
}

.modal-body {
  padding: var(--space-lg);
}

.modal-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--border-radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: slideIn 0.3s ease;
}

.toast-success {
  border-left: 4px solid var(--state-success);
}

.toast-error {
  border-left: 4px solid var(--state-error);
}

.toast-warning {
  border-left: 4px solid var(--state-warning);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: var(--space-3xl);
  color: var(--color-gray-500);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

/* ===== Mobile Menu Button ===== */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  color: var(--color-gray-700);
}

.mobile-menu-btn:hover {
  background: var(--color-gray-100);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .admin-sidebar {
    width: 64px;
    min-width: 64px;
    transform: translateX(-100%);
  }
  
  .admin-sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-logo span,
  .sidebar-nav-item span,
  .sidebar-nav-label {
    display: none;
  }
  
  .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
  }
  
  .admin-main {
    margin-left: 0;
  }
  
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .search-bar {
    width: 100%;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  
  .toolbar-left, .toolbar-right {
    width: 100%;
  }
  
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }
  
  .pagination-actions {
    justify-content: center;
  }
  
  .admin-header {
    padding: 0 var(--space-md);
  }
  
  .admin-content {
    padding: var(--space-md);
  }
}

/* ===== Overlay for mobile sidebar ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 49;
}

.sidebar-overlay.active {
  display: block;
}

/* ===== Form Row ===== */
.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Avatar Sizes ===== */
.avatar-sm {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.avatar-md {
  width: 32px;
  height: 32px;
  font-size: var(--text-xs);
}

.avatar-lg {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

/* ===== Checkbox ===== */
.checkbox {
  width: 16px;
  height: 16px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border);
  accent-color: var(--color-primary-600);
  cursor: pointer;
}

/* ===== Table checkbox ===== */
.table-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary-600);
}

/* ===== Text utilities ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }

.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }

.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }
.text-gray-900 { color: var(--color-gray-900); }
.text-primary { color: var(--color-primary-600); }

/* ===== Flex utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ===== Margin/Padding utilities ===== */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ===== Width utilities ===== */
.w-full { width: 100%; }

/* ===== Hide/Show ===== */
.hidden { display: none; }

/* ===== Loading spinner ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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