/* Proff Bilsalg AS - Premium Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors - Branding */
  --color-primary: #DC2626;
  /* Vibrant Red */
  --color-primary-hover: #B91C1C;
  --color-secondary: #3B82F6;
  /* Bright Blue */
  --color-dark: #000000;
  /* True Black */
  --color-surface-dark: #111827;
  /* Dark Gray Surface */
  --color-surface-card: #FFFFFF;
  /* White Cards */

  /* Gray Palette */
  --color-gray-50: #F9FAFB;
  --color-gray-100: #F3F4F6;
  --color-gray-200: #E5E7EB;
  --color-gray-300: #D1D5DB;
  --color-gray-400: #9CA3AF;
  --color-gray-500: #6B7280;
  --color-gray-600: #4B5563;
  --color-gray-700: #374151;
  --color-gray-800: #1F2937;
  --color-gray-900: #111827;

  /* Colors - Semantic */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-error: #EF4444;
  --color-info: #3B82F6;

  /* Colors - Typography */
  --text-main: #111827;
  --text-muted: #4B5563;
  --text-white: #FFFFFF;
  --text-on-dark: #D1D5DB;

  /* Typography */
  --font-family: 'Inter', -apple-system, system-ui, sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-base: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 24px;
  --font-size-2xl: 32px;
  --font-size-hero: 48px;

  /* Layout - Responsive container widths */
  --container-width: 1280px;
  --container-padding: 24px;
  --spacing-unit: 8px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hero: 0 20px 40px rgba(0, 0, 0, 0.4);

  /* Spacing scale */
  --section-spacing: 64px;
  --section-spacing-mobile: 40px;
  --card-gap: 24px;
  --card-gap-mobile: 16px;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  width: 100%;
  box-sizing: border-box;
}

/* Responsive container padding */
@media (min-width: 1200px) {
  :root {
    --container-padding: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 16px;
    --section-spacing: var(--section-spacing-mobile);
    --card-gap: var(--card-gap-mobile);
  }
}

/* Header - Dark/Premium */
header {
  background: var(--color-dark);
  color: var(--text-white);
  padding: 20px 0;
  border-bottom: 2px solid var(--color-primary);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

header nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.logo {
  font-weight: 800;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
}

.logo span {
  display: block;
  font-size: 16px;
  border-top: 2px solid var(--color-primary);
  margin-top: 4px;
  padding-top: 4px;
  text-align: center;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
}

nav a {
  color: var(--text-white);
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}

nav a:hover,
nav a.active {
  color: var(--color-primary);
}

.btn-admin {
  background: white;
  color: var(--color-primary);
  padding: 8px 16px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('https://images.unsplash.com/photo-1492144534655-ae79c964c9d7?auto=format&fit=crop&q=80&w=1920');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 120px 0 80px;
  position: relative;
  z-index: 1;
  margin-bottom: 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.hero h1 {
  font-size: var(--font-size-hero);
  font-weight: 800;
  max-width: 600px;
  line-height: 1.1;
  margin-bottom: 24px;
}

.hero h1 span {
  color: var(--color-primary);
}

.hero p {
  font-size: 18px;
  color: var(--text-on-dark);
  max-width: 500px;
  margin-bottom: 40px;
}

.hero-btns {
  display: flex;
  gap: 16px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.4);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: white;
  color: var(--text-main);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 10px;
  margin-bottom: 60px;
  position: relative;
  z-index: 100;
  justify-content: center;
  max-width: 100%;
}

.stats-row .stat-card {
  position: relative;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 24px;
  border-radius: var(--radius-lg);
  color: white;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats-row .stat-info {
  display: flex;
  flex-direction: column;
}

.stat-card.blue {
  background: #3B82F6;
}

.stat-card.red {
  background: #DC2626;
}

.stat-card.dark {
  background: #1F2937;
}

.stat-card.green {
  background: #10B981;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-info h4 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  margin: 0 0 4px 0;
}

.stat-info p {
  font-size: 14px;
  opacity: 0.9;
  margin: 0;
}

/* Car Cards - Refined */
.section-title {
  text-align: center;
  margin-bottom: 32px;
}

.section-title h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-title p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 15px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--card-gap);
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1199px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 899px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 639px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.car-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s;
}

.car-card:hover {
  transform: translateY(-8px);
}

