/* ============================================================
   JEEP CONTROL — CSS (fiel ao visual do V0)
   Dark mode · Cores Jeep (âmbar/verde)
   ============================================================ */

:root {
  --background: #0b0f0e;
  --foreground: #edf1ed;
  --card: #121817;
  --muted: #1b2422;
  --muted-foreground: #899590;
  --border: #25302d;
  --primary: #EF9F27;       /* âmbar Jeep */
  --primary-fg: #14190e;
  --radius: 0.8rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--background); }
body { background: var(--background); color: var(--foreground); font-family: Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* ── LAYOUT ─────────────────────────────────────────────── */
.app-shell { min-height: 100vh; display: flex; background: #0b0f0e; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: 256px; min-height: 100vh;
  background: #101514; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 28px 16px 18px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 12px 24px; letter-spacing:.09em; }
.brand strong { display: block; font-size: 15px; line-height: 1; }
.brand small { display: block; color: #73807b; font-size: 9px; letter-spacing:.21em; margin-top: 4px; }
.logo-mark {
  width: 31px; height: 31px; border: 2px solid var(--primary); border-radius: 50%;
  display: grid; place-items: center; color: var(--primary); font-weight: 700; font-size: 17px;
}
.logo-mark.lg { width: 44px; height: 44px; font-size: 24px; }
.vehicle-chip {
  display: flex; align-items: center; gap: 10px;
  background: #18201e; border: 1px solid #293631; border-radius: 10px;
  padding: 10px; margin-bottom: 24px;
}
.vehicle-icon { font-size: 20px; }
.vehicle-chip strong { display: block; font-size: 12px; font-weight: 600; }
.vehicle-chip span { display: block; color: var(--muted-foreground); font-size: 10px; margin-top: 3px; }
.nav-label { color: #697771; display: block; font-size: 9px; letter-spacing:.14em; font-weight: 700; padding: 0 12px 8px; }
.nav-item {
  color: #82908a; width: 100%; border: 0; background: transparent;
  display: flex; align-items: center; gap: 12px;
  border-radius: 8px; padding: 11px 12px; text-align: left; font-size: 13px;
  margin-bottom: 2px; transition: .15s;
}
.nav-item:hover { background: #1e2b28; color: #eef4ec; }
.nav-item.active { background: #263128; color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.sidebar-footer { margin-top: auto; border-top: 1px solid var(--border); padding: 14px 7px 0; }
.profile { display: flex; align-items: center; gap: 9px; }
.avatar { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: #455348; color: #e1e9e2; font-size: 11px; font-weight: 700; }
.profile strong { display: block; font-size: 12px; font-weight: 600; }
.profile span { display: block; color: var(--muted-foreground); font-size: 10px; }
.logout-btn { margin-left: auto; font-size: 16px; color: #718079; opacity: .7; }
.logout-btn:hover { opacity: 1; }

/* ── MAIN ─────────────────────────────────────────────────── */
.main-content { min-width: 0; flex: 1; }
.topbar { height: 60px; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 40px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: #75827d; font-size: 12px; }
.breadcrumb strong { color: #dce5dd; font-weight: 500; }
.content-area { padding: 36px 40px 60px; max-width: 1400px; margin: auto; }

/* ── PAGE HEADING ─────────────────────────────────────────── */
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 28px; }
.eyebrow { color: #78857e; font-size: 9px; letter-spacing:.14em; font-weight: 700; margin-bottom: 8px; }
.page-heading h1 { font-size: 28px; font-weight: 400; letter-spacing: -.02em; margin: 0; }
.subheading { color: #899690; font-size: 13px; margin-top: 8px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.primary-button {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 7px;
  padding: 10px 16px; font-size: 12px; font-weight: 700;
  background: var(--primary); color: #0e120a; cursor: pointer; white-space: nowrap;
}
.primary-button:hover { background: #d98e20; }
.secondary-button {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid #33413a;
  border-radius: 7px; padding: 10px 16px; font-size: 12px; font-weight: 600;
  background: #1e2b28; color: #dde9dd; cursor: pointer; white-space: nowrap;
}
.secondary-button:hover { background: #263530; }
.btn-full { width: 100%; justify-content: center; }
.btn-success { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 7px; padding: 10px 16px; font-size: 12px; font-weight: 700; background: #2f6b35; color: #d4f0d6; cursor: pointer; }
.btn-danger { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 7px; padding: 10px 16px; font-size: 12px; font-weight: 700; background: #6b2f2f; color: #f0d4d4; cursor: pointer; }
.btn-del { color: #7a4040; font-size: 13px; padding: 4px 8px; border-radius: 5px; }
.btn-del:hover { background: #3a1f1f; color: #e07070; }
.text-button { border: 0; background: transparent; color: #9cac82; font-size: 11px; display: inline-flex; align-items: center; gap: 4px; padding: 0; cursor: pointer; }
.text-button:hover { color: var(--primary); }
.acoes-chamado { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

/* ── CARDS ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card, .panel { background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.stat-card { min-height: 110px; padding: 18px; display: flex; gap: 14px; }
.stat-icon { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }
.stat-icon.green { background: #2d3e21; }
.stat-icon.blue  { background: #1d3440; }
.stat-icon.amber { background: #453720; }
.stat-icon.red   { background: #432b29; }
.stat-copy { display: flex; flex-direction: column; gap: 5px; }
.stat-copy span  { color: #84918b; font-size: 11px; }
.stat-copy strong { font-size: 18px; font-weight: 500; letter-spacing: -.02em; }
.stat-copy small  { color: #78857f; font-size: 10px; }

.content-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; margin-bottom: 14px; }
.panel { padding: 22px 24px; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.panel-header h2 { font-size: 14px; font-weight: 600; margin: 0; }
.panel-header p  { font-size: 10px; color: #77847e; margin: 5px 0 0; }

/* ── BARS ─────────────────────────────────────────────── */
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.bar-row > div:first-child { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.bar-row span { color: #8b9891; }
.bar-row strong { color: #cdd8cf; font-weight: 500; }
.bar-track { background: #26302d; height: 5px; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width .4s; }
.bar-amber { background: var(--primary); }
.bar-green { background: #8bc34a; }
.bar-blue  { background: #5eaabb; }

/* ── TIMELINE ─────────────────────────────────────────── */
.timeline { margin-top: 16px; }
.timeline-item { display: flex; align-items: center; gap: 12px; border-top: 1px solid #25302d; padding: 12px 0; }
.timeline-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; flex-shrink: 0; }
.timeline-icon.green { background: #293a21; }
.timeline-icon.blue  { background: #1b3340; }
.timeline-icon.amber { background: #43371f; }
.timeline-icon.red   { background: #3d2020; }
.timeline-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.timeline-copy strong { font-size: 12px; font-weight: 600; }
.timeline-copy span, .timeline-item time { color: #7d8a83; font-size: 11px; }
.timeline-panel { padding-bottom: 10px; }

/* ── CHAMADO TIMELINE ─────────────────────────────────── */
.tl-wrap { display: flex; flex-direction: column; margin-bottom: 24px; }
.tl-item { display: flex; gap: 14px; }
.tl-left { display: flex; flex-direction: column; align-items: center; width: 28px; flex-shrink: 0; }
.tl-dot  { width: 14px; height: 14px; border-radius: 50%; border: 2px solid; flex-shrink: 0; margin-top: 14px; }
.tl-line { width: 2px; flex: 1; min-height: 12px; background: var(--border); margin: 3px 0; }
.tl-item:last-child .tl-line { display: none; }
.tl-dot.tl-problema    { border-color: #c0392b; background: #2d1010; }
.tl-dot.tl-reincidencia{ border-color: #c0392b; background: #2d1010; }
.tl-dot.tl-contato     { border-color: var(--primary); background: #2d2010; }
.tl-dot.tl-atendimento { border-color: #5eaabb; background: #102028; }
.tl-dot.tl-agendamento { border-color: #8bc34a; background: #1a2810; }
.tl-dot.tl-resolvido   { border-color: #8bc34a; background: #1a2810; }
.tl-card { background: #161e1c; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; flex: 1; }
.tl-card-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; gap: 10px; }
.tl-quem { font-size: 12px; font-weight: 600; }
.tl-quem.tl-problema, .tl-quem.tl-reincidencia { color: #e07070; }
.tl-quem.tl-contato     { color: var(--primary); }
.tl-quem.tl-atendimento { color: #74b8cc; }
.tl-quem.tl-agendamento, .tl-quem.tl-resolvido { color: #a8d870; }
.tl-data { font-size: 11px; color: #7d8a83; white-space: nowrap; }
.tl-text { font-size: 13px; color: var(--foreground); line-height: 1.55; }
.novo-registro-box { background: #0e1614; border: 1px dashed #354540; border-radius: 10px; padding: 18px; margin-top: 8px; }

/* ── TABLE ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead { background: #161e1c; }
.data-table th { padding: 10px 14px; text-align: left; font-size: 10px; font-weight: 700; letter-spacing:.06em; color: #7d8a83; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #1e2925; vertical-align: middle; }
.data-table tbody tr:hover { background: #131c1a; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 4px; }
.badge-lg { font-size: 13px; padding: 5px 14px; border-radius: 6px; }
.badge-aberta      { background: #453720; color: var(--primary); }
.badge-em_andamento{ background: #1d3440; color: #74b8cc; }
.badge-resolvida   { background: #1e3820; color: #8bc34a; }
.badge-reaberta    { background: #3d2020; color: #e07070; }
.badge-tipo        { background: #1e2b28; color: #a0b0a8; border: 1px solid var(--border); }

/* ── FORMS ─────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11px; font-weight: 600; color: #a9b5ae; }
.field input, .field select, .field textarea {
  border: 1px solid #35423c; background: #0e1412; color: var(--foreground);
  border-radius: 7px; padding: 10px 12px; font-size: 13px; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field select option { background: #0e1412; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ── MODAL ─────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,8,7,.78);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.action-modal {
  width: min(480px, 100%); background: #151d1b; border: 1px solid #344139;
  border-radius: 13px; padding: 28px; position: relative;
  box-shadow: 0 20px 80px rgba(0,0,0,.4); max-height: 90vh; overflow-y: auto;
}
.action-modal-lg { width: min(640px, 100%); }
.modal-close { position: absolute; right: 16px; top: 16px; background: transparent; border: 0; color: #8c9992; font-size: 16px; }
.action-modal h2 { font-size: 22px; font-weight: 400; margin: 6px 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* ── FLASH ─────────────────────────────────────────────── */
.flash { padding: 10px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.flash-success { background: #1e3820; color: #8bc34a; border: 1px solid #2d5230; }
.flash-error   { background: #3d2020; color: #e07070; border: 1px solid #5a2e2e; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-section {
  border: 1px dashed #33423a; background: #101715; border-radius: 10px;
  min-height: 320px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.section-symbol { font-size: 32px; margin-bottom: 16px; }
.empty-section h2 { font-size: 20px; font-weight: 400; margin-bottom: 8px; }
.empty-section p  { color: #7f8c85; font-size: 13px; margin-bottom: 20px; }
.empty-msg { color: #7d8a83; font-size: 13px; padding: 20px 0; }

/* ── LOGIN ─────────────────────────────────────────────── */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--background); }
.login-wrap  { width: 100%; max-width: 400px; padding: 20px; }
.login-card  { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 36px; }
.login-logo  { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.login-logo strong { display: block; font-size: 18px; letter-spacing: .1em; }
.login-logo small  { display: block; color: #73807b; font-size: 10px; letter-spacing: .18em; margin-top: 4px; }

/* ── MOBILE ─────────────────────────────────────────────── */
.mobile-menu, .mobile-close { display: none; }

@media (max-width: 960px) {
  .sidebar { width: 220px; }
  .content-area { padding: 28px 22px; }
  .topbar { padding: 0 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .sidebar-wrap {
    position: fixed; inset: 0; z-index: 30; pointer-events: none;
    background: transparent; transition: background .2s;
  }
  .sidebar-wrap.open { pointer-events: auto; background: rgba(0,0,0,.6); }
  .sidebar-wrap .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar-wrap.open .sidebar { transform: translateX(0); }
  .mobile-menu {
    display: grid; place-items: center; position: fixed; top: 12px; left: 12px; z-index: 20;
    background: #1d2824; color: #d9e4dc; border: 1px solid #34413a; border-radius: 7px;
    width: 36px; height: 36px; font-size: 18px;
  }
  .mobile-close { display: block; position: fixed; left: 235px; top: 14px; background: transparent; border: 0; color: #d6dfda; font-size: 18px; z-index: 31; }
  .topbar { padding-left: 62px; }
  .content-area { padding: 24px 14px 40px; }
  .page-heading { flex-direction: column; align-items: flex-start; }
  .stats-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; }
}

/* ── CARLOG EXTRAS: seletor de carro, garagem, admin, planos ── */

.car-selector { background:#18201e; border:1px solid #293631; border-radius:10px; padding:10px; margin-bottom:20px; }
.car-active { display:flex; align-items:center; gap:10px; }
.car-icon { font-size:20px; }
.car-info strong { display:block; font-size:12px; font-weight:600; }
.car-info span { display:block; color:var(--muted-foreground); font-size:10px; margin-top:2px; }
.car-list { border-top:1px solid var(--border); margin-top:8px; padding-top:6px; }
.car-option { display:flex; align-items:center; gap:8px; padding:6px 4px; font-size:12px; color:#9aaba4; border-radius:6px; }
.car-option:hover { background:#1e2b28; color:#dde9dd; }
.car-option small { color:#7d8a83; font-size:10px; }
.car-manage { display:block; margin-top:6px; padding-top:6px; border-top:1px solid var(--border); font-size:11px; color:#7d8a83; text-align:center; }
.car-manage:hover { color:var(--primary); }
.car-add-btn { display:block; background:#1e2b28; border:1px dashed #354540; border-radius:10px; padding:10px; text-align:center; font-size:12px; color:#9aaba4; margin-bottom:20px; }
.car-add-btn:hover { border-color:var(--primary); color:var(--primary); }

.topbar-car { font-size:12px; color:#9aaba4; display:flex; align-items:center; gap:6px; }
.placa { display:inline-block; background:#1e2b28; border:1px solid #354540; border-radius:4px; padding:1px 7px; font-size:11px; font-weight:600; letter-spacing:.06em; color:#b0c4b8; }

/* Garagem */
.car-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; }
.car-card { background:var(--card); border:1px solid var(--border); border-radius:12px; padding:16px; }
.car-card-active { border-color:#2d5230; background:#141c13; }
.car-card-top { display:flex; gap:12px; margin-bottom:14px; }
.car-emoji { font-size:28px; }
.car-card-top strong { display:block; font-size:14px; font-weight:600; margin-bottom:3px; }
.car-card-top span { display:block; font-size:11px; color:#8a9890; margin-top:2px; }
.car-card-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* Planos */
.plano-badge { font-size:10px; padding:1px 6px; border-radius:4px; font-weight:700; letter-spacing:.04em; }
.plano-gratuito { background:#2a2a2a; color:#888; }
.plano-basico   { background:#1d3440; color:#74b8cc; }
.plano-pro      { background:#453720; color:var(--primary); }
.plano-badge-table { font-size:11px; padding:2px 8px; border-radius:4px; font-weight:700; }
.plano-vencido { background:#3d2020; border:1px solid #5a2e2e; border-radius:8px; padding:8px 10px; font-size:11px; color:#e07070; margin-top:auto; margin-bottom:12px; text-align:center; }

/* Admin badge */
.badge-admin { background:#453720; color:var(--primary); font-size:9px; padding:1px 5px; border-radius:3px; margin-left:4px; }

/* Login link */
.login-link { text-align:center; font-size:12px; color:#7d8a83; margin-top:16px; }
.login-link a { color:var(--primary); }
