:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #1e293b;
  --accent-soft: #f1f5f9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  font-size: 14px;
  line-height: 1.5;

  background: var(--bg);
  color: var(--text);

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 {
  margin-top: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-top: 25px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  min-height: 140px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.card h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.3;
}

.card>span {
  display: block;
  margin-top: 18px;
  font-size: 34px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  word-break: normal;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;

  background: white;

  border-radius: 16px;
  overflow: hidden;

  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

th,
td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8fafc;
  color: #475569;

  font-size: 13px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: .5px;

  border-bottom: 2px solid #e2e8f0;
}

td {
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}

tr {
  transition: background .2s ease;
}

tr:hover {
  background: #f8fbff;
}

thead th:first-child {
  border-top-left-radius: 16px;
}

thead th:last-child {
  border-top-right-radius: 16px;
}

img {
  object-fit: cover;
  border-radius: 4px;
}

.add-btn {
  margin: 20px 0;
  padding: 12px 20px;
  background: #111827;
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.add-btn:hover {
  background: #374151;
  transform: translateY(-2px);
}

/* ==========================================
   Vehicle Inventory Actions
========================================== */

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 20px 0 18px;
}

.inventory-actions .add-btn {
  margin: 0;
}

.inventory-primary-action {
  flex: 0 0 auto;
}

.inventory-secondary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inventory-tool-btn {
  padding: 10px 14px;

  background: #ffffff;
  color: #334155;

  border: 1px solid #cbd5e1;
  border-radius: 9px;

  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.inventory-tool-btn:hover {
  background: #f8fafc;
  color: #0f172a;

  border-color: #94a3b8;

  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.09);
}

.form-box {
  width: 100%;
  max-width: 900px;
  margin: 20px 0 30px 0;
  background: white;
  padding: 24px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: grid;
  gap: 12px;
}

.form-box h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
}

.form-box input,
.form-box select,
.form-box textarea {
  width: 100%;

  padding: 11px 14px;

  border: 1px solid #d6dee8;
  border-radius: 10px;

  background: #ffffff;
  color: #1e293b;

  font-family: inherit;
  font-size: 14px;

  transition:
    border-color .18s ease,
    box-shadow .18s ease,
    background-color .18s ease;
}

.form-box input:hover,
.form-box select:hover,
.form-box textarea:hover {
  border-color: #c4d2e0;
}

.form-box input:focus,
.form-box select:focus,
.form-box textarea:focus {
  outline: none;

  border-color: #2563eb;

  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);

  background: #ffffff;
}

.form-box input::placeholder,
.form-box textarea::placeholder {
  color: #94a3b8;
}

#pendingVehicleImages {
  display: grid;
  gap: 8px;
}

.pending-vehicle-image {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 12px;

  border: 1px solid #e2e8f0;
  border-radius: 10px;

  background: #f8fafc;
}

.pending-vehicle-image-name {
  min-width: 0;

  color: #334155;
  font-size: 13px;
  font-weight: 600;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-vehicle-image-remove {
  flex-shrink: 0;

  padding: 6px 10px;

  border: 1px solid #fecaca;
  border-radius: 8px;

  background: #fff;
  color: #dc2626;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;
}

.pending-vehicle-image-remove:hover {
  background: #fef2f2;
}

.hidden {
  display: none !important;
}

.search-box {
  width: 100%;
  max-width: 600px;

  padding: 12px 14px;
  margin: 0;

  display: block;

  border: 1px solid #d1d5db;
  border-radius: 10px;

  background: #ffffff;

  font-family: inherit;
  font-size: 14px;
}

/* ==========================================
   Vehicle Inventory Toolbar
========================================== */

.inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;

  margin: 18px 0 16px;
}

.inventory-toolbar .search-box {
  flex: 1;
  max-width: 600px;
}

/* ==========================================
   Customer Toolbar
========================================== */

.customer-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 20px 0 18px;
}

.customer-toolbar .add-btn {
  flex-shrink: 0;
  margin: 0;
}

.customer-toolbar .search-box {
  flex: 1;
  max-width: 450px;
  margin: 0;
}

/* ==========================================
   Sales Toolbar
========================================== */

.sales-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 20px 0 18px;
}

.sales-toolbar .add-btn {
  flex-shrink: 0;
  margin: 0;
}

.sales-toolbar .search-box {
  flex: 1;
  max-width: 500px;
  margin: 0;
}

/* ==========================================
   Expenses Toolbar
========================================== */

.expenses-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 20px 0 18px;
}

.expenses-toolbar .add-btn {
  flex-shrink: 0;
  margin: 0;
}

.expenses-toolbar .search-box {
  flex: 1;
  max-width: 520px;
  margin: 0;
}

