/* Admin Base Styles */
:root {
  --primary-saturate-color: #968f7f;
  --primary-color: #a19b8b;
  --primary-color-transparent: rgba(161, 155, 139, 0.5);
  --primary-saturate-color-transparent: rgba(150, 143, 127, 0.5);
  --secondary-color: #222;
  --background-color: #F7F7F7;
  --danger-color: #EA5C74;
  --danger-color-saturate: #D2042D;
  --success-color: #4BB543;
  --warning-color: #FF8C00;
  --info-color: #17a2b8;
  --dark-color: #343a40;
  --light-color: #f8f9fa;
  --white: #ffffff;
  --border-color: #e9ecef;
  --text-muted: #6c757d;
  --admin-nav-height: 60px;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
  width: 100%;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  /* border-radius: 4px; */
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-saturate-color);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--background-color);
  color: var(--secondary-color);
  line-height: 1.6;
  min-height: 100vh;
  padding-top: var(--admin-nav-height);
}

/* Admin Navigation */
.admin-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--admin-nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo svg {
  width: 35px;
  height: 35px;
  fill: var(--primary-color);
}

.nav-title {
  font-family: "Fredericka the Great", cursive;
  font-size: clamp(0.8rem, 1vw + 0.5rem, 1.8rem);
  color: var(--primary-saturate-color);
  font-weight: bold;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.5rem;
}

.nav-menu li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--secondary-color);
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-menu li a:hover {
  background: var(--primary-color-transparent);
  color: var(--primary-saturate-color);
}

.nav-menu li a.active {
  background: var(--primary-color);
  color: var(--white);
}

.nav-menu li a.logout {
  color: var(--danger-color);
}

.nav-menu li a.logout:hover {
  background: rgba(234, 92, 116, 0.1);
  color: var(--danger-color-saturate);
}

.nav-menu svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

/* Main Layout */
.admin-container {
  min-height: calc(100vh - var(--admin-nav-height));
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

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

/* Cards */
.card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.card-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.card-body {
  padding: 0;
}

/* Grid System */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: -1rem;
}

.col {
  flex: 1;
  padding: 1rem;
}

.col-2 {
  flex: 0 0 calc(50% - 2rem);
  padding: 1rem;
}

.col-3 {
  flex: 0 0 calc(33.333% - 2rem);
  padding: 1rem;
}

.col-4 {
  flex: 0 0 calc(25% - 2rem);
  padding: 1rem;
}

/* Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  text-align: center;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
}

.stat-icon.users { background: var(--info-color); }
.stat-icon.appointment { background: var(--warning-color); }
.stat-icon.revenue { background: var(--success-color); }
.stat-icon.today { background: var(--primary-color); }

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.table th {
  background: var(--light-color);
  font-weight: 600;
  color: var(--secondary-color);
}

.table tr:hover {
  background: rgba(161, 155, 139, 0.05);
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--secondary-color);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(161, 155, 139, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

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

.btn-success {
  background: var(--success-color);
  color: var(--white);
}

.btn-danger {
  background: var(--danger-color);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--danger-color-saturate);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
}

.badge-success {
  background: var(--success-color);
  color: var(--white);
}

.badge-warning {
  background: var(--warning-color);
  color: var(--white);
}

.badge-danger {
  background: var(--danger-color);
  color: var(--white);
}

.badge-info {
  background: var(--info-color);
  color: var(--white);
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(75, 181, 67, 0.1);
  color: var(--success-color);
  border-color: rgba(75, 181, 67, 0.2);
}

.alert-error {
  background: rgba(234, 92, 116, 0.1);
  color: var(--danger-color);
  border-color: rgba(234, 92, 116, 0.2);
}

.alert-warning {
  background: rgba(255, 140, 0, 0.1);
  color: var(--warning-color);
  border-color: rgba(255, 140, 0, 0.2);
}

@media (max-width: 1040px) {
  .nav-menu li a span {
    display: none;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-nav {
    padding: 0 1rem;
  }

  .admin-nav .nav-title {
    font-size: 3.5dvw
  }
  
  .nav-menu {
    gap: 0;
  }
  
  
  
  .nav-menu li a {
    padding: 0.75rem;
  }
  
  .admin-container {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .row {
    flex-direction: column;
  }
  
  .col,
  .col-2,
  .col-3,
  .col-4 {
    flex: none;
    width: 100%;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
}

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

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

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.6s ease-out;
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translate(-50%, -50%);
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Tooltip Styles */
.admin-tooltip {
  position: absolute;
  background: var(--dark-color);
  color: var(--white);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 1001;
  pointer-events: none;
  transform: translateX(-50%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.admin-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-color) transparent transparent transparent;
}

