/* ============================================
   詠慈佛像雕刻 - 後台管理樣式
   Admin Dashboard Stylesheet
   ============================================ */

:root {
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-dark: #9a7530;
  --gold-faint: #fdf6e3;
  --dark: #1a1008;
  --dark-2: #2c1f0e;
  --sidebar-w: 240px;
  --header-h: 56px;

  --bg: #f4f6fa;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --purple: #a855f7;
  --purple-bg: #faf5ff;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
  --radius: 10px;
  --transition: 0.22s ease;

  --font: 'Noto Sans TC', sans-serif;
  --font-serif: 'Noto Serif TC', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ===========================
   LOGIN SCREEN
   =========================== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--dark) 0%, var(--dark-2) 100%);
  padding: 24px;
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  text-align: center;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 24px;
}

.logo-icon {
  font-size: 2.4rem;
  color: var(--gold);
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.5));
}

.logo-icon-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 50%;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(201,168,76,0.6));
}

.login-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.2;
}

.login-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.login-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  transition: var(--transition);
}
.login-input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}
.login-input-wrap > i {
  padding: 0 14px;
  color: var(--text-light);
  font-size: 0.9rem;
  flex-shrink: 0;
}
.login-input-wrap input {
  flex: 1;
  padding: 13px 0;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text);
  background: transparent;
}
#togglePwd {
  padding: 0 14px;
  color: var(--text-light);
  font-size: 0.88rem;
  flex-shrink: 0;
  transition: var(--transition);
}
#togglePwd:hover { color: var(--text-muted); }

.login-error {
  background: var(--red-bg);
  color: var(--red);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 0.85rem;
  margin-bottom: 14px;
  text-align: left;
}

.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: var(--dark);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(201,168,76,0.45);
  filter: brightness(1.06);
}

.back-link {
  font-size: 0.84rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.back-link:hover { color: var(--gold-dark); }

/* ===========================
   ADMIN LAYOUT
   =========================== */
.admin-wrap {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  border-right: 1px solid rgba(201,168,76,0.15);
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(201,168,76,0.15);
}

.sidebar-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.2;
}

.sidebar-sub {
  display: block;
  font-size: 0.68rem;
  color: rgba(232,201,122,0.5);
  letter-spacing: 0.08em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: rgba(255,240,200,0.6);
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  background: rgba(201,168,76,0.1);
  color: var(--gold-light);
}
.nav-item.active {
  background: rgba(201,168,76,0.15);
  color: var(--gold-light);
  font-weight: 600;
}
.nav-item i { width: 18px; font-size: 0.95rem; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(201,168,76,0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 0.84rem;
  color: rgba(255,240,200,0.45);
  transition: var(--transition);
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { color: var(--gold-light); background: rgba(201,168,76,0.08); }

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--dark);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 150;
}

.mobile-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--gold-light);
  font-weight: 600;
}

.menu-toggle,
.logout-icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-size: 1rem;
  border-radius: 8px;
  transition: var(--transition);
}
.menu-toggle:hover,
.logout-icon-btn:hover { background: rgba(201,168,76,0.15); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
}

