/*
  Project     : Antoterras
  File        : public/css/app.css
  Author      : Webfarol - Design is the key
  Version     : 1.1 (Blue theme)
  Year        : 2025
  Description : Estilos base do layout (sidebar + topbar) e componentes globais
*/

/* ==================== Design tokens (globais) ==================== */
:root{
  --bg:#f6f7f9;
  --panel:#ffffff;
  --text:#0f172a;
  --muted:#6b7280;
  --line:#e5e7eb;

  /* Tema azul Antoterras */
  --primary:#050337;
  --primary-600:#04022C;

  /* Acessibilidade (foco) */
  --ring:rgba(5,3,55,.18);
}

/* Reset essencial */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Inter,Arial;
  color:var(--text);
  background:var(--bg);
}

/* ==================== Estrutura (shell + sidebar + topbar) ==================== */
.shell{ display:flex; min-height:100vh }

/* Sidebar fixa */
.side{
  width:240px; flex:0 0 240px;
  background:var(--primary); color:#e2e8f0;
  padding:18px 16px;
}
.brand{ font-weight:700; margin-bottom:16px; font-size:18px }
.nav a{
  display:block; color:#e2e8f0; text-decoration:none;
  padding:10px 12px; border-radius:8px; margin:4px 0;
}
.nav a:hover{ background:rgba(255,255,255,.08) }

/* Área principal */
.main{ flex:1; display:flex; flex-direction:column; min-width:0 }
.top{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px; background:var(--panel); border-bottom:1px solid var(--line);
  position:relative;
}
.user{ position:relative }
.userBtn{
  display:flex; align-items:center; gap:10px;
  padding:8px 12px; border:1px solid var(--line); background:#fff;
  border-radius:8px; cursor:pointer
}
.userName{ font-weight:600 }
.menu{
  position:absolute; right:0; top:48px; background:#fff; min-width:180px;
  border:1px solid var(--line); border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.08);
  display:none; overflow:hidden
}
.menu a, .menu form button{
  display:block; width:100%; text-align:left; padding:10px 12px;
  background:#fff; border:0; cursor:pointer; text-decoration:none; color:#111
}
.menu a:hover, .menu form button:hover{ background:#f3f4f6 }

.content{ padding:20px }

/* Mobile básico: sidebar em cima */
@media (max-width:720px){
  .shell{ flex-direction:column }
  .side{ width:100%; flex:none; border-bottom:1px solid rgba(255,255,255,.15) }
}

/* ==================== Componentes base ==================== */
.card{
  background:#fff; border:1px solid var(--line); border-radius:12px;
  box-shadow:0 2px 8px rgba(16,24,40,.04); padding:16px;
  margin-bottom:16px;
}
.card-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-bottom:12px;
}
.page-title{ font-size:clamp(18px,2vw,24px); font-weight:700; margin:0 }
.actions{ display:flex; gap:8px }

.flash{
  padding:10px 12px; border-radius:10px; margin-bottom:12px; font-weight:600;
}
.flash.ok{
  background:#eef2ff; color:var(--primary); border:1px solid #c7d2fe;
}
.flash.err{
  background:#fee2e2; color:#b91c1c; border:1px solid #fecaca;
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:36px; padding:0 14px; gap:.45rem;
  border-radius:10px; border:1px solid transparent;
  font-weight:600; text-decoration:none; cursor:pointer; line-height:1;
}
.btn:hover{ filter:brightness(.98) }
.btn-primary{ background:var(--primary); color:#fff }
.btn-primary:hover{ background:var(--primary-600) }
.btn-secondary{ background:#f3f4f6; color:#111827; border-color:var(--line) }
.btn-danger{ background:#ef4444; color:#fff }
.inline{ display:inline-block; margin-left:6px }

/* Badges & avatars (tema azul) */
.badge{
  display:inline-block; padding:3px 8px; border-radius:999px;
  background:#eef2ff; color:var(--primary); border:1px solid #c7d2fe;
  font-weight:600; margin-right:6px; font-size:12px;
}
.avatar{
  width:28px; height:28px; border-radius:999px;
  background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:12px; font-weight:700;
}

/* Tabelas */
.table-wrap{ width:100%; overflow:auto }
.table{ width:100%; border-collapse:separate; border-spacing:0; font-size:14px }
.table thead th{
  text-align:left; color:var(--muted); font-weight:700;
  padding:10px 12px; border-bottom:1px solid var(--line); background:#fafafa;
}
.table tbody td{
  padding:12px; border-bottom:1px solid #f1f5f9; vertical-align:middle
}
.t-right,.text-right{ text-align:right }
.t-center,.text-center{ text-align:center }
.muted{ color:var(--muted) }

/* Forms (genérico) */
.form-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:8px 4px 16px }
.form-field label{ display:block; font-weight:700; margin-bottom:6px; color:#111827 }
.form-field input, .form-field select{
  width:100%; height:38px; border:1px solid var(--line); border-radius:10px; padding:0 10px;
}
.form-field input:focus, .form-field select:focus{
  outline:0; border-color:var(--primary);
  box-shadow:0 0 0 3px var(--ring);
}
.form-actions{ display:flex; justify-content:flex-end; gap:8px; padding:8px 0 6px; border-top:1px solid #f1f5f9 }

/* Dashboard helpers */
.grid{ display:grid; grid-template-columns:1fr; gap:16px }
.card h2{ margin:0 0 8px }
.chip:hover{ background:#f3f4f6 }

/* Responsividade básica */
@media (max-width:820px){
  .form-grid{ grid-template-columns:1fr }
  .btn{ height:34px; padding:0 12px }
  .card{ padding:12px }
  .card-head{ flex-wrap:wrap; gap:10px }
}
