/* Saad Park visual identity overrides. */
body {
  font-family: Ubuntu, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

/* Desktop-only custom caption bar. It is never displayed in the website. */
.desktop-titlebar {
  display: none;
}

.desktop-app {
  padding-top: 40px;
}

.desktop-app .desktop-titlebar {
  position: fixed;
  z-index: 200;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  background: #fff;
  border-bottom: 1px solid #e6e9f0;
  box-shadow: 0 1px 8px rgba(16, 25, 46, .05);
  color: #10192e;
  -webkit-app-region: drag;
}

.desktop-titlebar-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1px;
}

.desktop-titlebar-caption img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: contain;
}

.desktop-window-controls {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  height: 40px;
  -webkit-app-region: no-drag;
}

.window-control {
  display: grid;
  width: 46px;
  height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: #344054;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.window-control:hover { background: #edf1f8; color: #10192e; }
.window-close:hover { background: #e72e36; color: #fff; }

.window-control svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.desktop-app .auth-screen,
.desktop-app .app-shell { min-height: calc(100vh - 40px); }

.desktop-app .sidebar { top: 40px; height: calc(100vh - 40px); }

.desktop-app.window-maximized .desktop-titlebar { border-radius: 0; }

/* Forms must stay editable; the rest of the interface cannot be selected. */
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

.brand-mark {
  display: block;
  width: 43px;
  height: 43px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #d8dce8;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -5px;
}

.nav-item .icon {
  width: 19px;
  height: 19px;
  margin-right: 7px;
  color: #c9d1e2;
}

.nav-item.active .icon,
.nav-item:hover .icon {
  color: #fff;
}

.icon-button .icon {
  vertical-align: -5px;
}

.list-icon .icon,
.inline-icon .icon,
.btn .icon {
  vertical-align: -5px;
}

#mobile-download-screen {
  display: none;
}

@media (max-width: 767px) {
  #mobile-download-screen {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #fff;
    text-align: center;
  }

  .mobile-download-content {
    display: grid;
    justify-items: center;
    gap: 22px;
    max-width: 340px;
  }

  .mobile-download-content a {
    display: inline-block;
  }

  .mobile-download-content img {
    display: block;
    width: min(280px, 100%);
    height: auto;
  }

  .mobile-download-content p {
    margin: 0;
    color: #1f2937;
    font-family: Ubuntu, ui-sans-serif, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
  }

  #auth-screen,
  #app-shell,
  #modal,
  #toast-region {
    display: none !important;
  }
}

/* ==========================================================================
   SETTINGS BUTTON & MODAL
   ========================================================================== */

/* Settings Nav Item inside Sidebar bottom */
.settings-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e8ebf3;
  padding: 10px 8px;
  font: inherit;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
  gap: 4px;
}

.settings-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.settings-nav-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  transition: transform 0.3s ease;
  margin: 0;
  color: inherit;
}

.settings-nav-btn:hover svg {
  transform: rotate(45deg);
}

/* Profile Avatar in Topbar */
.profile-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--line);
  background: #fff;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

/* Settings Modal UI layout */
.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 10px 0;
}

.avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.avatar-upload-container {
  position: relative;
  width: 100px;
  height: 100px;
}

.settings-avatar-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue-soft);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.avatar-upload-label {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background-color 0.2s ease;
  margin: 0;
}

.avatar-upload-label:hover {
  transform: scale(1.1);
  background: #1d4fd8;
}

.avatar-upload-label svg {
  width: 16px;
  height: 16px;
  color: #fff;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  vertical-align: middle !important;
  margin: 0 !important;
}

.user-meta h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.user-meta span {
  color: var(--muted);
  font-size: 13px;
}

.settings-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 5px 0;
}

.settings-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.settings-form {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.settings-form label {
  flex: 1;
  margin: 0;
}

.theme-picker-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--page);
  padding: 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

.theme-picker-container span {
  font-weight: 600;
}

.theme-options {
  display: flex;
  gap: 8px;
}

.theme-opt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid #dce1ea;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-opt-btn:hover {
  background: #f7f8fb;
}

.theme-opt-btn.active {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
}

.theme-opt-btn svg {
  width: 16px;
  height: 16px;
  vertical-align: middle !important;
  margin: 0 !important;
}

/* ==========================================================================
   DARK THEME VARIABLE OVERRIDES & STYLES
   ========================================================================== */
body.dark-theme {
  --page: #0b0f19;
  --card: #151e33;
  --ink: #f4f6fa;
  --muted: #8b9bb4;
  --line: #263554;
  --shadow: 0 15px 35px rgba(0, 0, 0, .3);
}

body.dark-theme .topbar {
  background: var(--card);
  border-bottom-color: var(--line);
}

body.dark-theme .desktop-titlebar {
  background: var(--card);
  color: var(--ink);
  border-bottom-color: var(--line);
}