.car-img-wrapper {
  height: 200px;
  overflow: hidden;
  position: relative;
}

.car-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.car-card-body {
  padding: 16px 20px 20px;
}

.car-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.car-card-header h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.car-price {
  color: var(--color-primary);
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}

.car-year {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 0;
  margin-bottom: 12px;
  display: block;
}

.car-specs-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.spec-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.spec-item i {
  color: var(--color-primary);
  font-size: 14px;
}

.view-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

/* Detail Page Redesign */
.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  margin-top: 40px;
}

.detail-gallery img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.detail-info-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 32px;
}

.detail-info-header h1 {
  font-size: 40px;
  font-weight: 800;
}

.detail-info-header .price {
  font-size: 32px;
  color: var(--color-primary);
  font-weight: 800;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 32px;
}

.spec-box {
  background: #F9FAFB;
  padding: 16px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 12px;
}

.spec-box i {
  width: 36px;
  height: 36px;
  background: #FFE4E6;
  color: var(--color-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spec-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.spec-value {
  font-weight: 700;
  font-size: 14px;
}

.tax-box {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-top: 32px;
}

/* --- Admin Sidebar Layout --- */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
  background-color: #F3F4F6;
}

.sidebar {
  width: 280px;
  background: var(--color-dark);
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 40px 24px;
}

.sidebar-logo .logo-text {
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 1px;
}

.sidebar-logo .logo-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.sidebar-logo .logo-line {
  flex-grow: 1;
  height: 2px;
  background: var(--color-primary);
}

.sidebar-logo .logo-as {
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.sidebar-menu {
  flex-grow: 1;
  padding: 0 16px;
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 8px;
}

.sidebar-menu a {
  color: #9CA3AF;
  text-decoration: none;
  padding: 14px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
}

.sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.sidebar-menu a.active {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4);
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px 8px;
  margin-top: 8px;
}

.sidebar-section-label:first-child {
  margin-top: 0;
  padding-top: 8px;
}

.sidebar-badge {
  background: var(--color-primary);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid #1F2937;
}

.admin-main {
  flex-grow: 1;
  margin-left: 280px;
  display: flex;
  flex-direction: column;
}

.admin-topbar {
  background: white;
  padding: 0 32px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-gray-200);
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.header-icon-btn:hover {
  background: #F3F4F6;
  color: var(--text-primary);
}

.header-icon-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--color-primary);
}

.header-icon-btn i {
  font-size: 18px;
}

.admin-content {
  padding: 24px 32px;
}

/* Analytics Cards */
.ana-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.ana-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ana-info h5 {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ana-info .ana-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-dark);
}

.ana-icon {
  width: 40px;
  height: 40px;
  background: #F3F4F6;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 18px;
}

/* Form Switches & Tables */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #D1D5DB;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--color-success);
}

input:checked+.slider:before {
  transform: translateX(20px);
}

/* Footer - Dark */
footer {
  background: var(--color-dark);
  color: var(--text-white);
  padding: 80px 0 40px;
  margin-top: 100px;
}

/* Responsive */
@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-row {
    display: none;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero {
    padding: 60px 0 70px;
  }

  nav ul {
    display: none;
  }
}

/* Pagination & Progress */
.pagination-container {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination-btn {
  padding: 8px 14px;
  font-size: 13px;
  background: white;
  color: var(--text-muted);
  border: 1px solid var(--color-gray-200);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.pagination-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.pagination-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.pagination-btn.active:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: white;
}

.inventory-progress-bar {
  flex-grow: 1;
  height: 12px;
  background: #F3F4F6;
  border-radius: 6px;
  overflow: hidden;
}

.inventory-progress-fill {
  height: 100%;
  background: var(--color-primary);
}

/* Admin Table Enhancements */
.row-unread {
  border-left: 4px solid var(--color-primary) !important;
  background-color: #FFF5F5 !important;
}

.car-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--color-gray-200);
}

/* ============================================
   PROFESSIONAL FORM STYLES
   ============================================ */

/* Form Cards */
.form-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .form-card {
    padding: 16px;
    border-radius: 10px;
  }
}

/* Form Sections */
.form-section {
  margin-bottom: 24px;
}

.form-section:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-gray-100);
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-title i {
  color: var(--color-primary);
  font-size: 16px;
}