.filter-buttons {
  width: auto;
  margin: 0;

  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;

  flex-wrap: wrap;
}

.filter-buttons button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #e5e7eb;
  cursor: pointer;
}

.filter-buttons button:hover {
  background: #111827;
  color: white;
}

button {
  padding: 10px 14px;

  border: 1px solid transparent;
  border-radius: 9px;

  background: #111827;
  color: #ffffff;

  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;

  cursor: pointer;

  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.14);

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

button:hover {
  background: #374151;

  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.18);

  transform: translateY(-2px);
}

button:active {
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.14);

  transform: translateY(0) scale(0.98);
}

button:focus-visible {
  outline: none;

  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.18),
    0 5px 14px rgba(15, 23, 42, 0.14);
}

button:disabled {
  opacity: 0.55;

  cursor: not-allowed;

  box-shadow: none;

  transform: none;
}

button:disabled:hover {
  box-shadow: none;

  transform: none;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  top: 0;
  z-index: 1000;

  width: 270px;
  height: 100vh;
  height: 100dvh;

  background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
  color: white;
  border-right: 1px solid var(--border);

  padding: 24px 18px;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;

  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;

  box-shadow: 8px 0 30px rgba(15, 23, 42, 0.18);
}

.sidebar h2 {
  margin: 0 0 30px 0;
  font-size: 22px;
  color: white;
}

.sidebar a {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  text-decoration: none;
  color: #cbd5e1;
  transition: all 0.25s ease;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.sidebar a:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(5px);
  color: white;
}

.sidebar a.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.sidebar a.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: #60a5fa;
}

.sidebar .logout-link {
  margin-top: 14px;

  color: #cbd5e1;

  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.sidebar .logout-link:hover {
  background: rgba(239, 68, 68, 0.14);

  color: #f87171;

  transform: translateX(3px);
}

.main-content {
  margin-left: 290px;
  padding: 30px;
}

.page-header {
  margin-bottom: 25px;
}

.page-header h1 {
  margin: 0;

  color: #0f172a;

  font-size: 28px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -0.6px;
}

.page-header h1 i {
  margin-right: 10px;
  color: var(--primary);
  font-size: 0.85em;
}

.page-header p {
  margin: 6px 0 0;

  color: #64748b;

  font-size: 14px;
  line-height: 1.5;
}

.table-top-scrollbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;

  width: 100%;
  height: 16px;
  margin-bottom: 8px;

  overflow-x: auto;
  overflow-y: hidden;

  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.table-top-scrollbar-content {
  height: 1px;
}

@media (min-width: 769px) and (max-width: 1280px) {
  .table-top-scrollbar.is-visible {
    display: block;
  }
}

.table-wrapper {
  width: 100%;
  overflow: auto;
}

.table-card {
  width: 100%;
  min-width: 0;

  background: white;
  border-radius: 16px;
  border: 1px solid #e5e7eb;

  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);

  overflow: hidden;
  margin-top: 20px;
}

.table-wrapper table {
  min-width: 900px;
}

.content-section {
  margin-top: 20px;
}

.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
}

.widget-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px;
  min-height: 260px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: all 0.25s ease;
}

.widget-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.widget-card h2 {
  margin: 0 0 18px;

  color: #0f172a;

  font-size: 17px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.25px;
}