body.dark-theme .window-control {
  color: #8b9bb4;
}

body.dark-theme .window-control:hover {
  background: #202b46;
  color: #fff;
}

body.dark-theme .modal-card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.6);
}

body.dark-theme .modal-close {
  color: var(--muted);
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #0d1117;
  border-color: #30363d;
  color: #fff;
}

body.dark-theme input:focus,
body.dark-theme select:focus,
body.dark-theme textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 99, 232, 0.25);
}

body.dark-theme label {
  color: #8b9bb4;
}

body.dark-theme .info-item {
  background: #0d1117;
  border: 1px solid var(--line);
}

body.dark-theme .document-row {
  border-bottom-color: var(--line);
}

body.dark-theme .btn-secondary {
  border-color: #30363d;
  background: #21262d;
  color: #fff;
}

body.dark-theme .btn-secondary:hover {
  background: #30363d;
}

body.dark-theme .table-link {
  color: #5d8af5;
}

body.dark-theme .stat-card.accent strong { color: #5d8af5; }
body.dark-theme .stat-card.warning strong { color: #fbbf24; }
body.dark-theme .stat-card.danger strong { color: #f87171; }

body.dark-theme th {
  color: #8b9bb4;
}

body.dark-theme .fuel-result {
  background: rgba(45, 99, 232, 0.15);
  color: #9cb3f7;
}

body.dark-theme .list-row {
  border-bottom-color: var(--line);
}

body.dark-theme .vehicle-card:hover {
  border-color: var(--blue);
}

body.dark-theme .profile-avatar-img {
  border-color: var(--line);
  background: var(--navy-2);
}

body.dark-theme .settings-avatar-large {
  border-color: var(--navy-2);
}

body.dark-theme .theme-picker-container {
  background: rgba(255, 255, 255, 0.02);
}

body.dark-theme .theme-opt-btn {
  background: #151e33;
  border-color: #263554;
  color: #fff;
}

body.dark-theme .theme-opt-btn:hover {
  background: #1c263f;
}

body.dark-theme .theme-opt-btn.active {
  background: rgba(45, 99, 232, 0.2);
  border-color: var(--blue);
  color: #fff;
}

body.dark-theme .icon-button {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}

body.dark-theme .icon-button:hover {
  background: #202b46;
}

body.dark-theme .list-icon {
  background: rgba(45, 99, 232, 0.15);
  color: #5d8af5;
}

body.dark-theme .auth-screen {
  background: #0b0f19;
}

/* ==========================================================================
   SQUARE DESIGN OVERRIDES & SIMPLIFIED COLOR SCHEME
   ========================================================================== */

/* Remove border-radius for cards, buttons, inputs, panels, and modals */
.nav-item,
.btn,
.settings-nav-btn,
.theme-opt-btn,
.icon-button,
input,
select,
textarea,
.stat-card,
.panel,
.detail-card,
.modal-card,
.info-item,
.fuel-result {
  border-radius: 0 !important;
}

/* Neutralize the light blue tint in light mode with simple, clean colors */
:root {
  --blue-soft: #f1f5f9 !important; /* Neutral light gray instead of soft blue */
}

/* Polished minimalist dark mode variables */
body.dark-theme {
  --page: #0a0a0a;
  --card: #141414;
  --ink: #ffffff;
  --muted: #888888;
  --line: #222222;
  --blue-soft: #1f1f1f !important;
  --blue: #3b82f6;
  --shadow: 0 15px 35px rgba(0, 0, 0, .5);
}

/* Specific elements background override in dark mode */
body.dark-theme .theme-picker-container {
  background: #1c1c1c;
  border-color: #222222;
}

body.dark-theme .theme-opt-btn {
  background: #141414;
  border-color: #222222;
  color: #ffffff;
}

body.dark-theme .theme-opt-btn:hover {
  background: #1f1f1f;
}

body.dark-theme .theme-opt-btn.active {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
}

body.dark-theme .btn-secondary {
  border-color: #222222;
  background: #1c1c1c;
  color: #ffffff;
}

body.dark-theme .btn-secondary:hover {
  background: #262626;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme textarea {
  background: #0a0a0a;
  border-color: #222222;
  color: #ffffff;
}

body.dark-theme .info-item {
  background: #141414;
  border-color: #222222;
}

body.dark-theme .profile-avatar-img,
body.dark-theme .settings-avatar-large {
  border-color: #222222;
}

body.dark-theme .icon-button {
  background: #141414;
  border-color: #222222;
  color: #ffffff;
}

body.dark-theme .icon-button:hover {
  background: #1f1f1f;
}

body.dark-theme .list-icon {
  background: #1f1f1f;
  color: #3b82f6;
}

/* Simplify layout borders and sidebar colors */
.topbar {
  border-top: none !important;
}

.sidebar {
  background: #111827 !important;
}

.nav-item:hover, .nav-item.active {
  background: #1f2937 !important;
}