/* Form Grid Layout */
.form-grid {
  display: grid;
  gap: 16px;
}

.form-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
  .form-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

/* Form Labels */
.form-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-label .required {
  color: var(--color-primary);
}

.form-label .optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12px;
}

/* Form Inputs - Universal Styling */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background-color: var(--color-gray-50);
  border: 1px solid var(--color-gray-200);
  border-radius: 8px;
  transition: all 0.2s ease;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.form-control:hover,
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="time"]:hover,
input[type="search"]:hover,
select:hover,
textarea:hover {
  border-color: var(--color-gray-300);
  background-color: white;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: var(--color-primary);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Textarea Specific */
textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

textarea.small {
  min-height: 80px;
}

textarea.large {
  min-height: 200px;
}

/* Select Styling */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23DC2626' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

/* File Input */
input[type="file"] {
  padding: 10px;
  background: var(--color-gray-50);
  border: 2px dashed var(--color-gray-300);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}

input[type="file"]:hover {
  border-color: var(--color-primary);
  background: #FFF5F5;
}

input[type="file"]:focus {
  border-color: var(--color-primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

/* Checkbox and Radio */
input[type="checkbox"],
input[type="radio"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--color-primary);
}

/* Form Help Text */
.form-help {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-help i {
  font-size: 12px;
}

/* Form Errors */
.form-error {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-error::before {
  content: "\f06a";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 12px;
}

.form-control.error,
input.error,
select.error,
textarea.error {
  border-color: var(--color-error);
  background-color: #FEF2F2;
}

/* Error Alert Box */
.alert-error {
  background: #FEE2E2;
  color: #991B1B;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-error::before {
  content: "\f071";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 16px;
}

.alert-success {
  background: #D1FAE5;
  color: #065F46;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.alert-success::before {
  content: "\f058";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 16px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--color-gray-100);
}

@media (max-width: 640px) {
  .form-actions {
    flex-direction: column;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Button Sizes */
.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* Button Variants */
.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--color-gray-300);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ============================================
   ADMIN PAGE LAYOUTS - RESPONSIVE
   ============================================ */

/* Two Column Form Layout */
.admin-layout-split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

@media (max-width: 1200px) {
  .admin-layout-split {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Panel */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .panel-card {
    padding: 16px;
    border-radius: 10px;
  }
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title .count {
  background: var(--color-gray-100);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

.photo-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item.is-main {
  border: 3px solid var(--color-primary);
}

.photo-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 6px;
}

.photo-btn {
  background: white;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-btn:hover {
  transform: scale(1.05);
}

.photo-btn.delete {
  background: #FEE2E2;
  color: #991B1B;
}

.photo-btn.delete:hover {
  background: #FECACA;
}

.photo-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: var(--color-primary);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--color-gray-300);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  background: var(--color-gray-50);
  transition: all 0.2s;
  cursor: pointer;
}

.upload-zone:hover {
  border-color: var(--color-primary);
  background: #FFF5F5;
}

.upload-zone i {
  font-size: 32px;
  color: var(--color-gray-400);
  margin-bottom: 12px;
}

.upload-zone p {
  color: var(--text-muted);
  font-size: 14px;
}

.upload-zone input[type="file"] {
  display: none;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-actions .btn {
  width: 100%;
  justify-content: center;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 48px;
  color: var(--color-gray-300);
  margin-bottom: 16px;
}

.empty-state p {
  font-size: 14px;
}

/* ============================================
   MOBILE SIDEBAR - RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar {
    padding: 0 20px;
  }

  .admin-content {
    padding: 20px;
  }

  .ana-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .ana-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    height: 60px;
    flex-direction: column;
    height: auto;
    padding: 16px 20px;
    gap: 12px;
    align-items: flex-start;
  }

  .admin-topbar h1 {
    font-size: 18px;
  }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-main);
  cursor: pointer;
  padding: 8px;
}

@media (max-width: 1024px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.sidebar-overlay.active {
  display: block;
}

/* ============================================
   DATA TABLES - RESPONSIVE
   ============================================ */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-100);
}

.data-table th {
  background: var(--color-gray-50);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: var(--color-gray-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Responsive Table */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 12px 16px;
    font-size: 14px;
  }
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

/* ============================================
   LOGIN PAGE - CENTERED & RESPONSIVE
   ============================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--color-gray-50) 0%, var(--color-gray-100) 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: white;
  padding: 48px 40px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px;
    border-radius: 16px;
  }
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 15px;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
}

.login-footer a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   MISC UTILITIES
   ============================================ */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

.hidden-mobile {
  display: block;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
}

/* ============================================
   ENHANCED DATA TABLES
   ============================================ */

/* Table Container */
.table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* Table Toolbar */
.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--color-gray-50);
  border-bottom: 1px solid var(--color-gray-200);
  align-items: center;
  justify-content: space-between;
}

.table-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  flex: 1;
}

.table-toolbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

@media (max-width: 768px) {
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .table-toolbar-left,
  .table-toolbar-right {
    width: 100%;
  }
}

/* Search Box */
.table-search {
  position: relative;
  min-width: 280px;
}

.table-search input {
  padding-left: 44px;
  width: 100%;
}

.table-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Filter Dropdowns */
.table-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.table-filter {
  min-width: 140px;
}

.table-filter select {
  padding: 10px 14px;
  font-size: 14px;
}

/* Enhanced Table */
.enhanced-table {
  width: 100%;
  border-collapse: collapse;
}

.enhanced-table th,
.enhanced-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-gray-100);
}

