/* Garage Owner Panel Styles */
:root {
  --header-height: 84px; /* Adjust if header height changes */
  --sidebar-width: 250px;
  --gradient-start: #4caf50;
  --gradient-end: #4caf50;
  --transition-speed: 0.3s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.4;
  overflow-x: hidden;
}

/* Scrollbar Styling (optional) */
body,
.sidebar,
.dashboard-content {
  scrollbar-width: thin;
  scrollbar-color: var(--gradient-start) #e5e9f2;
}
body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.dashboard-content::-webkit-scrollbar {
  width: 8px;
}
body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.dashboard-content::-webkit-scrollbar-track {
  background: #eef1f6;
}
body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.dashboard-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 20px;
}

/* Auth Pages */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  max-width: 450px;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-header {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: 30px;
  text-align: center;
}

.auth-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  opacity: 0.9;
  font-size: 14px;
}

.auth-form { padding: 30px; }

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e6ed;
  border-radius: 10px;
  font-size: 14px;
  transition: all var(--transition-speed) ease;
  background: #f8f9fa;
}

.form-input:focus {
  outline: none;
  border-color: var(--gradient-start);
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input.error {
  border-color: #e74c3c;
  background: #fdf2f2;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn:active { transform: translateY(0); }

.auth-footer {
  text-align: center;
  padding: 20px;
  background: #f8f9fa;
  border-top: 1px solid #e0e6ed;
}

.auth-footer a {
  color: var(--gradient-start);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Dashboard Layout */
.dashboard-container {
  background: #f5f7fa;
  min-height: 100vh;
  padding-top: var(--header-height);
  /* Allows body scroll if main content overflows */
}

.dashboard-header {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1000;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition-speed);
}

.logout-btn:hover { background: rgba(255, 255, 255, 0.3); }

/* NEW: Fixed Sidebar Layout */
.dashboard-layout {
  display: block; /* We handle positioning manually now */
  min-height: calc(100vh - var(--header-height));
  position: relative;
}

/* Sidebar fixed with its own scroll */
.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  background: #ffffff;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  padding: 20px 18px 40px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 900;
  transition: width var(--transition-speed) ease;
}

.sidebar-menu h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: #95a5a6;
  margin: 18px 0 12px;
  letter-spacing: 1px;
  font-weight: 600;
}

.sidebar-menu h3:first-child { margin-top: 0; }

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: #34495e;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  margin-bottom: 5px;
  transition: all var(--transition-speed) ease;
  font-size: 14px;
  line-height: 1.2;
}

.sidebar-menu a:hover {
  background: #f5f7fa;
  color: var(--gradient-start);
}

.sidebar-menu a.active {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  font-weight: 600;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.sidebar-menu a .fa-fw {
  width: 20px;
  text-align: center;
}

/* Main content shifted to make room for fixed sidebar */
.dashboard-content {
  margin-left: var(--sidebar-width);
  padding: 30px 30px 60px;
  min-height: calc(100vh - var(--header-height));
  /* Independent scroll if desired: uncomment next two lines
     height: calc(100vh - var(--header-height));
     overflow-y: auto;
  */
}

/* Stats Grid & Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  padding: 22px 22px 24px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: transform var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.stat-card:before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102,126,234,0.08), rgba(118,75,162,0.08));
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card:hover:before { opacity: 1; }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
}

.stat-icon.pending { background: linear-gradient(135deg, #f39c12, #e67e22); }
.stat-icon.progress { background: linear-gradient(135deg, #3498db, #2980b9); }
.stat-icon.completed { background: linear-gradient(135deg, #27ae60, #229954); }
.stat-icon.revenue { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 5px;
}

.stat-label {
  color: #7f8c8d;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Sections */
.dashboard-section {
  background: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-bottom: 30px;
}

.section-header {
  background: #f8f9fa;
  padding: 18px 25px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-content { padding: 25px; }

/* Tables */
.service-table {
  width: 100%;
  border-collapse: collapse;
}

.service-table th,
.service-table td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.service-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.service-table tbody tr {
  transition: background var(--transition-speed);
}

.service-table tbody tr:hover {
  background: #f8f9fa;
}

.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
  letter-spacing: 0.5px;
}

.status-pending { background: #fff3cd; color: #856404; }
.status-in_progress { background: #cce7ff; color: #0056b3; }
.status-completed { background: #d4edda; color: #155724; }
.status-cancelled { background: #f8d7da; color: #721c24; }

/* Responsive Design */
@media (max-width: 1200px) {
  .stat-value { font-size: 28px; }
  .stat-icon { width: 46px; height: 46px; font-size: 18px; }
}

@media (max-width: 992px) {
  /* Revert to vertical flow on mobile */
  .dashboard-container {
    padding-top: var(--header-height);
  }

  .sidebar {
    position: relative;
    top: 0;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
  }

  .dashboard-content {
    margin-left: 0;
    padding: 20px 15px 50px;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
  }

  .service-table {
    font-size: 13px;
  }

  .service-table th, .service-table td {
    padding: 10px 8px;
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat-value { font-size: 24px; }
  .section-content { padding: 18px; }
  .section-header { padding: 15px 18px; }
  .btn { font-size: 13px; padding: 12px; }
  .service-table th { font-size: 11px; }
}

/* Utility */
.hidden { display: none !important; }