:root {
  --bg: #f7f7f8;
  --card: #fff;
  --accent: #111;
  --muted: #6b7280;
  --sidebar: #18181b;
  --sidebar-text: #fff;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: #111;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Responsive Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 20px;
}

.sidebar {
  background: var(--sidebar);
  color: var(--sidebar-text);
  width: 230px;
  padding: 32px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex-shrink: 0; /* Prevent shrinking */
}

.sidebar .logo {
  font-size: 22px;
  font-weight: 700;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar nav a {
  color: var(--sidebar-text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 16px;
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.sidebar nav a.active,
.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.main {
  flex: 1;
  padding: 30px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-y: auto;
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user span.avatar {
  background: #eee;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.actions-bar {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.secondary {
  background: #e2e8f0;
}
.btn.danger {
  background: #ef4444;
  color: #fff;
}

.upcoming {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.upcoming h3 {
  margin-top: 0;
  font-size: 18px;
}

.upcoming p {
  margin: 6px 0;
  font-size: 15px;
  color: var(--muted);
}

.widgets {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.widget {
  background: var(--card);
  padding: 22px 24px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  flex: 1;
  min-width: 200px;
  cursor: pointer;
  transition: transform 0.2s;
}
.widget:hover {
  transform: translateY(-2px);
}
.widget .label {
  color: var(--muted);
}
.widget .value {
  font-size: 26px;
  font-weight: 700;
}

.recent,
.activity {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.recent table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.recent th,
.recent td {
  padding: 8px;
  text-align: left;
}
.recent th {
  color: var(--muted);
  border-bottom: 1px solid #eee;
}

.status {
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}
.status.completed {
  background: #d1fae5;
  color: #065f46;
}
.status.upcoming {
  background: #fef9c3;
  color: #92400e;
}
.status.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.tier {
  background: gold;
  color: #111;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.page-hidden {
  display: none;
}

/* Services page */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--card);
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
  overflow: hidden;
}

.service-card:hover {
  transform: translateY(-2px);
}
.service-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.service-card-content {
  padding: 20px;
}
.service-card h4 {
  margin-top: 0;
  margin-bottom: 8px;
}
.service-card .price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-top: 12px;
}
.service-card .duration {
  color: var(--muted);
  font-size: 14px;
}

/* Profile page */
.profile-section {
  background: var(--card);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* Book appointment */
.barber-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.barber-card {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.barber-card:hover,
.barber-card.selected {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.barber-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #eee;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.time-slot {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.time-slot:hover,
.time-slot.selected {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Help page */
.faq-item {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
}

.faq-item h4 {
  margin: 0 0 10px 0;
}

.faq-answer {
  display: none;
  color: var(--muted);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

ul {
  line-height: 1.8;
}

/* Notifications */
.notification-badge {
  background: #ef4444;
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 8px;
  font-weight: 700;
}

.notification-panel {
  background: var(--card);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.notification-item {
  padding: 12px;
  border-left: 3px solid #3b82f6;
  background: #eff6ff;
  margin-bottom: 10px;
  border-radius: 4px;
}

.notification-item.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.notification-item.success {
  border-left-color: #10b981;
  background: #f0fdf4;
}

/* Stats cards enhancement */
.stat-trend {
  font-size: 12px;
  color: #10b981;
  font-weight: 600;
}

.stat-trend.down {
  color: #ef4444;
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.quick-action-btn {
  background: var(--card);
  padding: 16px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.quick-action-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.quick-action-btn .icon {
  font-size: 28px;
  margin-bottom: 8px;
}

/* Payment history */
.payment-method {
  background: #f3f4f6;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.payment-method.primary {
  background: #dbeafe;
  border: 2px solid #3b82f6;
}

/* Rewards progress */
.progress-bar {
  width: 100%;
  height: 12px;
  background: #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.3s;
}

/* Review stars */
.star-rating {
  color: #fbbf24;
  font-size: 18px;
}

/* Appointment reminder */
.reminder-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
}

.reminder-card h3 {
  margin-top: 0;
  color: white;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    padding: 20px;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
  }

  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 5px; /* Space for scrollbar */
    gap: 10px;
    flex: 1;
    margin-left: 20px;
  }
  
  .sidebar nav a {
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 14px;
  }

  .sidebar .logo {
    font-size: 18px;
    min-width: fit-content;
  }
  
  .sidebar script {
    display: none;
  }

  .main {
    padding: 16px;
    width: 100%; /* Ensure main takes full width */
  }

  /* Admin Header Stacking */
  .recent > div:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .recent h3 {
    margin: 0;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* New Tablet Breakpoint */
@media (max-width: 1024px) {
  .main {
    padding: 24px;
  }
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.3s ease;

  /* Hide scrollbar */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.modal-content::-webkit-scrollbar {
  display: none;
}

/* TOAST NOTIFICATIONS */
#toastContainer {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  width: 350px;
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: relative;
  overflow: hidden;
}

.toast.show {
  transform: translateX(0);
}
.toast.hide {
  transform: translateX(120%);
}

.toast-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}
.toast-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
}
.toast-message {
  font-size: 13px;
  color: #666;
}
.toast-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #999;
}

.toast.success .toast-icon {
  background: #e0fdf4;
  color: #10b981;
}
.toast.error .toast-icon {
  background: #fef2f2;
  color: #ef4444;
}
.toast.warning .toast-icon {
  background: #fffbeb;
  color: #f59e0b;
}
.toast.info .toast-icon {
  background: #eff6ff;
  color: #3b82f6;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: rgba(0, 0, 0, 0.05);
}

.toast-progress::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: currentColor;
  animation: progress 4s linear forwards;
}

.toast.success .toast-progress::after {
  background: #10b981;
}
.toast.error .toast-progress::after {
  background: #ef4444;
}
.toast.warning .toast-progress::after {
  background: #f59e0b;
}
.toast.info .toast-progress::after {
  background: #3b82f6;
}

@keyframes progress {
  100% {
    width: 0;
  }
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

/* ===================================
   ULTRA-MODERN MINIMALIST PAGINATION
   Inspired by Linear, Stripe, Vercel
   =================================== */

#barbers-pagination {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  padding: 32px 0 24px;
  margin-top: 8px;
}

.pagination-info {
  font-size: 12px;
  color: #71717a;
  font-weight: 500;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.pagination-controls {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-btn {
  padding: 0;
  border: 1.5px solid #e4e4e7;
  background: #ffffff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #18181b;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.pagination-btn:hover:not(:disabled):not(.active) {
  background: #fafafa;
  border-color: #d4d4d8;
  transform: none;
}

.pagination-btn:active:not(:disabled) {
  background: #f4f4f5;
  transform: scale(0.98);
}

.pagination-btn.active {
  background: #18181b;
  color: #ffffff;
  border-color: #18181b;
  font-weight: 600;
  box-shadow: 0 0 0 4px rgba(24, 24, 27, 0.08);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background: #ffffff;
  color: #a1a1aa;
  border-color: #e4e4e7;
}

.pagination-ellipsis {
  padding: 0 4px;
  color: #a1a1aa;
  font-size: 16px;
  font-weight: 600;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 36px;
}

/* Responsive */
@media (max-width: 640px) {
  #barbers-pagination {
    padding: 24px 0 16px;
  }
  
  .pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: 12px;
  }
  
  .pagination-ellipsis {
    height: 32px;
    font-size: 14px;
  }
  
  .pagination-info {
    font-size: 11px;
  }
}