.enhanced-table th {
  background: white;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 10;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.enhanced-table th:hover {
  background: var(--color-gray-50);
}

.enhanced-table th.sortable::after {
  content: "\f0dc";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  margin-left: 8px;
  color: var(--color-gray-300);
  font-size: 10px;
}

.enhanced-table th.sort-asc::after {
  content: "\f0de";
  color: var(--color-primary);
}

.enhanced-table th.sort-desc::after {
  content: "\f0dd";
  color: var(--color-primary);
}

.enhanced-table th.no-sort {
  cursor: default;
}

.enhanced-table th.no-sort:hover {
  background: white;
}

.enhanced-table tbody tr {
  transition: background-color 0.15s ease;
}

.enhanced-table tbody tr:hover {
  background: var(--color-gray-50);
}

.enhanced-table tbody tr:last-child td {
  border-bottom: none;
}

.enhanced-table tbody tr.selected {
  background: #FEF2F2;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: 8px;
}

.table-actions .btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--color-gray-100);
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.table-actions .btn-icon:hover {
  background: var(--color-primary);
  color: white;
}

.table-actions .btn-icon.danger:hover {
  background: var(--color-error);
}

/* Table Footer */
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--color-gray-50);
  border-top: 1px solid var(--color-gray-200);
}

.table-info {
  color: var(--text-muted);
  font-size: 14px;
}

.table-pagination {
  display: flex;
  gap: 8px;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill.active {
  background: #D1FAE5;
  color: #065F46;
}

.status-pill.active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
}

.status-pill.sold {
  background: #DBEAFE;
  color: #1E40AF;
}

.status-pill.off-market {
  background: #FEF3C7;
  color: #92400E;
}

.status-pill.deleted {
  background: #FEE2E2;
  color: #991B1B;
}

.status-pill.unread {
  background: #FEE2E2;
  color: #991B1B;
}

.status-pill.read {
  background: var(--color-gray-100);
  color: var(--text-muted);
}

/* Quick Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 10px 20px;
  background: white;
  border: 2px solid var(--color-gray-200);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.filter-tab:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.filter-tab .count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  font-size: 12px;
}

.filter-tab.active .count {
  background: rgba(255, 255, 255, 0.3);
}

/* Empty Table State */
.table-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.table-empty i {
  font-size: 48px;
  color: var(--color-gray-300);
  margin-bottom: 16px;
}

.table-empty h3 {
  font-size: 18px;
  color: var(--text-main);
  margin-bottom: 8px;
}

.table-empty p {
  font-size: 14px;
  margin-bottom: 24px;
}

/* Row highlight animation */
@keyframes rowHighlight {
  0% { background-color: #FEF3C7; }
  100% { background-color: transparent; }
}

.row-highlight {
  animation: rowHighlight 2s ease;
}

/* Responsive Table Scroll */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1024px) {
  .enhanced-table {
    min-width: 800px;
  }

  .enhanced-table th,
  .enhanced-table td {
    padding: 12px 16px;
  }
}

/* Checkbox Column */
.col-checkbox {
  width: 40px;
}

