/* ================================================
   S.M. HOSPITAL — Admin Dashboard Stylesheet
   Premium Dark Theme Design
   ================================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  /* Primary Palette */
  --navy: #0a1f44;
  --navy-dark: #061430;
  --royal-blue: #1a4fa0;
  --royal-blue-light: #2563c4;
  --teal: #0d9488;
  --teal-light: #14b8a6;
  --teal-dark: #0a7a70;

  /* Accent */
  --gold: #c8a84e;
  --gold-light: #d4b85c;
  --gold-dark: #b5963e;

  /* Dark Theme */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-sidebar: #0f1629;
  --bg-input: #1a2236;
  --bg-input-focus: #1f2a42;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #c8a84e;

  /* Borders */
  --border-primary: rgba(255, 255, 255, 0.06);
  --border-secondary: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(200, 168, 78, 0.5);

  /* Status Colors */
  --status-pending: #f59e0b;
  --status-pending-bg: rgba(245, 158, 11, 0.1);
  --status-confirmed: #3b82f6;
  --status-confirmed-bg: rgba(59, 130, 246, 0.1);
  --status-completed: #10b981;
  --status-completed-bg: rgba(16, 185, 129, 0.1);
  --status-cancelled: #ef4444;
  --status-cancelled-bg: rgba(239, 68, 68, 0.1);

  /* Functional */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.4);
  --shadow-gold: 0 4px 20px rgba(200, 168, 78, 0.15);
  --shadow-glow: 0 0 40px rgba(200, 168, 78, 0.1);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 60px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ================================================
   LOGIN SCREEN
   ================================================ */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  padding: 24px;
}

.login-bg-pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(200, 168, 78, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(26, 79, 160, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(13, 148, 136, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  animation: loginFadeIn 0.6s ease-out;
}

@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--border-secondary);
  box-shadow: var(--shadow-gold);
}

.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.login-form {
  text-align: left;
}

.login-field label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-field label svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  width: 100%;
  padding: 14px 48px 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: var(--font-primary);
  transition: var(--transition-base);
  outline: none;
}

.password-wrapper input:focus {
  border-color: var(--gold);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.1);
}

.password-wrapper input::placeholder {
  color: var(--text-muted);
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
}

.toggle-password:hover {
  color: var(--text-secondary);
}

.toggle-password svg {
  width: 20px;
  height: 20px;
}

.login-error {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--status-cancelled-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.8125rem;
  font-weight: 500;
  animation: shakeError 0.5s ease;
}

.login-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.login-error.show {
  display: flex;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-dark);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--shadow-gold);
}

.login-btn svg {
  width: 20px;
  height: 20px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(200, 168, 78, 0.3);
}

.login-btn:active {
  transform: translateY(0);
}

.login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
}

.login-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: var(--transition-fast);
}

.login-footer a:hover {
  color: var(--gold);
}

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

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition-base);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-secondary);
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  position: relative;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-primary);
  text-align: left;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: linear-gradient(135deg, rgba(200, 168, 78, 0.1), rgba(200, 168, 78, 0.05));
  color: var(--gold);
  border: 1px solid rgba(200, 168, 78, 0.15);
}

.sidebar-link.active svg {
  color: var(--gold);
}

.sidebar-badge {
  margin-left: auto;
  padding: 2px 8px;
  background: var(--status-pending);
  color: var(--navy-dark);
  font-size: 0.6875rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  min-width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logout-btn {
  color: var(--status-cancelled) !important;
}

.logout-btn:hover {
  background: var(--status-cancelled-bg) !important;
}

/* ---- Mobile Header ---- */
.mobile-admin-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-primary);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  z-index: 99;
}

.mobile-sidebar-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.mobile-sidebar-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.mobile-admin-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-admin-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.mobile-admin-brand span {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.mobile-logout-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.mobile-logout-btn:hover {
  color: var(--error);
  background: var(--status-cancelled-bg);
}

.mobile-logout-btn svg {
  width: 20px;
  height: 20px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
}

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

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

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
  animation: fadeInSection 0.3s ease-out;
}

@keyframes fadeInSection {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-page-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.admin-page-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.admin-page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn-refresh, .btn-export {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-base);
  border: 1px solid var(--border-secondary);
  background: var(--bg-card);
  color: var(--text-secondary);
}

.btn-refresh svg, .btn-export svg {
  width: 16px;
  height: 16px;
}

.btn-refresh:hover, .btn-export:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.btn-refresh.spinning svg {
  animation: spin 1s linear infinite;
}

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

.btn-link {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: var(--transition-fast);
}

.btn-link:hover {
  color: var(--gold-light);
}