.widget-item {
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.widget-item:last-child {
  border-bottom: none;
}

.widget-title {
  font-weight: 600;
  color: #111827;
}

.widget-subtitle {
  font-size: 14px;
  color: #6b7280;
}

.section-title {
  margin: 34px 0 12px;

  color: #0f172a;

  font-size: 19px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-logo {
  width: 64px;
  height: 64px;

  padding: 4px;

  border-radius: 18px;

  background: rgba(255, 255, 255, .10);

  border: 1px solid rgba(255, 255, 255, .15);

  backdrop-filter: blur(12px);

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  box-shadow:
    0 10px 24px rgba(0, 0, 0, .20),
    inset 0 1px 0 rgba(255, 255, 255, .15);
}

.brand-logo img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  transition: .25s ease;
}

.brand-logo:hover img {
  transform: scale(1.05);
}

.brand-text h2 {
  margin: 0;
  color: white;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.brand-text span {
  display: block;
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==========================================
   Dashboard Quick Actions
========================================== */
.quick-actions-card {
  display: flex;
  align-items: center;
  gap: 18px;

  margin: 14px 0;
  padding: 12px 14px;

  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 14px;

  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.quick-actions-header {
  display: flex;
  align-items: center;

  margin-right: 14px;

  flex-shrink: 0;
}

.quick-actions-header h2 {
  margin: 0;

  font-size: 15px;
  font-weight: 700;

  white-space: nowrap;

  color: #0f172a;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));

  flex: 1;
  gap: 10px;

  margin: 0;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-width: 0;
  min-height: 44px;
  padding: 9px 12px;

  color: #1e293b;
  text-decoration: none;

  background: #f8fafc;

  border: 1px solid #e2e8f0;
  border-radius: 10px;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.quick-action-btn:hover {
  background: #ffffff;
  border-color: #bfdbfe;

  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);

  transform: translateY(-1px);
}

.quick-action-btn:active {
  transform: translateY(0) scale(0.99);
}

.quick-action-icon {
  display: grid;
  place-items: center;

  flex: 0 0 auto;

  width: 30px;
  height: 30px;

  background: #eff6ff;

  border-radius: 8px;

  font-size: 15px;
}

.quick-action-text {
  display: flex;
  flex-direction: column;

  min-width: 0;
}

.quick-action-text strong {
  color: #0f172a;

  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;

  white-space: nowrap;
}

.quick-action-text small {
  display: none;
}

.chart-header {
  margin-bottom: 14px;
}

.chart-header h2 {
  margin: 0;

  font-size: 18px;
  font-weight: 700;

  color: #0f172a;
}

.chart-header p {
  margin-top: 3px;

  font-size: 13px;

  color: #64748b;
}

.chart-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
  margin-top: 28px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: all 0.25s ease;
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.chart-card h2 {
  margin: 0 0 20px 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

.chart-card canvas {
  width: 100% !important;
  height: 320px !important;
  max-height: 320px;
}

.recent-sale-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.recent-sale-item:last-child {
  border-bottom: none;
}

.recent-sale-item img {
  width: 70px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.widget-header h2 {
  margin: 0;
}

.widget-link {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.widget-link:hover {
  text-decoration: underline;
}

.customer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.customer-item:last-child {
  border-bottom: none;
}

.customer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-user {
  flex-shrink: 0;
  margin-top: auto;
  margin-bottom: 2px;

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;

  padding: 14px;

  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      #2563eb,
      #3b82f6);

  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
  font-weight: 700;
  font-size: 18px;
}

.user-name {
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.user-role {
  color: #94a3b8;
  font-size: 12px;
}

.user-arrow {
  margin-left: auto;
  color: #94a3b8;
  font-size: 18px;
}

.top-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 24px;
}

.top-search {
  position: relative;
  display: flex;
  flex: 1;
  min-width: 0;
  max-width: none;
}

.top-search input {
  width: 100%;

  padding: 14px 48px 14px 18px;

  border: 1px solid #dbe1e8;
  border-radius: 14px;

  background: #fff;

  font-size: 14px;

  transition: .25s;
}

.top-search input:hover {
  border-color: #94a3b8;
}

.top-search input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--muted);
  font-size: 18px;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

.date-pill {
  background: white;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--muted);
}

.notification-bell {
  position: relative;
  background: white;
  border: 1px solid var(--border);
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.25s;
}

.notification-bell span {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-bell:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, .10);
}

.search-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
}

.search-item:hover {
  background: #f8fafc;
}

.search-item:last-child {
  border-bottom: none;
}

.search-type {
  font-size: 12px;
  color: #6b7280;
}

.search-title {
  font-weight: 600;
}

.top-search-container {
  position: relative;
  width: 100%;
  max-width: none;
}

.search-results {
  position: absolute;
  top: 55px;
  left: 0;
  right: 0;
  z-index: 9999;

  display: none;
  max-height: 400px;
  margin-top: 8px;

  overflow-x: hidden;
  overflow-y: auto;

  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;

  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.vehicle-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.vehicle-modal-content {
  position: relative;

  width: min(100%, 900px);
  max-height: 90vh;

  padding: 28px;

  overflow-y: auto;
  overscroll-behavior: contain;

  background: #ffffff;

  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;

  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.3),
    0 8px 24px rgba(15, 23, 42, 0.12);

  animation: vehicle-modal-pop 0.22s ease-out;
}

@keyframes vehicle-modal-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
}

.modal-main-image {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 16px;
  margin: 16px 0;
}

.image-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.vehicle-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.vehicle-info-grid p {
  margin: 0;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
}

.modal-thumbnails {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.modal-thumbnails img {
  width: 90px;
  height: 65px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
}

.modal-thumbnails img.active {
  border-color: #2563eb;
}

.image-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 20px;
  gap: 10px;
}

.delete-image-btn {
  background: #ef4444;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  color: white;
  font-weight: 600;
}

.delete-image-btn:hover {
  background: #dc2626;
}

.cover-image-btn {
  background: #2563eb;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  color: white;
  font-weight: 600;
}

.cover-image-btn:hover {
  background: #1d4ed8;
}

/* ===== Broker Filters ===== */

.filters-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  padding: 22px;
  margin: 26px 0 32px 0;
  max-width: 1080px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.filters-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.filters-header p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.filters-body {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.filter-group label {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}

.filter-group input,
.filter-group select {
  height: 44px;
  border: 1px solid #dbe1e8;
  border-radius: 12px;
  padding: 0 13px;
  font-size: 14px;
  background: #f9fafb;
  color: #111827;
  outline: none;
}

.filter-group input:focus,
.filter-group select:focus {
  background: #ffffff;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.filters-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.filter-btn,
.clear-btn {
  height: 44px;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 700;
}

.filter-btn {
  background: #0f172a;
  color: white;
}

.clear-btn {
  background: #f3f4f6;
  color: #111827;
}

.clear-btn:hover {
  background: #e5e7eb;
  color: #111827;
}

.filter-action {
  display: flex;
  align-items: flex-end;
}

.filter-action .filter-btn {
  width: 100%;
}

.commission-detail-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.broker-details-content {
  display: block;
}

.broker-summary {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.broker-summary p {
  margin: 6px 0;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-paid {
  background: #dcfce7;
  color: #166534;
}

/* ===========================
   DealerDesk Button System
=========================== */

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: #2563eb;
  color: white;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-success {
  background: #16a34a;
  color: white;
}

.btn-success:hover {
  background: #15803d;
}

.btn-warning {
  background: #f59e0b;
  color: white;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: #dc2626;
  color: white;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-secondary {
  background: #f3f4f6;
  color: #111827;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

/* ===========================
   DealerDesk Status Badges
=========================== */

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-gray {
  background: #f3f4f6;
  color: #374151;
}

/* ==========================================
   DealerDesk Table Skeleton Loading
========================================== */

.skeleton-row td {
  padding: 16px 18px;
}

.skeleton-line {
  display: block;
  width: 100%;
  height: 14px;

  border-radius: 8px;

  background: linear-gradient(90deg,
      #eef2f6 25%,
      #f8fafc 50%,
      #eef2f6 75%);

  background-size: 200% 100%;

  animation: skeleton-shimmer 1.4s infinite linear;
}

.skeleton-line.short {
  width: 55%;
}

.skeleton-line.medium {
  width: 75%;
}

.skeleton-image {
  display: block;
  width: 60px;
  height: 40px;

  border-radius: 8px;

  background: linear-gradient(90deg,
      #eef2f6 25%,
      #f8fafc 50%,
      #eef2f6 75%);

  background-size: 200% 100%;

  animation: skeleton-shimmer 1.4s infinite linear;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ==========================================
   DealerDesk Empty State
========================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding: 60px 25px;

  border: 2px dashed #dbe3ec;
  border-radius: 18px;

  background: #fff;
}

.empty-state-icon {
  font-size: 54px;
  margin-bottom: 18px;
  opacity: .85;
}

.empty-state h3 {
  margin: 0;
  color: #1e293b;
  font-size: 22px;
  font-weight: 700;
}

.empty-state p {
  margin-top: 10px;
  max-width: 420px;

  color: #64748b;
  font-size: 15px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 24px;
}

/* ===========================
   DealerDesk Premium Tables
=========================== */

.table-card {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.table-card table {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.table-card thead th {
  position: sticky;
  top: 0;
  z-index: 2;

  padding: 14px 18px;

  background: #f8fafc;
  color: #475569;

  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;

  letter-spacing: 0.45px;
  text-transform: uppercase;
  white-space: nowrap;

  border-bottom: 1px solid #dfe5ec;
}

.table-card tbody td {
  padding: 16px 18px;

  color: #1e293b;
  font-size: 14px;
  line-height: 1.45;
  vertical-align: middle;

  border-bottom: 1px solid #edf1f5;
}

.table-card tbody tr {
  background: #ffffff;
  transition: background-color 0.18s ease;
}

.table-card tbody tr:hover {
  background: #f8fafc;
}

.table-card tbody tr:last-child td {
  border-bottom: 0;
}

.table-card th:first-child,
.table-card td:first-child {
  padding-left: 22px;
}

.table-card th:last-child,
.table-card td:last-child {
  padding-right: 22px;
}

.table-card td button,
.table-card td .btn {
  white-space: nowrap;
}

/* ===========================
   DealerDesk Form Polish
=========================== */

.form-box input:hover,
.form-box select:hover,
.form-box textarea:hover {

  border-color: #94a3b8;

}

.form-box input::placeholder,
.form-box textarea::placeholder {

  color: #9ca3af;

}

.form-box label {

  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;

}

.form-box {

  gap: 16px;

}

/* ===========================
   DealerDesk Toast Notification
=========================== */

.toast {
  position: fixed;
  top: 20px;
  right: 20px;

  min-width: 280px;

  padding: 16px 20px;

  border-radius: 12px;

  color: white;

  font-weight: 600;

  box-shadow: 0 12px 28px rgba(0, 0, 0, .18);

  z-index: 99999;

  animation: slideIn .25s ease;
}

.toast-success {
  background: #16a34a;
}

.toast-error {
  background: #dc2626;
}

@keyframes slideIn {

  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }

}

.empty-state {
  padding: 18px;
  border-radius: 12px;
  background: #f8fafc;
  color: #6b7280;
  font-size: 14px;
  text-align: center;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.report-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: all 0.25s ease;
}

.report-card:hover,
.report-card.active {
  transform: translateY(-4px);
  border-color: #2563eb;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.14);
}

.report-card h3 {
  margin: 0;
  font-size: 18px;
}

.report-card p {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 14px;
}

.reports-summary-grid {
  grid-template-columns: repeat(4, 1fr);
}

.reports-filter-body {
  grid-template-columns: repeat(2, 1fr) auto;
}



.reports-quick-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.reports-quick-filters button {
  min-width: 110px;
}

.report-total-row {
  background: #f8fafc;
  font-weight: 700;
}

.report-total-row td {
  border-top: 2px solid #e5e7eb;
}

.reports-summary-grid .card h3 {
  min-height: 42px;

  font-size: 14px;
  font-weight: 600;

  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.reports-summary-grid .card>span {
  display: block;
  margin-top: 8px;

  font-size: 34px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;

  color: #0f172a;
}

.report-card.active {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.report-card.active h3 {
  color: #1d4ed8;
}



.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

.settings-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.settings-card h2 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 22px;
}

.settings-form {
  box-shadow: none;
  border: none;
  padding: 0;
  margin: 0;
  max-width: 100%;
}

.settings-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

.settings-actions .btn {
  min-width: 160px;
}

.danger-zone {
  margin-top: 20px;
  border-color: #fecaca;
  background: #fffafa;
}

.settings-file-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
}

.settings-selected-file {
  flex: 1;
  min-width: 180px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  color: #475569;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-preview-box {
  margin-top: 15px;
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
}

.logo-preview-box img {
  max-width: 180px;
  max-height: 90px;
  display: none;
  margin: auto;
}

.logo-preview-box span {
  color: #6b7280;
  font-size: 14px;
}

/* ===========================
   Dashboard KPI Icons
=========================== */

.dashboard-kpi-grid .card::after {
  position: absolute;
  top: 18px;
  left: 18px;

  width: 48px;
  height: 48px;

  border-radius: 14px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f1f5f9;
  border: 1px solid #e2e8f0;

  font-size: 24px;
  opacity: 1;
}

.dashboard-kpi-grid .card:nth-child(1)::after {
  content: "🚗";
}

.dashboard-kpi-grid .card:nth-child(2)::after {
  content: "✅";
}

.dashboard-kpi-grid .card:nth-child(3)::after {
  content: "📈";
}

.dashboard-kpi-grid .card:nth-child(4)::after {
  content: "💰";
}

.dashboard-kpi-grid .card:nth-child(5)::after {
  content: "📊";
}

.dashboard-kpi-grid .card h3 {
  min-height: 48px;
  padding-left: 62px;
  padding-right: 0;
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}

.dashboard-kpi-grid .card>span {
  display: block;
  margin-top: 16px;
  font-size: 32px;
  line-height: 1.1;
  text-align: left;
  word-break: normal;
  letter-spacing: -1px;
}

.dashboard-full-widget {
  margin-top: 28px;
}

.recent-sale-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}

.recent-sale-item img {
  width: 70px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.recent-sale-amount {
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}



/* ===========================
   Dashboard Activity Items
=========================== */

.activity-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  align-items: center;
  gap: 14px;

  padding: 14px;
  margin-bottom: 12px;

  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 14px;

  transition: all 0.25s ease;
}

.activity-item:hover {
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.activity-image {
  width: 52px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
  background: #e5e7eb;
}

.activity-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;

  background: #e0f2fe;
  color: #0369a1;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 800;
}

.expense-avatar {
  background: #fee2e2;
  color: #991b1b;
}

.activity-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.activity-subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.activity-amount {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  white-space: nowrap;
}

/* ===========================
   Responsive Layout
=========================== */

@media (max-width: 1280px) {
  .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reports-grid,
  .reports-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .main-content {
    margin-left: 260px;
    padding: 24px;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-widgets {
    grid-template-columns: 1fr;
  }

  .top-bar {
    gap: 20px;
  }

  .quick-actions-card {
    display: block;
    margin: 12px 0;
    padding: 12px;
  }

  .quick-actions-header {
    min-width: 0;
    margin-bottom: 10px;
  }

  .quick-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .quick-action-btn {
    justify-content: flex-start;
    min-height: 42px;
    padding: 8px 10px;
  }

  .quick-action-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
}

@media (max-width: 768px) {
  /* Main layout */

  .sidebar {
    position: fixed;
  }

  .sidebar a {
    padding: 10px 12px;
    font-size: 14px;
  }

  .main-content {
    width: 100%;
    margin-left: 0;
    padding: 16px;
  }

  .grid,
  .dashboard-kpi-grid,
  .reports-grid,
  .reports-summary-grid,
  .settings-grid,
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }

  /* Branding */

  .brand-logo {
    width: 42px;
    height: 42px;
    font-size: 20px;
  }

  .brand-text h2 {
    font-size: 18px;
  }

  /* Page headings */

  .page-header h1 {
    font-size: 24px;
  }

  .page-header p {
    font-size: 14px;
  }

  /* Top search toolbar */

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .top-search-container {
    width: 100%;
    max-width: none;
  }

  .top-search {
    width: 100%;
    max-width: none;
  }

  .top-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-end;
  }

  .date-pill {
    text-align: center;
  }

  /* KPI cards */

  /* KPI cards */

  .card>span {
    font-size: 22px;
    word-break: normal;
  }

  .dashboard-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
  }

  .dashboard-kpi-grid .card {
    min-width: 0;
    min-height: 118px;
    padding: 16px;
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
  }

  .dashboard-kpi-grid .card:last-child {
    grid-column: 1 / -1;
  }

  .dashboard-kpi-grid .card::after {
    top: 14px;
    left: 14px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 19px;
  }

  .dashboard-kpi-grid .card h3 {
    min-height: 40px;
    padding-left: 50px;
    font-size: 12px;
    line-height: 1.25;
  }

  .dashboard-kpi-grid .card>span {
    margin-top: 14px;
    font-size: clamp(18px, 5.5vw, 24px);
    line-height: 1.1;
    letter-spacing: -0.5px;
    overflow-wrap: anywhere;
  }

  .dashboard-kpi-grid .card:last-child>span {
    font-size: clamp(22px, 6vw, 28px);
  }

  .reports-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
  }

  .reports-summary-grid .card {
    min-width: 0;
    min-height: 110px;
    padding: 16px;
    border-radius: 15px;
  }

  .reports-summary-grid .card:last-child {
    grid-column: 1 / -1;
  }

  .reports-summary-grid .card h3 {
    min-height: auto;
    font-size: 12px;
    line-height: 1.3;
  }

  .reports-summary-grid .card>span {
    font-size: clamp(18px, 5vw, 24px);
    margin-top: 12px;
    overflow-wrap: anywhere;
  }

  /* Chart */

  .chart-card {
    padding: 14px;
  }

  .chart-card canvas {
    height: 230px !important;
    max-height: 230px;
  }

  /* Tables */

  .table-wrapper {
    -webkit-overflow-scrolling: touch;
  }

  /* Filters */

  .filters-card {
    width: 100%;
    max-width: 100%;
    padding: 16px;
    margin: 18px 0;
    overflow: hidden;
  }

  .filters-header {
    flex-direction: column;
    gap: 8px;
  }

  .filters-body,
  .reports-filter-body {
    width: 100% !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .filter-group,
  .filter-action {
    width: 100% !important;
  }

  .filter-group input,
  .filter-group select,
  .filter-action button,
  .filter-btn,
  .clear-btn {
    width: 100% !important;
    max-width: 100% !important;
  }

  .filters-footer {
    width: 100%;
    flex-direction: column;
    justify-content: stretch;
    gap: 10px;
  }

  /* Report quick filters */

  .reports-quick-filters {
    flex-direction: column;
  }

  .reports-quick-filters button {
    width: 100%;
  }

  /* Recent sales */

  .recent-sale-item {
    grid-template-columns: 56px 1fr;
  }

  .recent-sale-item img {
    width: 56px;
    height: 44px;
  }

  .recent-sale-amount {
    grid-column: 2;
  }

  /* Dashboard activity */

  .activity-item {
    grid-template-columns: 44px 1fr;
  }

  .activity-amount {
    grid-column: 2;
  }

  /* Settings */

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .table-wrapper {
    width: 100%;
    overflow-x: auto;
    border-radius: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrapper table {
    min-width: 760px;
  }

  .inventory-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;

    margin: 14px 0;
  }

  .inventory-toolbar .search-box {
    max-width: none;
  }

  .inventory-toolbar .filter-buttons {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;

    padding-bottom: 4px;
  }

  .inventory-toolbar .filter-buttons button {
    flex: 0 0 auto;
  }
}

.mobile-menu-btn,
.sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  body.menu-open {
    overflow: hidden;
  }

  .mobile-menu-btn {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 10002;

    width: 44px;
    height: 44px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border-radius: 12px;

    background: #0f172a;
    color: white;

    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.25);
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;

    width: min(290px, 86vw);
    height: 100vh;
    height: 100dvh;
    padding-bottom: max(24px, env(safe-area-inset-bottom));

    z-index: 10001;
    overflow-y: auto;

    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;

    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
  }

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

  .main-content {
    padding-top: 74px;
  }

  /* Move menu button when sidebar is open */
  body.menu-open .mobile-menu-btn {
    left: auto;
    right: 14px;

    background: rgba(255, 255, 255, 0.15);
    color: #fff;

    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
  }

  body.menu-open .mobile-menu-btn {
    display: none;
  }

  .sidebar-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 40px;
    height: 40px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.10);
    color: white;

    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: none;

    z-index: 2;
  }

  .sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.18);
  }
}

.sidebar-close-btn {
  display: none;
}

.top-search-container {
  position: sticky;
  top: 0;
  z-index: 100;

  background: var(--bg);

  padding-bottom: 12px;
}

/* ==========================================
   Backup Restore Toolbar
========================================== */

.backup-restore-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.selected-backup-file {
  flex: 1;
  min-width: 180px;

  padding: 10px 14px;

  background: #f8fafc;

  border: 1px solid #dbe4ee;
  border-radius: 10px;

  color: #475569;
  font-size: 14px;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   Settings Subscription Card
========================================== */

.settings-grid {
  align-items: start;
  grid-template-areas:
    "business preferences"
    "business subscription"
    "backup developer";
}

.settings-grid>.settings-card:nth-child(1) {
  grid-area: business;
}

.settings-grid>.settings-card:nth-child(2) {
  grid-area: preferences;
}

.settings-grid .backup-management-card {
  grid-area: backup;
}

#subscriptionStatusCard {
  grid-area: subscription;
}

#developerModeCard {
  grid-area: developer;
}

#subscriptionStatusCard .settings-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.2fr);
  gap: 0;

  margin-top: 20px;

  overflow: hidden;

  border: 1px solid #e2e8f0;
  border-radius: 12px;

  background: #ffffff;
}