.col-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

/* Thumbnail Column */
.col-thumb {
  width: 70px;
}

.table-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--color-gray-200);
}

/* Actions Column */
.col-actions {
  width: 120px;
  text-align: right;
}

/* Role Badges for Users Table */
.status-pill.role-dev {
  background: #DBEAFE;
  color: #1E40AF;
}

.status-pill.role-manager {
  background: #D1FAE5;
  color: #065F46;
}

.status-pill.role-user {
  background: var(--color-gray-100);
  color: var(--text-muted);
}

/* Unread Row Highlight */
.row-unread {
  background: #FFF5F5;
  border-left: 4px solid var(--color-primary);
}

.row-unread:hover {
  background: #FEE2E2;
}

/* Row Highlight (Current User) */
.row-highlight {
  background: #FFFBEB;
}

.row-highlight:hover {
  background: #FEF3C7;
}

/* Action Badges for Logs Table */
.status-pill.action-login,
.status-pill.action-logout {
  background: #DBEAFE;
  color: #1E40AF;
}

.status-pill.action-car_create {
  background: #D1FAE5;
  color: #065F46;
}

.status-pill.action-car_update {
  background: #FEF3C7;
  color: #92400E;
}

.status-pill.action-car_delete {
  background: #FEE2E2;
  color: #991B1B;
}

.status-pill.action-message_read,
.status-pill.action-message_delete {
  background: #F3E8FF;
  color: #7C3AED;
}

.status-pill.action-photo_upload,
.status-pill.action-photo_delete {
  background: #ECFEFF;
  color: #0E7490;
}

/* Text Utilities */
.text-muted {
  color: var(--text-muted);
}

/* Badge Style */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

.badge-info {
  background: #DBEAFE;
  color: #1E40AF;
}

.badge-secondary {
  background: var(--color-gray-100);
  color: var(--text-muted);
}

/* ============================================
   MOBILE-FIRST RESPONSIVE ENHANCEMENTS
   Target: 360x640, 390x844 viewports
   ============================================ */

/* Global Touch-Friendly Targets (min 44px) */
.btn,
.btn-icon,
.pagination-btn,
.filter-tab,
.view-btn,
.photo-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.btn-icon {
  min-width: 44px;
  min-height: 44px;
}

/* Improved Focus States */
.btn:focus-visible,
.btn-icon:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ============================================
   PUBLIC HEADER - MOBILE
   ============================================ */
@media (max-width: 768px) {
  header {
    padding: 12px 0;
  }

  .header-inner {
    padding: 0 16px;
  }

  .logo {
    font-size: 18px;
  }

  .logo span {
    font-size: 12px;
  }

  header nav {
    position: static;
    transform: none;
  }
}

