/* ═══════════════════════════════════════════════════════════
   Autosoft — Parc Auto Manager  |  style.css
   ═══════════════════════════════════════════════════════════ */

:root {
  --sidebar-width: 240px;
  --sidebar-bg:    #0f1623;
  --sidebar-hover: #1c2740;
  --sidebar-active:#1e3a5f;
  --accent:        #3b82f6;
  --accent-light:  #60a5fa;
  --topbar-h:      56px;
  --content-bg:    #f0f4f8;
}

/* ─── Layout ─────────────────────────────────────────────── */
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--content-bg);
  overflow-x: hidden;
}

.wrapper { min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .25s ease;
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-header span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-separator,
.sidebar.collapsed .user-info .ms-2,
.sidebar.collapsed .btn-logout { display: none; }

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
}
.brand i { font-size: 1.5rem; color: var(--accent-light); flex-shrink: 0; }

/* Nav */
.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
}
.nav-separator {
  padding: 16px 18px 4px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  white-space: nowrap;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item .nav-link i { font-size: 1.1rem; flex-shrink: 0; }
.nav-item .nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}
.nav-item.active .nav-link {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
}

/* Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.user-info {
  display: flex;
  align-items: center;
  color: rgba(255,255,255,.8);
  font-size: .875rem;
}
.user-info i { font-size: 1.6rem; flex-shrink: 0; }
.btn-logout {
  width: 100%;
  background: rgba(239,68,68,.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,.3);
  font-size: .8rem;
  padding: 5px 10px;
}
.btn-logout:hover {
  background: rgba(239,68,68,.3);
  color: #fff;
}

/* ─── Content area ───────────────────────────────────────── */
.content-area {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}
.sidebar.collapsed ~ .content-area { margin-left: 64px; }

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: #fff;
  padding: 0 24px;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.sidebar-toggle {
  color: #64748b;
  border: none;
  background: none;
  font-size: 1.3rem;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.sidebar-toggle:hover {
  background: #f1f5f9;
  color: #1e293b;
}
.page-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -.01em;
}

/* Main */
.main-content {
  padding-top: 24px;
  padding-bottom: 40px;
}

/* ─── Cards ──────────────────────────────────────────────── */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  transition: box-shadow .2s;
}
.card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,.09), 0 4px 20px rgba(0,0,0,.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid #f1f5f9;
  font-weight: 600;
  font-size: .9rem;
  color: #1e293b;
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
}

/* KPI cards */
.kpi-card {
  border-radius: 12px;
  padding: 20px 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.kpi-card .kpi-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }
