
  * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Roboto, sans-serif; }

  body { background: #f4f6f9; color: #333; }

  .app-hidden, .login-screen.hidden { display: none; }
  .login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e2a38;
    padding: 20px;
  }
  .login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  }
  .login-logo { color: #1e2a38; padding: 0 0 20px; }
  .login-box h1 { font-size: 24px; margin-bottom: 20px; }
  .link-button { display: block; margin: 14px auto 0; border: 0; background: none; color: #4285F4; cursor: pointer; }
  .login-erro { color: #e53935; min-height: 20px; margin-top: 14px; font-size: 13px; }
  .versao-compilacao { color: #777; text-align: center; font-size: 11px; margin-top: 10px; }

  .app-container { display: flex; min-height: 100vh; }

  /* Sidebar */
  .sidebar {
    width: 220px;
    background: #1e2a38;
    color: #fff;
    padding: 20px 0;
    position: fixed;
    height: 100vh;
    top: 0; left: 0;
  }

  .logo { padding: 0 20px 20px; font-size: 20px; font-weight: bold; }
  .logo span { color: #4285F4; }

  .menu { list-style: none; }
  .menu li {
    padding: 14px 20px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
  }
  .menu li:hover, .menu li.active {
    background: #4285F4;
    border-left: 4px solid #fff;
  }

  .content {
    margin-left: 220px;
    padding: 30px;
    width: calc(100% - 220px);
  }

  .page { display: none; }
  .page.active { display: block; animation: fadeIn 0.3s ease; }

  @keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

  h1 { margin-bottom: 20px; color: #1e2a38; }

  .inicio-page {
    min-height: calc(100vh - 60px);
    align-items: center;
    justify-content: center;
    text-align: center;
  }
  .page.inicio-page.active { display: flex; }
  .inicio-conteudo { padding: 40px 20px; }
  .inicio-marca {
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: #4285F4;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 38px;
  }
  .inicio-conteudo h1 { margin-bottom: 8px; font-size: 38px; }
  .inicio-conteudo p { color: #5f6368; font-size: 20px; }

  .cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
  }
  .card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    text-align: center;
  }
  .card span { font-size: 28px; font-weight: bold; color: #4285F4; display: block; }
  .card p { color: #777; margin-top: 6px; }

  .btn-primary {
    background: #4285F4;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 16px;
  }
  .btn-primary:hover { background: #3367d6; }

  .tabela-container {
    background: #fff;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  table { width: 100%; border-collapse: collapse; min-width: 500px; }
  th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
  th { background: #f8f9fb; color: #555; }
  .acao-btn { cursor: pointer; margin-right: 8px; color: #4285F4; }
  .acao-btn.excluir { color: #e53935; }
  .mensagem-erro { color: #e53935; padding: 18px; }
  .diagnostico-folha { color: #666; font-size: 13px; margin: -6px 0 16px; }
  .checklist-carro { border: 1px solid #ddd; border-radius: 8px; padding: 12px; margin: 14px 0; }
  .checklist-carro legend { padding: 0 6px; color: #555; font-size: 13px; }
  .checklist-carro > label { display: block; margin: 8px 0; font-size: 13px; color: #555; }

  /* Modal */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    min-height: 100vh;
    height: 100dvh;
    padding: 24px;
    overflow-y: auto;
    align-items: flex-start;
    justify-content: center;
  }
  .modal-overlay.active { display: flex; }
  .modal {
    background: #fff;
    width: 90%;
    max-width: 480px;
    border-radius: 12px;
    padding: 20px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
  }
  .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
  .fechar-modal { cursor: pointer; font-size: 22px; }

  .form-group { margin-bottom: 14px; }
  .form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #555; }
  .form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
  }
  .btn-salvar {
    width: 100%;
    background: #34a853;
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 10px;
  }
  .permissoes-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .permissoes-grid label {
    font-size: 13px;
    color: #555;
  }

  .loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }
  .loading-overlay.active { display: flex; }
  .spinner {
    width: 40px; height: 40px;
    border: 4px solid #ddd;
    border-top: 4px solid #4285F4;
    border-radius: 50%;
    animation: girar 0.8s linear infinite;
  }
  @keyframes girar { to { transform: rotate(360deg); } }

  /* Responsivo - Mobile */
  @media (max-width: 768px) {
    .sidebar {
      width: 100%;
      height: auto;
      position: fixed;
      bottom: 0;
      top: auto;
      display: flex;
      padding: 0;
      z-index: 100;
    }
    .logo { display: none; }
    .menu {
      display: flex;
      width: 100%;
      justify-content: space-around;
    }
    .menu li {
      flex: 1;
      text-align: center;
      font-size: 11px;
      padding: 10px 4px;
      border-left: none !important;
    }
    .content {
      margin-left: 0;
      width: 100%;
      padding: 16px;
      padding-bottom: 80px;
    }
  }
/* Tema Cloudflare — inspirado no painel mobile-first de referencia. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
  --navy: #0f2744;
  --navy-2: #1a3a5c;
  --blue: #2563eb;
  --gold: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --line: #e2e8f0;
  --muted: #64748b;
  --text: #0f172a;
  --radius: 14px;
  --radius-lg: 20px;
}

* { font-family: 'DM Sans', 'Segoe UI', sans-serif; }
body { background: var(--bg); color: var(--text); }

.login-screen { background: radial-gradient(circle at 15% 15%, #1f4973, var(--navy) 55%); }
.login-box { max-width: 390px; padding: 30px 24px; border-radius: var(--radius-lg); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.login-logo, .login-box h1 { color: #fff; text-align: center; }
.login-logo { font-family: 'DM Serif Display', serif; font-size: 27px; padding-bottom: 12px; }
.login-box h1 { font-family: 'DM Serif Display', serif; font-size: 23px; font-weight: 400; }
.login-box .form-group label { color: rgba(255,255,255,.65); text-transform: uppercase; letter-spacing: .8px; font-size: 11px; font-weight: 700; }
.login-box .form-group input { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.18); color: #fff; min-height: 52px; }
.login-box .form-group input:focus { border-color: var(--gold); outline: none; }
.login-box .btn-salvar { background: var(--gold); color: var(--navy); font-weight: 700; min-height: 52px; }
.versao-compilacao { color: rgba(255,255,255,.45); }
.brand-logo { display: block; object-fit: contain; }
.brand-logo-login { width: min(260px, 82vw); height: 138px; margin: 0 auto 6px; }

.sidebar { width: 250px; padding: 22px 12px; background: var(--navy); box-shadow: 5px 0 24px rgba(15,39,68,.08); }
.logo { padding: 8px 14px 26px; }
.brand-logo-menu { width: 205px; height: 100px; object-position: center; }
.menu { display: grid; gap: 4px; }
.menu li { border-radius: 11px; padding: 12px 14px; color: rgba(255,255,255,.68); font-size: 14px; font-weight: 600; border-left: 0; }
.menu li:hover, .menu li.active { background: rgba(255,255,255,.12); color: #fff; border-left: 0; }
.menu li.active { box-shadow: inset 3px 0 0 var(--gold); }

.content { margin-left: 250px; width: calc(100% - 250px); padding: 36px clamp(24px, 4vw, 58px); max-width: 1680px; }
.page h1 { font-family: 'DM Serif Display', serif; color: var(--navy); font-size: 30px; font-weight: 400; margin-bottom: 10px; }
.page h1 + .btn-primary { margin-top: 8px; }
.inicio-page { min-height: calc(100vh - 72px); text-align: left; justify-content: flex-start; align-items: flex-start; }
.inicio-conteudo { width: 100%; max-width: 750px; border-radius: var(--radius-lg); padding: 34px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; box-shadow: 0 12px 28px rgba(15,39,68,.18); }
.inicio-marca { width: 170px; height: 110px; margin: 0 0 18px; background: #fff; overflow: hidden; }
.brand-logo-inicio { width: 100%; height: 100%; }
.inicio-conteudo h1 { font-family: 'DM Serif Display', serif; color: #fff; font-size: 34px; }
.inicio-conteudo p { color: #dbeafe; }

.btn-primary { background: var(--navy); border-radius: 11px; padding: 12px 17px; font-weight: 700; box-shadow: 0 4px 12px rgba(15,39,68,.16); }
.btn-primary:hover { background: var(--navy-2); }
.btn-salvar { border-radius: 11px; background: var(--navy); font-weight: 700; }
.btn-salvar:hover { background: var(--navy-2); }
.tabela-container { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: none; }
th { background: #f1f5f9; color: var(--muted); font-size: 11px; letter-spacing: .75px; text-transform: uppercase; }
th, td { padding: 14px 16px; border-color: var(--line); }
td { color: #334155; }
tr:hover td { background: #f8fafc; }
.acao-btn { color: var(--blue); font-weight: 600; }
.diagnostico-folha { padding: 12px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 11px; color: #9a3412; }

.modal-overlay { background: rgba(15,39,68,.58); backdrop-filter: blur(3px); align-items: center; }
.modal { width: min(560px, 94vw); max-width: 560px; border-radius: var(--radius-lg); padding: 24px; box-shadow: 0 24px 60px rgba(15,39,68,.28); }
.modal-header h2 { font-family: 'DM Serif Display', serif; color: var(--navy); font-weight: 400; }
.form-group input, .form-group select, .form-group textarea { min-height: 48px; border: 1.5px solid var(--line); border-radius: 11px; color: var(--text); }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.checklist-carro { border-color: var(--line); border-radius: 12px; }

@media (max-width: 768px) {
  .content { padding: 18px 16px 100px; }
  .sidebar { height: 70px; padding: 7px 0; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(15,39,68,.08); }
  .menu { display: flex; width: 100%; gap: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .menu::-webkit-scrollbar { display: none; }
  .menu li { min-width: 76px; padding: 6px 5px; color: var(--muted); font-size: 9px; line-height: 1.2; text-align: center; text-transform: uppercase; }
  .menu li:hover, .menu li.active { background: transparent; color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
  .page h1 { font-size: 27px; }
  .inicio-conteudo { padding: 26px 22px; }
  .inicio-conteudo h1 { font-size: 28px; }
  .brand-logo-login { width: min(230px, 76vw); height: 120px; }
  .btn-primary { min-height: 48px; width: 100%; margin-bottom: 14px; }
  .tabela-container { background: transparent; border: 0; overflow: visible; }
  table, table tbody, table tr, table td { display: block; min-width: 0; width: 100%; }
  table thead { display: none; }
  table tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 14px; margin-bottom: 10px; box-shadow: 0 2px 7px rgba(15,39,68,.04); }
  table td { min-height: 34px; padding: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid #f1f5f9; text-align: right; font-size: 14px; }
  table td:last-child { border-bottom: 0; }
  table td::before { color: var(--muted); content: 'Informacao'; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-align: left; text-transform: uppercase; }
  #tabela-clientes td:nth-child(1)::before { content: 'Nome'; } #tabela-clientes td:nth-child(2)::before { content: 'Telefone'; } #tabela-clientes td:nth-child(3)::before { content: 'E-mail'; } #tabela-clientes td:nth-child(4)::before { content: 'Acoes'; }
  #tabela-carros td:nth-child(1)::before { content: 'Placa'; } #tabela-carros td:nth-child(2)::before { content: 'Modelo'; } #tabela-carros td:nth-child(3)::before { content: 'Marca'; } #tabela-carros td:nth-child(4)::before { content: 'Cliente'; } #tabela-carros td:nth-child(5)::before { content: 'Checklist'; } #tabela-carros td:nth-child(6)::before { content: 'Fotos'; } #tabela-carros td:nth-child(7)::before { content: 'Acoes'; }
  #tabela-orcamentos td:nth-child(1)::before { content: 'Data'; } #tabela-orcamentos td:nth-child(2)::before { content: 'Descricao'; } #tabela-orcamentos td:nth-child(3)::before { content: 'Total'; } #tabela-orcamentos td:nth-child(4)::before { content: 'Status'; } #tabela-orcamentos td:nth-child(5)::before { content: 'Acoes'; }
  #tabela-pagamentos td:nth-child(1)::before { content: 'Data'; } #tabela-pagamentos td:nth-child(2)::before { content: 'Cliente'; } #tabela-pagamentos td:nth-child(3)::before { content: 'Carro'; } #tabela-pagamentos td:nth-child(4)::before { content: 'Mecanico'; } #tabela-pagamentos td:nth-child(5)::before { content: 'Lider'; } #tabela-pagamentos td:nth-child(6)::before { content: 'Forma'; } #tabela-pagamentos td:nth-child(7)::before { content: 'Valor'; } #tabela-pagamentos td:nth-child(8)::before { content: 'Status'; }
  #tabela-adiantamentos td:nth-child(1)::before { content: 'Data'; } #tabela-adiantamentos td:nth-child(2)::before { content: 'Mecanico'; } #tabela-adiantamentos td:nth-child(3)::before { content: 'Forma'; } #tabela-adiantamentos td:nth-child(4)::before { content: 'Valor'; } #tabela-adiantamentos td:nth-child(5)::before { content: 'Status'; } #tabela-adiantamentos td:nth-child(6)::before { content: 'Comprovante'; } #tabela-adiantamentos td:nth-child(7)::before { content: 'Acoes'; }
  #tabela-funcionarios td:nth-child(1)::before { content: 'Nome'; } #tabela-funcionarios td:nth-child(2)::before { content: 'Login'; } #tabela-funcionarios td:nth-child(3)::before { content: 'Cargo'; } #tabela-funcionarios td:nth-child(4)::before { content: 'Telefone'; } #tabela-funcionarios td:nth-child(5)::before { content: 'Especialidade'; } #tabela-funcionarios td:nth-child(6)::before { content: 'Acoes'; }
  #tabela-pecas td:nth-child(1)::before { content: 'Nome'; } #tabela-pecas td:nth-child(2)::before { content: 'Fornecedor'; } #tabela-pecas td:nth-child(3)::before { content: 'Preco'; } #tabela-pecas td:nth-child(4)::before { content: 'Estoque'; } #tabela-pecas td:nth-child(5)::before { content: 'Acoes'; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-width: none; max-height: 92dvh; border-radius: 20px 20px 0 0; padding: 20px 18px 30px; animation: subir-modal .22s ease-out; }
  .modal::before { content: ''; display: block; width: 38px; height: 4px; margin: -8px auto 16px; border-radius: 4px; background: #cbd5e1; }
  .permissoes-grid { grid-template-columns: 1fr; }
}
@keyframes subir-modal { from { transform: translateY(100%); } to { transform: translateY(0); } }