#subscriptionStatusCard .settings-form>label,
#subscriptionStatusCard .settings-form>p {
  min-height: 52px;
  margin: 0;
  padding: 14px 16px;

  display: flex;
  align-items: center;

  border-bottom: 1px solid #e2e8f0;
}

#subscriptionStatusCard .settings-form>label {
  background: #f8fafc;
  color: #475569;

  font-size: 13px;
  font-weight: 700;
}

#subscriptionStatusCard .settings-form>p {
  color: #0f172a;
  font-weight: 600;
}

#subscriptionStatusCard .badge {
  padding: 8px 16px;

  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

#subscriptionRemaining {
  font-size: 16px;
  font-weight: 750 !important;
}

#subscriptionStatusMessage {
  grid-column: 1 / -1;

  min-height: auto !important;
  padding: 15px 16px !important;

  background: #f8fafc;
  color: #475569 !important;

  font-size: 13px;
  font-weight: 500 !important;
  line-height: 1.5;
}

#subscriptionStatusCard .settings-form>label:nth-last-of-type(1),
#subscriptionAccountAccess {
  border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-areas:
      "business"
      "preferences"
      "backup"
      "subscription"
      "developer";
  }

  #subscriptionStatusCard .settings-form {
    grid-template-columns: 1fr;
  }

  #subscriptionStatusCard .settings-form>label {
    min-height: auto;
    padding-bottom: 5px;

    border-bottom: 0;
  }

  #subscriptionStatusCard .settings-form>p {
    min-height: auto;
    padding-top: 5px;
  }

  #subscriptionStatusMessage {
    grid-column: 1;
  }
}