.kpi-card .kpi-label { font-size: .8rem; opacity: .85; margin-top: 4px; }
.kpi-card .kpi-icon {
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  opacity: .2;
}
.kpi-blue   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.kpi-green  { background: linear-gradient(135deg, #22c55e, #16a34a); }
.kpi-orange { background: linear-gradient(135deg, #f97316, #ea580c); }
.kpi-purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }

/* ─── Analiză Financiară — section dividers ──────────────── */
.fin-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: .01em;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 20px;
  margin-top: 8px;
}
.fin-section-period {
  font-size: .78rem;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 4px;
}

/* ─── Analiță Financiară — KPI boxes ────────────────────── */
.fin-kpi-box {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.07);
  border: 1px solid #e2e8f0;
}
.fin-kpi-label { font-size: .75rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.fin-kpi-value { font-size: 1.5rem; font-weight: 700; color: #1e293b; line-height: 1.2; }
.fin-kpi-sub   { font-size: .78rem; color: #94a3b8; margin-top: 4px; }

/* ─── Status badges ──────────────────────────────────────── */
.badge-status {
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: .02em;
}

/* ─── Car card (lista masini) ────────────────────────────── */
.car-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  transition: box-shadow .2s, transform .2s;
  background: #fff;
  text-decoration: none;
  color: inherit;
  display: block;
}
.car-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  transform: translateY(-2px);
  color: inherit;
}
.car-card-img {
  height: 180px;
  object-fit: cover;
  width: 100%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #94a3b8;
}
.car-card-img img { width: 100%; height: 100%; object-fit: cover; }
.car-card-body { padding: 14px 16px; }
.car-card-title { font-size: .95rem; font-weight: 700; color: #0f172a; }
.car-card-sub   { font-size: .8rem; color: #64748b; }
.car-card-price { font-size: .85rem; font-weight: 600; color: #0f172a; margin-top: 8px; }

/* ─── Car detail / dashboard masina ─────────────────────── */
.car-hero {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  margin-bottom: 24px;
}
.car-hero-img {
  height: 300px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.car-hero-img img { width: 100%; height: 100%; object-fit: cover; }
.car-hero-placeholder { font-size: 5rem; color: #94a3b8; }

.finance-summary {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-radius: 12px;
  color: #fff;
  padding: 20px 24px;
}
.finance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: .875rem;
}
.finance-row:last-child { border-bottom: none; }
.finance-row .label { color: rgba(255,255,255,.65); }
.finance-row .value { font-weight: 600; }
.finance-profit { color: #4ade80; }
.finance-loss   { color: #f87171; }
.finance-neutral { color: rgba(255,255,255,.8); }

/* Compliance checklist */
.compliance-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  transition: border-color .15s;
}
.compliance-item.active { border-color: #86efac; background: #f0fdf4; }
.compliance-item.expired { border-color: #fca5a5; background: #fff5f5; }
.compliance-item.expiring-soon { border-color: #fde68a; background: #fffbeb; }

/* Galerie foto */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.photo-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e2e8f0;
  cursor: pointer;
}
.photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .2s;
}
.photo-thumb:hover img { transform: scale(1.05); }
.photo-thumb .photo-actions {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .2s;
}
.photo-thumb:hover .photo-actions { opacity: 1; }
.photo-main-badge {
  position: absolute;
  top: 6px; left: 6px;
  background: var(--accent);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* Tabs */
.nav-tabs .nav-link {
  font-size: .875rem;
  font-weight: 500;
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 16px;
  border-radius: 0;
}
.nav-tabs .nav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}
.nav-tabs { border-bottom: 1px solid #e2e8f0; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #94a3b8;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.upload-zone:hover {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
}

/* Table */
.table th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #475569;
  font-weight: 700;
  background: #f8fafc;
  white-space: nowrap;
  padding: 10px 14px;
}
.table td {
  font-size: .875rem;
  vertical-align: middle;
  padding: 9px 14px;
  color: #1e293b;
}
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th {
  background-color: #eff6ff;
}
/* No-wrap pentru coloane cu date/ani */
.table td.nowrap,
.col-nowrap {
  white-space: nowrap;
}

/* Flags / pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ─── Login page ─────────────────────────────────────────── */
.login-page {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo i { font-size: 2.5rem; color: var(--accent); }
.login-logo h4 { font-weight: 700; color: #0f172a; margin-top: 8px; }
.login-logo p { color: #64748b; font-size: .875rem; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .sidebar .sidebar-header span,
  .sidebar .nav-link span,
  .sidebar .nav-separator,
  .sidebar .user-info .ms-2,
  .sidebar .btn-logout { display: none; }
  .content-area { margin-left: 64px; }
  .car-hero-img { height: 200px; }
}

/* ─── Improved form controls ─────────────────────────────── */
.form-control, .form-select {
  border-color: #e2e8f0;
  border-radius: 8px;
  font-size: .875rem;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-label {
  font-size: .8rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Improved buttons ────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  transition: all .15s ease;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover {
  background: #2563eb;
  border-color: #2563eb;
  box-shadow: 0 4px 12px rgba(59,130,246,.35);
}
.btn-sm { font-size: .8rem; border-radius: 6px; }

/* ─── Badges improvements ────────────────────────────────── */
.badge {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: 6px;
  padding: 3px 8px;
}
.badge.rounded-pill { border-radius: 20px; }

/* ─── Table improvements ─────────────────────────────────── */
.table-responsive {
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
.table thead th:first-child { padding-left: 20px; }
.table tbody td:first-child { padding-left: 20px; }
thead.table-light th {
  background: #f8fafc !important;
  border-bottom: 2px solid #e2e8f0 !important;
}

/* ─── KPI cards on dashboard ─────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
}
.stat-card.stat-blue   { border-left-color: #3b82f6; }
.stat-card.stat-green  { border-left-color: #22c55e; }
.stat-card.stat-orange { border-left-color: #f97316; }
.stat-card.stat-red    { border-left-color: #ef4444; }

/* BEM-style aliases used in cheltuieli + dashboard */
.stat-card-blue    { border-left-color: #3b82f6; }
.stat-card-green   { border-left-color: #22c55e; }
.stat-card-orange  { border-left-color: #f97316; }
.stat-card-red     { border-left-color: #ef4444; }
.stat-card-warning { border-left-color: #f59e0b; }
.stat-card-blue,
.stat-card-green,
.stat-card-orange,
.stat-card-red,
.stat-card-warning {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  border-left: 4px solid transparent;
}
.stat-card-body { }
.stat-card-label { font-size: .78rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.stat-card-value { font-size: 1.3rem; font-weight: 700; color: #1e293b; }

/* ─── Input groups ───────────────────────────────────────── */
.input-group-text {
  border-color: #e2e8f0;
  background: #f8fafc;
  font-size: .8rem;
  color: #64748b;
}
.input-group .form-control:not(:first-child) {
  border-left: none;
}
.input-group .btn:last-child {
  border-left: none;
}

/* ─── Date picker arrow button ────────────────────────────── */
.input-group .btn-outline-secondary {
  border-color: #e2e8f0;
  color: #64748b;
}
.input-group .btn-outline-secondary:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* ─── Alerts and flash messages ──────────────────────────── */
.alert {
  border-radius: 10px;
  border: none;
  font-size: .875rem;
}

/* ─── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ════════════════════════════════════════════════════════════
   DARK MODE
═══════════════════════════════════════════════════════════ */
body.dark-mode {
  background: #0f172a;
  color: #e2e8f0;
}
body.dark-mode .content-area {
  background: #0f172a;
}
body.dark-mode .topbar {
  background: #1e293b;
  border-bottom-color: #334155;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
body.dark-mode .topbar .page-title { color: #e2e8f0; }
body.dark-mode .card {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
body.dark-mode .card-header {
  background: #263548;
  border-bottom-color: #334155;
  color: #e2e8f0;
}
body.dark-mode .card-footer {
  background: #1a2a3a;
  border-top-color: #334155;
}
body.dark-mode .table {
  color: #e2e8f0;
  --bs-table-bg: transparent;
  --bs-table-hover-bg: rgba(255,255,255,.04);
}
body.dark-mode .table thead th {
  background: #263548;
  color: #94a3b8;
  border-bottom-color: #334155;
}
body.dark-mode .table td,
body.dark-mode .table th {
  border-color: #334155;
}
body.dark-mode .table-light {
  background: #263548 !important;
  color: #94a3b8;
}
body.dark-mode .table-warning {
  background: rgba(234,179,8,.08) !important;
}
body.dark-mode .form-control,
body.dark-mode .form-select {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
body.dark-mode .form-control:focus,
body.dark-mode .form-select:focus {
  background: #0f172a;
  border-color: #3b82f6;
  color: #e2e8f0;
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
body.dark-mode .form-control::placeholder { color: #475569; }
body.dark-mode .input-group-text {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}
body.dark-mode .btn-outline-secondary {
  color: #94a3b8;
  border-color: #475569;
}
body.dark-mode .btn-outline-secondary:hover {
  background: #334155;
  color: #e2e8f0;
}
body.dark-mode .text-muted { color: #64748b !important; }
body.dark-mode .modal-content {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
body.dark-mode .modal-header { border-bottom-color: #334155; }
body.dark-mode .modal-footer { border-top-color: #334155; }
body.dark-mode .nav-tabs .nav-link {
  color: #94a3b8;
  border-color: transparent;
}
body.dark-mode .nav-tabs .nav-link.active {
  background: #1e293b;
  border-color: #334155 #334155 #1e293b;
  color: #e2e8f0;
}
body.dark-mode .nav-tabs { border-bottom-color: #334155; }
body.dark-mode .list-group-item {
  background: transparent;
  border-color: #334155;
  color: #e2e8f0;
}
body.dark-mode .badge.bg-light { background: #334155 !important; color: #cbd5e1 !important; }
body.dark-mode .alert-info  { background: rgba(14,165,233,.15); border-color: rgba(14,165,233,.3); color: #7dd3fc; }
body.dark-mode .alert-warning { background: rgba(234,179,8,.12); border-color: rgba(234,179,8,.3); color: #fde68a; }
body.dark-mode .alert-danger  { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.3); color: #fca5a5; }
body.dark-mode .alert-success { background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.3); color: #86efac; }
body.dark-mode .fin-kpi-box   { background: #1e293b; border-color: #334155; }
body.dark-mode .fin-kpi-value { color: #e2e8f0; }
body.dark-mode .stat-card-blue,
body.dark-mode .stat-card-green,
body.dark-mode .stat-card-orange,
body.dark-mode .stat-card-red,
body.dark-mode .stat-card-warning { background: #1e293b; }
body.dark-mode .stat-card-value   { color: #e2e8f0; }
body.dark-mode .car-card { background: #1e293b; }
body.dark-mode .car-card-body { color: #e2e8f0; }

/* ─── Dark mode toggle button ────────────────────────────── */
.btn-dark-toggle {
  background: transparent;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.btn-dark-toggle:hover { background: rgba(0,0,0,.08); }
body.dark-mode .btn-dark-toggle { border-color: rgba(255,255,255,.2); color: #e2e8f0; }
body.dark-mode .btn-dark-toggle:hover { background: rgba(255,255,255,.05); }