/* ============================================
   PUBLIC FOOTER - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .site-footer {
    padding: 40px 0 24px;
  }

  .footer-grid {
    gap: 24px;
  }

  .footer-section {
    min-width: 100%;
  }

  .footer-section.logo-section {
    min-width: 100%;
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .footer-bottom-links {
    justify-content: center;
  }
}

/* ============================================
   ADMIN SIDEBAR - MOBILE DRAWER
   ============================================ */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    width: 280px;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .admin-main {
    margin-left: 0;
  }

  .admin-topbar {
    padding: 16px;
    height: auto;
    min-height: 60px;
  }

  .admin-topbar h1 {
    font-size: 18px !important;
  }

  .admin-content {
    padding: 16px;
  }

  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
  }

  .sidebar-overlay.active {
    display: block;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .admin-topbar {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .admin-topbar > div:last-child {
    margin-left: auto;
  }
}

/* Sidebar menu touch targets */
.sidebar-menu a {
  padding: 14px 20px;
  min-height: 48px;
}

/* ============================================
   DATA TABLES - MOBILE RESPONSIVE
   ============================================ */

/* Mobile-first table card view - active below 768px */
@media (max-width: 768px) {
  .table-container {
    border-radius: 12px;
  }

  .table-toolbar {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .table-toolbar-left,
  .table-toolbar-right {
    width: 100%;
  }

  .table-search {
    min-width: 100%;
  }

  .table-filters {
    width: 100%;
    flex-direction: column;
  }

  .table-filter {
    min-width: 100%;
  }

  .table-footer {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    text-align: center;
  }

  .table-pagination {
    justify-content: center;
    flex-wrap: wrap;
  }

  .pagination-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
  }

  /* Table actions on mobile - larger touch targets */
  .table-actions {
    gap: 4px;
  }

  .table-actions .btn-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
}

/* Small mobile: card-style table rows (below 640px) */
@media (max-width: 640px) {
  /* Hide thead on mobile for card view */
  .table-mobile-cards thead {
    display: none;
  }

  .table-mobile-cards tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }

  .table-mobile-cards tbody tr {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: 12px;
    padding: 16px;
    gap: 8px;
  }

  .table-mobile-cards tbody tr:hover {
    border-color: var(--color-primary);
  }

  .table-mobile-cards tbody tr.row-unread {
    border-left: 4px solid var(--color-primary);
    background: #FFF5F5;
  }

  .table-mobile-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 0;
    border: none;
    gap: 12px;
  }

  .table-mobile-cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    min-width: 80px;
  }

  .table-mobile-cards tbody td:last-child {
    border-top: 1px solid var(--color-gray-100);
    padding-top: 12px;
    margin-top: 4px;
    justify-content: flex-end;
  }

  .table-mobile-cards tbody td:last-child::before {
    display: none;
  }

  .table-mobile-cards tbody td.col-thumb {
    order: -1;
    justify-content: center;
  }

  .table-mobile-cards tbody td.col-thumb::before {
    display: none;
  }

  .table-mobile-cards .table-thumb {
    width: 100%;
    height: 120px;
    border-radius: 8px;
  }

  /* Horizontal scroll fallback for complex tables */
  .table-scroll {
    -webkit-overflow-scrolling: touch;
    position: relative;
  }

  /* Scroll hint indicator */
  .table-scroll::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 24px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.9));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s;
  }

  .table-scroll.scrolled-right::after {
    opacity: 0;
  }

  .enhanced-table:not(.table-mobile-cards) {
    min-width: 500px;
  }

  .enhanced-table:not(.table-mobile-cards) th,
  .enhanced-table:not(.table-mobile-cards) td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .enhanced-table:not(.table-mobile-cards) .col-thumb {
    width: 50px;
  }

  .enhanced-table:not(.table-mobile-cards) .table-thumb {
    width: 40px;
    height: 40px;
  }

  .enhanced-table:not(.table-mobile-cards) .col-actions {
    width: auto;
  }
}

/* ============================================
   FILTER TABS - MOBILE SCROLL
   ============================================ */