/* ==========================================
   Global Subscription Banner
========================================== */

.subscription-banner {
  display: flex;
  align-items: center;
  gap: 16px;

  margin: 18px 0 24px;
  padding: 16px 20px;

  border-radius: 14px;
  border: 1px solid;

  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.subscription-banner-icon {
  width: 48px;
  height: 48px;

  border-radius: 12px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 20px;

  flex-shrink: 0;
}

.subscription-banner-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-banner-content strong {
  font-size: 15px;
  font-weight: 700;
}

.subscription-banner-content span {
  font-size: 14px;
  color: #475569;
}

.subscription-banner-trial {
  background: #fffbeb;
  border-color: #fcd34d;
}

.subscription-banner-trial .subscription-banner-icon {
  background: #fef3c7;
  color: #b45309;
}

.subscription-banner-active {
  background: #eff6ff;
  border-color: #93c5fd;
}

.subscription-banner-active .subscription-banner-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.subscription-banner-warning {
  background: #fff7ed;
  border-color: #fdba74;
}

.subscription-banner-warning .subscription-banner-icon {
  background: #ffedd5;
  color: #c2410c;
}

.subscription-banner-urgent {
  background: #fef2f2;
  border-color: #fca5a5;
}

.subscription-banner-urgent .subscription-banner-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.subscription-banner-grace {
  background: #fff7ed;
  border-color: #fdba74;
}

.subscription-banner-grace .subscription-banner-icon {
  background: #fed7aa;
  color: #c2410c;
}

@media (max-width: 768px) {
  .subscription-banner {
    align-items: flex-start;
    padding: 14px;
  }

  .subscription-banner-icon {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }
}

/* ==========================================
   Subscription Expired Page
========================================== */

.subscription-expired-page {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34%),
    linear-gradient(135deg, #0f172a 0%, #111827 55%, #1e293b 100%);
}

.subscription-expired-container {
  width: 100%;
  max-width: 760px;
}

.subscription-expired-card {
  padding: 38px;

  background: #ffffff;

  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;

  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.35),
    0 10px 30px rgba(15, 23, 42, 0.16);
}