/* Main */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 32px;
  min-height: 100vh;
}

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.page-date {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-refresh {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: var(--transition);
  background: var(--bg-card);
}
.btn-refresh:hover { border-color: var(--gold); color: var(--gold-dark); }
.btn-refresh.spinning i { animation: spin 0.6s linear; }

.btn-export {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.btn-export:hover { border-color: var(--green); color: var(--green); background: var(--green-bg); }

/* ===========================
   STATS CARDS
   =========================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue  { background: var(--blue-bg);   color: var(--blue);   }
.stat-icon.green { background: var(--green-bg);  color: var(--green);  }
.stat-icon.gold  { background: var(--gold-faint); color: var(--gold-dark); }
.stat-icon.red   { background: var(--red-bg);    color: var(--red);    }

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===========================
   DASHBOARD CARDS
   =========================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.dash-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.dash-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-card-title i { color: var(--gold-dark); }

.chart-empty {
  color: var(--text-light);
  font-size: 0.88rem;
  text-align: center;
  padding: 32px 0;
}

/* Service chart bars */
.chart-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.chart-bar-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-bar-track {
  flex: 1;
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
}
.chart-bar-fill {
  height: 100%;
  border-radius: 5px;
  background: linear-gradient(to right, var(--gold-dark), var(--gold-light));
  transition: width 0.8s ease;
}
.chart-bar-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  width: 24px;
  text-align: right;
}

/* Recent list */
.recent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  border-radius: 6px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:hover { background: #f8fafc; padding-left: 6px; }

.recent-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }
.recent-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-service {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.recent-time {
  font-size: 0.75rem;
  color: var(--text-light);
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===========================
   FILTER BAR
   =========================== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.search-wrap {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  transition: var(--transition);
}
.search-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
}
.search-wrap > i { color: var(--text-light); font-size: 0.88rem; flex-shrink: 0; }
.search-wrap input {
  flex: 1;
  padding: 10px 10px;
  border: none;
  outline: none;
  font-size: 0.88rem;
  color: var(--text);
  background: transparent;
}
.search-clear {
  color: var(--text-light);
  font-size: 0.8rem;
  padding: 4px;
  transition: var(--transition);
}
.search-clear:hover { color: var(--red); }

.filter-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--text);
  background: var(--bg-card);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filter-select:focus { border-color: var(--gold); }

.result-summary {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding: 0 2px;
}

/* ===========================
   DATA TABLE
   =========================== */
.table-wrap {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table thead tr {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 13px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

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

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

.data-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
.data-table tbody tr:hover { background: #f8fafc; }

.table-loading,
.table-empty {
  text-align: center;
  padding: 56px 20px !important;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.table-loading i,
.table-empty i { margin-right: 8px; }

.name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.service-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.tag-custom     { background: var(--blue-bg);   color: var(--blue);  }
.tag-temple     { background: var(--gold-faint); color: var(--gold-dark); }
.tag-repair     { background: var(--green-bg);  color: #16a34a; }
.tag-accessory  { background: var(--purple-bg); color: var(--purple); }
.tag-other      { background: #f8fafc;          color: var(--text-muted); }

.msg-preview {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.82rem;
  transition: var(--transition);
  color: var(--text-muted);
}
.action-btn.view  { background: var(--blue-bg); color: var(--blue); }
.action-btn.del   { background: var(--red-bg);  color: var(--red);  }
.action-btn:hover { filter: brightness(0.9); transform: scale(1.08); }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-dark); }
.page-btn.active { background: var(--gold); border-color: var(--gold); color: var(--dark); font-weight: 700; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===========================
   MODAL
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header h3 i { color: var(--gold-dark); }
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close:hover { background: var(--red-bg); color: var(--red); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.modal-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 80px;
  padding-top: 2px;
  flex-shrink: 0;
}
.modal-value {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.6;
}
.modal-message-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-delete-modal {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  background: var(--red-bg);
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 600;
  transition: var(--transition);
}
.btn-delete-modal:hover { background: var(--red); color: #fff; }

.btn-close-modal {
  padding: 9px 24px;
  border-radius: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.btn-close-modal:hover { border-color: var(--text-muted); color: var(--text); }

/* Confirm Modal */
.confirm-card {
  max-width: 380px;
  text-align: center;
  padding: 40px 32px;
}
.confirm-icon {
  font-size: 2.4rem;
  color: var(--red);
  margin-bottom: 16px;
}
.confirm-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 10px;
}
.confirm-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}
.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.btn-cancel {
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: var(--transition);
}
.btn-cancel:hover { border-color: var(--text-muted); }
.btn-confirm-delete {
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
}
.btn-confirm-delete:hover { background: #dc2626; }

/* ===========================
   TOAST
   =========================== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}
.toast.success { background: #16a34a; }
.toast.error   { background: var(--red); }

/* ===========================
   KEYFRAMES
   =========================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open {
    display: block;
  }
  .mobile-header {
    display: flex;
  }
  .admin-main {
    margin-left: 0;
    padding: 80px 16px 24px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat-card { padding: 16px; }
  .stat-num { font-size: 1.5rem; }
  .filter-bar { flex-direction: column; }
  .search-wrap { width: 100%; }
  .filter-select { width: 100%; }
  .modal-footer { flex-direction: column-reverse; }
  .btn-delete-modal,
  .btn-close-modal { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-header h1 { font-size: 1.3rem; }
  .login-card { padding: 32px 24px; }
}