@media (max-width: 768px) {
  .filter-tabs {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 16px;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tab {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 13px;
    min-height: 44px;
  }

  .filter-tabs .btn {
    flex-shrink: 0;
    margin-left: 8px;
  }
}

/* ============================================
   FORMS - MOBILE OPTIMIZED
   ============================================ */
@media (max-width: 768px) {
  .form-card {
    padding: 16px;
    border-radius: 12px;
  }

  .form-section {
    margin-bottom: 24px;
  }

  .form-section-title {
    font-size: 16px;
    margin-bottom: 16px;
  }

  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .form-label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .form-control,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  input[type="search"],
  select,
  textarea {
    padding: 14px 16px;
    font-size: 16px; /* Prevents iOS zoom on focus */
    min-height: 48px;
  }

  textarea {
    min-height: 100px;
  }

  .form-actions {
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Upload zone */
  .upload-zone {
    padding: 32px 16px;
  }

  .upload-zone i {
    font-size: 28px;
  }

  /* Photo grid */
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .photo-btn {
    padding: 8px 12px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* ============================================
   ADMIN LAYOUT SPLIT - MOBILE STACK
   ============================================ */
@media (max-width: 1024px) {
  .admin-layout-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .sidebar-panel {
    order: -1;
    gap: 16px;
  }

  .panel-card {
    padding: 16px;
  }
}

/* ============================================
   ANALYTICS CARDS - MOBILE
   ============================================ */
@media (max-width: 640px) {
  .ana-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ana-card {
    padding: 16px;
  }

  .ana-info .ana-value {
    font-size: 20px;
  }
}

/* ============================================
   STATS ROW - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: -40px;
  }

  .stat-card {
    padding: 20px;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .stat-info h4 {
    font-size: 24px;
  }

  .stat-info p {
    font-size: 13px;
  }
}

/* ============================================
   HERO SECTION - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .hero {
    padding: 60px 0 100px;
  }

  .hero h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  .hero p {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .hero-btns {
    flex-direction: column;
    gap: 12px;
  }

  .hero-btns .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   CAR CARDS GRID - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .car-card {
    border-radius: 12px;
  }

  .car-img-wrapper {
    height: 180px;
  }

  .car-card-body {
    padding: 14px 16px 16px;
  }

  .car-card-header h3 {
    font-size: 16px;
  }

  .car-price {
    font-size: 16px;
  }

  .car-specs-mini {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .spec-item {
    font-size: 12px;
  }
}

/* ============================================
   CAR DETAIL PAGE - MOBILE
   ============================================ */
@media (max-width: 1024px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 24px;
  }

  .detail-info-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 24px;
  }

  .detail-info-header h1 {
    font-size: 24px;
  }

  .detail-info-header .price {
    font-size: 24px;
  }
}

@media (max-width: 768px) {
  .gallery-main img {
    height: 280px;
  }

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .gallery-thumbnails {
    gap: 6px;
  }

  .gallery-thumb {
    width: 60px;
    height: 45px;
  }

  .spec-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .spec-box {
    padding: 12px;
  }

  .tax-box {
    padding: 16px;
    margin-top: 24px;
  }

  /* Loan calculator - mobile */
  .loan-calculator-box {
    padding: 16px;
  }
}

/* ============================================
   LIGHTBOX - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .lightbox-content {
    max-width: 95vw;
    max-height: 70vh;
  }

  .lightbox-content img {
    max-width: 95vw;
    max-height: 65vh;
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .lightbox-nav {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .lightbox-nav.prev {
    left: 8px;
  }

  .lightbox-nav.next {
    right: 8px;
  }

  .lightbox-thumbnails {
    bottom: 70px;
    max-width: 90vw;
    gap: 6px;
  }

  .lightbox-thumb {
    width: 50px;
    height: 38px;
  }
}

/* ============================================
   SECTION TITLES - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .section-title {
    margin-bottom: 32px;
  }

  .section-title h2 {
    font-size: 24px;
    margin-bottom: 8px;
  }

  .section-title p {
    font-size: 14px;
  }
}

/* ============================================
   LOGIN PAGE - MOBILE
   ============================================ */
@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 16px;
  }

  .login-header h2 {
    font-size: 24px;
  }

  .login-header p {
    font-size: 14px;
  }
}

/* ============================================
   TABLE ACTIONS - MOBILE
   ============================================ */
@media (max-width: 768px) {
  .table-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .table-actions .btn-icon {
    width: 40px;
    height: 40px;
  }

  .table-actions .btn {
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ============================================
   SELL SUBMISSIONS STATS ROW
   ============================================ */
.sell-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.sell-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 200px;
}

.sell-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.sell-stat-info {
  display: flex;
  flex-direction: column;
}

.sell-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.sell-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .sell-stats-row {
    gap: 12px;
  }

  .sell-stat-card {
    padding: 14px 16px;
    min-width: 100%;
    flex: 1 1 100%;
  }

  .sell-stat-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .sell-stat-value {
    font-size: 24px;
  }

  .sell-stat-label {
    font-size: 12px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.mobile-only {
  display: none;
}

.desktop-only {
  display: block;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }

  .desktop-only {
    display: none;
  }

  .mobile-stack {
    flex-direction: column !important;
  }

  .mobile-full-width {
    width: 100% !important;
  }

  .mobile-text-center {
    text-align: center !important;
  }
}

/* ============================================
   PREVENT HORIZONTAL SCROLL
   ============================================ */
html,
body {
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 100%;
  overflow-x: hidden;
}

/* ============================================
   iOS SPECIFIC FIXES
   ============================================ */
@supports (-webkit-touch-callout: none) {
  /* iOS-specific input styling to prevent zoom */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }

  /* Fix iOS momentum scrolling */
  .table-scroll,
  .gallery-thumbnails,
  .lightbox-thumbnails,
  .filter-tabs {
    -webkit-overflow-scrolling: touch;
  }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  z-index: 10000;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  .btn,
  .filter-tab,
  .pagination-btn {
    border: 2px solid currentColor;
  }

  .status-pill {
    border: 1px solid currentColor;
  }
}