/* ================================================
   STATS CARDS
   ================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 0 4px 4px 0;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.stat-card-icon svg {
  width: 22px;
  height: 22px;
}

.stat-card-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-top: 2px;
}

/* Stat card color variants */
.stat-total::before { background: var(--gold); }
.stat-total .stat-card-icon { background: rgba(200, 168, 78, 0.1); color: var(--gold); }
.stat-total .stat-value { color: var(--gold); }

.stat-pending::before { background: var(--status-pending); }
.stat-pending .stat-card-icon { background: var(--status-pending-bg); color: var(--status-pending); }
.stat-pending .stat-value { color: var(--status-pending); }

.stat-confirmed::before { background: var(--status-confirmed); }
.stat-confirmed .stat-card-icon { background: var(--status-confirmed-bg); color: var(--status-confirmed); }
.stat-confirmed .stat-value { color: var(--status-confirmed); }

.stat-completed::before { background: var(--status-completed); }
.stat-completed .stat-card-icon { background: var(--status-completed-bg); color: var(--status-completed); }
.stat-completed .stat-value { color: var(--status-completed); }

.stat-cancelled::before { background: var(--status-cancelled); }
.stat-cancelled .stat-card-icon { background: var(--status-cancelled-bg); color: var(--status-cancelled); }
.stat-cancelled .stat-value { color: var(--status-cancelled); }

.stat-today::before { background: var(--teal); }
.stat-today .stat-card-icon { background: rgba(13, 148, 136, 0.1); color: var(--teal-light); }
.stat-today .stat-value { color: var(--teal-light); }

/* ================================================
   DASHBOARD CARD / TABLE
   ================================================ */
.dashboard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dashboard-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-primary);
}

.dashboard-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.admin-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-primary);
  white-space: nowrap;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-primary);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: var(--transition-fast);
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.th-check {
  width: 44px;
  text-align: center !important;
}

.th-check input, .admin-table td input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--gold);
}

/* Table Loading */
.loading-row td {
  padding: 48px 16px !important;
  text-align: center;
}

.table-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-secondary);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---- Status Badge ---- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.status-pending::before { background: var(--status-pending); }

.status-confirmed {
  background: var(--status-confirmed-bg);
  color: var(--status-confirmed);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.status-confirmed::before { background: var(--status-confirmed); }

.status-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-completed::before { background: var(--status-completed); }

.status-cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
  border: 1px solid rgba(239, 68, 68, 0.2);
}
.status-cancelled::before { background: var(--status-cancelled); }

/* ---- Action Buttons (Table) ---- */
.action-btns {
  display: flex;
  gap: 6px;
  align-items: center;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.action-btn svg {
  width: 15px;
  height: 15px;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.action-btn.view-btn:hover { color: var(--gold); border-color: rgba(200, 168, 78, 0.3); }
.action-btn.confirm-btn:hover { color: var(--status-confirmed); border-color: rgba(59, 130, 246, 0.3); }
.action-btn.complete-btn:hover { color: var(--status-completed); border-color: rgba(16, 185, 129, 0.3); }
.action-btn.cancel-btn:hover { color: var(--status-cancelled); border-color: rgba(239, 68, 68, 0.3); }
.action-btn.delete-btn:hover { color: var(--error); background: var(--status-cancelled-bg); border-color: rgba(239, 68, 68, 0.3); }

.action-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.6875rem;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
  border: 1px solid var(--border-secondary);
}

.action-btn:hover[title]::after {
  opacity: 1;
}

/* Text Truncate */
.text-truncate {
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-muted {
  color: var(--text-muted);
  font-style: italic;
}

/* ================================================
   FILTERS BAR
   ================================================ */
.filters-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.1);
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-group select,
.filter-group input[type="date"] {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-base);
  outline: none;
  min-width: 140px;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.1);
}

.filter-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ================================================
   BULK ACTIONS
   ================================================ */
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(200, 168, 78, 0.04);
  border-top: 1px solid var(--border-primary);
  animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.bulk-count {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-right: 8px;
}

.bulk-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid var(--border-secondary);
  background: transparent;
  color: var(--text-secondary);
}

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

.bulk-btn:hover {
  background: rgba(255, 255, 255, 0.04);
}

