/* src/styles.css */
:root {
  --bg: #0a0a0a;
  --panel: #111318;
  --panel-soft: #151923;
  --border: #232936;
  --text: #f5f7fb;
  --muted: #b2bccf;
  --shadow: rgba(0,0,0,0.24);
  --brand-accent: #10b981;
}
:root[data-theme=light] {
  --bg: #f3f5f8;
  --panel: #ffffff;
  --panel-soft: #f7f8fb;
  --border: #dde3ec;
  --text: #0f1728;
  --muted: #5e6b80;
  --shadow: rgba(16,24,40,0.08);
}
* {
  box-sizing: border-box;
}
html,
body,
#root {
  min-height: 100%;
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at top left,
      color-mix(in srgb, var(--brand-accent) 20%, transparent),
      transparent 30%),
    radial-gradient(
      circle at bottom right,
      rgba(59, 130, 246, 0.12),
      transparent 32%),
    var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
a {
  color: inherit;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  line-height: 1.35;
}
textarea {
  min-height: 140px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 16px;
}
.main-area {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.content-area {
  padding: 24px;
  display: grid;
  gap: 20px;
}
.panel {
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}
.panel,
.panel-soft,
.card {
  border-radius: 24px;
}
.card {
  border: 1px solid var(--border);
  box-shadow: 0 14px 36px var(--shadow);
  padding: 24px;
}
.panel-soft {
  border: 1px solid var(--border);
  background: var(--panel-soft);
  padding: 16px;
}
.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: color-mix(in srgb, var(--brand-accent) 20%, transparent);
  color: color-mix(in srgb, var(--brand-accent) 80%, white);
}
.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.nav-list {
  display: grid;
  gap: 8px;
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  border-radius: 18px;
}
.nav-button:hover {
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
}
.nav-button-active {
  background: color-mix(in srgb, var(--brand-accent) 16%, transparent);
  outline: 1px solid color-mix(in srgb, var(--brand-accent) 40%, transparent);
  color: color-mix(in srgb, var(--brand-accent) 78%, white);
}
.topbar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  border-radius: 16px;
  padding: 0 12px;
  min-width: 320px;
  flex: 1 1 320px;
  max-width: 520px;
}
.search-wrap input {
  border: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  min-height: 46px;
}
.search-wrap input:focus {
  outline: none;
}
.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 11px 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
}
.btn-small {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
}
.btn-full {
  width: 100%;
}
.btn-secondary:hover {
  background: var(--panel-soft);
}
.btn-primary {
  background: var(--brand-accent);
  color: #04210f;
  border-color: var(--brand-accent);
  font-weight: 700;
}
.btn-primary:hover {
  filter: brightness(1.04);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid transparent;
}
.success {
  background: rgba(16, 185, 129, 0.14);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.28);
}
.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.28);
}
.danger {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.28);
}
.info {
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.28);
}
.neutral {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.28);
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.88rem;
}
.tiny {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.strong {
  font-weight: 700;
}
.space-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.align-start {
  align-items: flex-start;
}
.inline-gap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wrap-gap {
  flex-wrap: wrap;
}
.stack-md {
  display: grid;
  gap: 12px;
}
.stack-lg {
  display: grid;
  gap: 20px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.grid-kpi {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.grid-2 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 10px;
}
.icon-box {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--panel-soft);
}
.feed-message {
  margin: 8px 0 6px;
  font-weight: 600;
}
.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead {
  background: color-mix(in srgb, var(--panel-soft) 88%, transparent);
}
th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: top;
}
tr:hover td {
  background: color-mix(in srgb, var(--panel-soft) 50%, transparent);
}
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.field span {
  font-weight: 600;
}
.notice {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
}
.notice.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.24);
}
.notice.success {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.24);
}
.loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--text);
}
.checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}
.defect-form-shell {
  gap: 16px;
}
.defect-checklist {
  display: grid;
  gap: 10px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.defect-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
}
.defect-check-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}
.defect-check-item span {
  font-weight: 500;
  line-height: 1.35;
}
.defect-report-panels {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.driver-calendar {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.driver-calendar-head {
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-accent) 16%, transparent);
  font-weight: 700;
  text-align: center;
}
.driver-calendar-day {
  min-height: 164px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel-soft) 82%, transparent);
  display: grid;
  gap: 10px;
  align-content: start;
}
.driver-calendar-day-muted {
  opacity: 0.45;
}
.driver-calendar-day-active {
  background: color-mix(in srgb, var(--brand-accent) 16%, var(--panel) 84%);
}
.driver-calendar-date {
  font-size: 0.92rem;
  font-weight: 800;
}
.driver-calendar-duty-stack {
  display: grid;
  gap: 8px;
}
.driver-calendar-duty {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}
.driver-calendar-duty span {
  font-size: 0.82rem;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.setup-subgrid {
  align-items: end;
}
.map-link {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: color-mix(in srgb, var(--brand-accent) 78%, white);
  text-decoration: none;
}
.auth-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
}
.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 15% 20%,
      color-mix(in srgb, var(--brand-accent) 22%, transparent),
      transparent 24%),
    radial-gradient(
      circle at 85% 10%,
      rgba(59, 130, 246, 0.18),
      transparent 22%),
    radial-gradient(
      circle at 70% 85%,
      rgba(245, 158, 11, 0.12),
      transparent 26%);
  pointer-events: none;
}
.auth-topbar,
.auth-content {
  position: relative;
  z-index: 1;
}
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-brand {
  margin-bottom: 0;
  width: fit-content;
}
.auth-content {
  display: grid;
  align-items: center;
  min-height: calc(100vh - 120px);
}
.auth-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.auth-panel,
.auth-hero {
  padding: 28px;
}
.auth-panel h2,
.auth-hero h1,
.auth-hero h2 {
  margin-top: 12px;
  margin-bottom: 10px;
}
.auth-header {
  align-items: flex-start;
}
.auth-feature-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}
.account-card {
  display: grid;
  gap: 10px;
}
.live-card {
  margin-top: 22px;
}
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
.spin {
  animation: spin 1s linear infinite;
}
@media (max-width: 1280px) {
  .grid-kpi,
  .grid-4,
  .grid-3,
  .grid-2,
  .auth-grid,
  .defect-report-panels {
    grid-template-columns: 1fr;
  }
  .defect-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .driver-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .topbar {
    padding: 16px;
  }
  .content-area {
    padding: 16px;
  }
  .auth-shell {
    padding: 16px;
  }
  .auth-topbar,
  .page-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrap {
    min-width: 100%;
    max-width: none;
  }
  .defect-checklist {
    grid-template-columns: 1fr;
  }
  .driver-calendar {
    grid-template-columns: 1fr;
  }
}