.subscription-expired-brand {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-bottom: 30px;
}

.subscription-expired-logo {
  width: 54px;
  height: 54px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 16px;

  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;

  font-size: 24px;
  font-weight: 800;

  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.subscription-expired-brand h1 {
  margin: 0;

  color: #0f172a;

  font-size: 25px;
  line-height: 1.1;
}

.subscription-expired-brand p {
  margin: 5px 0 0;

  color: #64748b;

  font-size: 13px;
}

.subscription-expired-icon {
  width: 70px;
  height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 18px;

  border-radius: 20px;

  background: #fee2e2;
  color: #b91c1c;

  font-size: 28px;
}

.subscription-expired-status {
  display: inline-flex;

  margin-bottom: 16px;
  padding: 7px 13px;

  border-radius: 999px;

  background: #fee2e2;
  color: #991b1b;

  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.subscription-expired-card h2 {
  margin: 0;

  color: #0f172a;

  font-size: 30px;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.subscription-expired-description {
  margin: 14px 0 0;

  max-width: 640px;

  color: #475569;

  font-size: 15px;
  line-height: 1.7;
}

.subscription-expired-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;

  margin-top: 26px;
  padding: 18px;

  border: 1px solid #bfdbfe;
  border-radius: 16px;

  background: #eff6ff;
}

.subscription-expired-notice>i {
  margin-top: 2px;

  color: #1d4ed8;
  font-size: 20px;
}

.subscription-expired-notice div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.subscription-expired-notice strong {
  color: #1e3a8a;
  font-size: 14px;
}

.subscription-expired-notice span {
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.subscription-expired-contact {
  margin-top: 26px;
}

.subscription-expired-contact h3 {
  margin: 0;

  color: #0f172a;

  font-size: 18px;
}

.subscription-expired-contact p {
  margin: 7px 0 0;

  color: #64748b;

  font-size: 14px;
}

.subscription-expired-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;

  margin-top: 26px;
}

.subscription-expired-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  min-height: 44px;

  text-decoration: none;
}

@media (max-width: 768px) {
  .subscription-expired-page {
    align-items: flex-start;
    padding: 16px;
  }

  .subscription-expired-card {
    padding: 24px;
    border-radius: 20px;
  }

  .subscription-expired-card h2 {
    font-size: 25px;
  }

  .subscription-expired-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .subscription-expired-actions .btn {
    width: 100%;
  }
}

/* =========================
   ADD BROKER MODAL
========================= */

#addBrokerModal .vehicle-modal-content {
  max-width: 600px;
}

#addBrokerForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 20px;
}

#addBrokerForm .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#addBrokerForm label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

#addBrokerForm input,
#addBrokerForm textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
}

#addBrokerForm textarea {
  resize: vertical;
  min-height: 100px;
}

#addBrokerForm input:focus,
#addBrokerForm textarea:focus {
  outline: none;
  border-color: #2563eb;
}

#addBrokerForm button[type="submit"] {
  align-self: flex-start;
}