.bulk-confirm:hover { color: var(--status-confirmed); border-color: rgba(59, 130, 246, 0.3); }
.bulk-complete:hover { color: var(--status-completed); border-color: rgba(16, 185, 129, 0.3); }
.bulk-cancel:hover { color: var(--status-cancelled); border-color: rgba(239, 68, 68, 0.3); }
.bulk-delete:hover { color: var(--error); border-color: rgba(239, 68, 68, 0.3); background: var(--status-cancelled-bg); }

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state svg {
  width: 56px;
  height: 56px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ================================================
   MODALS
   ================================================ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-card-sm {
  max-width: 420px;
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.modal-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-header-danger h3 {
  color: var(--error);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Modal Detail Rows */
.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-primary);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 140px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.detail-value {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.delete-warning {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Modal Buttons */
.btn-modal {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: var(--transition-base);
  border: 1px solid var(--border-secondary);
}

.btn-modal-cancel {
  background: transparent;
  color: var(--text-secondary);
}

.btn-modal-cancel:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.btn-modal-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--navy-dark);
  border-color: transparent;
}

.btn-modal-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-modal-danger {
  background: var(--error);
  color: white;
  border-color: transparent;
}

.btn-modal-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.btn-modal-confirm {
  background: var(--status-confirmed);
  color: white;
  border-color: transparent;
}

.btn-modal-complete {
  background: var(--status-completed);
  color: white;
  border-color: transparent;
}

.btn-modal-cancel-status {
  background: var(--status-cancelled);
  color: white;
  border-color: transparent;
}

/* ================================================
   TOASTS
   ================================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  animation: toastSlideIn 0.3s ease-out;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.toast-success::before { background: var(--success); }
.toast-error::before { background: var(--error); }
.toast-warning::before { background: var(--warning); }
.toast-info::before { background: var(--info); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--info); }

.toast-message {
  flex: 1;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0 4px;
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .filters-bar {
    flex-direction: column;
  }

  .search-box {
    min-width: 100%;
  }

  .filter-group {
    width: 100%;
  }

  .filter-group select,
  .filter-group input[type="date"] {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .mobile-admin-header {
    display: flex;
  }

  .admin-main {
    margin-left: 0;
    padding: 16px;
    padding-top: calc(var(--header-height) + 16px);
  }

  .admin-page-header {
    flex-direction: column;
    gap: 12px;
  }

  .admin-page-title {
    font-size: 1.375rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .stat-card-icon {
    width: 36px;
    height: 36px;
  }

  .stat-card-icon svg {
    width: 18px;
    height: 18px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .admin-page-actions {
    width: 100%;
  }

  .btn-refresh, .btn-export {
    flex: 1;
    justify-content: center;
  }

  .dashboard-card-header {
    padding: 14px 16px;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  .bulk-actions {
    flex-wrap: wrap;
    padding: 12px 16px;
  }

  .modal-card {
    max-height: 90vh;
  }

  .modal-body {
    padding: 16px;
  }

  .detail-row {
    flex-direction: column;
    gap: 4px;
  }

  .detail-label {
    width: 100%;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: 0;
    max-width: 100%;
  }

  .login-card {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-group {
    flex-direction: column;
  }

  .filter-group select,
  .filter-group input[type="date"] {
    width: 100%;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Selection ---- */
::selection {
  background: rgba(200, 168, 78, 0.25);
  color: var(--text-primary);
}

/* ================================================
   SOCIAL MEDIA SETTINGS
   ================================================ */
.social-media-card {
  max-width: 700px;
}

.social-media-form-wrapper {
  padding: 28px 24px;
}

.social-media-form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.social-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.social-field label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.social-field-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.social-fb-icon {
  color: #1877f2;
}

.social-ig-icon {
  color: #e4405f;
}

.social-field input {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-secondary);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font-primary);
  transition: var(--transition-fast);
  outline: none;
}

.social-field input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(200, 168, 78, 0.1);
}

.social-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.02);
}

/* Action Buttons */
.social-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.btn-social {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: var(--font-primary);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-social svg {
  width: 16px;
  height: 16px;
}

.btn-social-save {
  background: var(--status-completed);
  color: #fff;
}

.btn-social-save:hover {
  background: #0ea271;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-social-edit {
  background: var(--status-confirmed);
  color: #fff;
}

.btn-social-edit:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-social-update {
  background: var(--gold);
  color: #fff;
}

.btn-social-update:hover {
  background: var(--gold-dark);
  box-shadow: var(--shadow-gold);
}

.btn-social-remove {
  background: var(--status-cancelled);
  color: #fff;
}

.btn-social-remove:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-social-cancel {
  background: var(--bg-card-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-secondary);
}

.btn-social-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Status Info */
.social-status-info {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.social-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}

.social-status-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.social-status-label {
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
}

.social-status-value {
  color: var(--text-muted);
  word-break: break-all;
}

.social-status-value.configured {
  color: var(--status-completed);
}

/* Responsive */
@media (max-width: 600px) {
  .social-media-form-wrapper {
    padding: 20px 16px;
  }

  .social-actions {
    flex-direction: column;
  }

  .btn-social {
    width: 100%;
    justify-content: center;
  }
}