/* Table Sorting Styles */
th[data-sortable] {
  position: relative;
  user-select: none;
}

th[data-sortable]:hover {
  background: var(--primary-color-transparent);
}

th.sort-asc::after {
  content: ' ↑';
  color: var(--primary-color);
  font-weight: bold;
}

th.sort-desc::after {
  content: ' ↓';
  color: var(--primary-color);
  font-weight: bold;
}

/* Enhanced Badge Styles */
.badge {
  font-family: inherit;
  letter-spacing: 0.025em;
}

.badge-primary {
  background: var(--primary-color);
  color: var(--white);
}

.badge-secondary {
  background: var(--text-muted);
  color: var(--white);
}

/* Print Styles */
@media print {
  .admin-nav,
  .btn,
  .modal {
    display: none !important;
  }
  
  .admin-container {
    padding-top: 0;
  }
  
  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
  
  body {
    color: #000;
    background: #fff;
  }
}



/* Modal Styles - Fixed positioning and z-index */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-content {
  background: var(--white);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideInUp 0.3s ease-out;
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--light-color);
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: var(--secondary-color);
  font-size: 1.25rem;
}

.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  background: none;
  border: none;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--danger-color);
  background: rgba(234, 92, 116, 0.1);
}

.modal-body {
  padding: 2rem;
}

/* Appointment Detail Styles */
.appointment-details,
.slot-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.appointment-detail-item,
.slot-detail-item {
  padding: 1rem;
  background: var(--light-color);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.detail-label {
  font-weight: 600;
  color: var(--secondary-color);
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.detail-value {
  color: var(--text-muted);
  line-height: 1.5;
}

.price-calculation {
  background: rgba(75, 181, 67, 0.1);
  border-left-color: var(--success-color);
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.price-line.total {
  font-weight: 600;
  font-size: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--success-color);
}

.status-incomplete {
  color: var(--warning-color);
  font-style: italic;
}

.status-complete {
  color: var(--success-color);
  font-weight: 500;
}

/* Notification System Styles */
.notification-toggle-container {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.notification-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--white);
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.9rem;
}

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

.notification-btn.active {
  background: var(--success-color);
  color: white;
  border-color: var(--success-color);
}

.notification-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.notification-icon {
  font-size: 1.1rem;
}

.notification-status {
  font-weight: 500;
}

/* Admin Tooltip for Notifications */
.admin-tooltip {
  position: absolute;
  background: var(--dark-color);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  z-index: 1000;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.admin-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--dark-color);
}

/* Modal Styles for Notifications */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
}

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

.modal-header h3 {
  margin: 0;
  color: var(--secondary-color);
}

.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: var(--danger-color);
}

.modal-body {
  padding: 2rem;
}

/* Notification Preview Styles */
.notification-preview {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.browser-notification {
  max-width: 400px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  border: 1px solid #ddd;
}

.notification-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  gap: 8px;
  font-size: 14px;
}

.notification-header img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
}

.notification-source {
  font-weight: 600;
  color: #333;
}

.notification-time {
  margin-left: auto;
  font-size: 12px;
  color: #666;
}

.notification-content {
  padding: 16px;
}

.notification-title {
  font-weight: 600;
  font-size: 16px;
  color: #333;
  margin-bottom: 4px;
  line-height: 1.3;
}

.notification-body {
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

/* Animation Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Loading Spinner */
.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-left: 8px;
}

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

/* Responsive Notification Styles */
@media (max-width: 768px) {
  .notification-toggle-container {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .notification-btn {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
  

  
  .browser-notification {
    max-width: 100%;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #000;
    --primary-saturate-color: #000;
    --background-color: #fff;
    --border-color: #000;
  }
}