/* assets/css/main.css — Grupo Lago Dourado */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

/* ── Variáveis ──────────────────────────────────────────── */
:root {
  --gold:         #C8A95A;
  --gold-light:   #E8D49A;
  --gold-dark:    #8B6E2A;
  --water:        #1A6B8A;
  --water-dark:   #0D3D52;
  --water-light:  #4FA3C2;
  --water-pale:   #E6F4F9;
  --forest:       #2D5A3D;
  --forest-light: #5A9A6E;
  --forest-pale:  #EAF4ED;

  --bg:           #F8F6F1;
  --bg-card:      #FFFFFF;
  --bg2:          #F2EFE8;
  --text:         #1C1A14;
  --text-muted:   #6B6558;
  --text-light:   #9E9689;
  --border:       rgba(28,26,20,0.1);
  --border-med:   rgba(28,26,20,0.18);

  --sidebar-w:    240px;
  --topbar-h:     60px;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.1);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

a { color: var(--water); text-decoration: none; }
a:hover { color: var(--water-dark); }
img { max-width: 100%; }

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

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}

.logo-txt { flex: 1; }
.logo-nome {
  display: block;
  font-family: var(--font-display);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}
.logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.nav-menu {
  flex: 1;
  padding: .75rem 0;
  overflow-y: auto;
}

.nav-grupo {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: .75rem 1rem .25rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: .6rem 1rem;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  border-radius: 0;
  transition: all .15s;
  cursor: pointer;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.nav-item.ativo {
  background: rgba(200,169,90,0.15);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: .75rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 8px;
  flex: 1; color: rgba(255,255,255,0.7); font-size: 13px;
  padding: .4rem;
  border-radius: var(--radius);
  transition: background .15s;
}
.sidebar-user:hover { background: rgba(255,255,255,0.06); color: #fff; }

.avatar-sm {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: #fff; font-size: 12px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.user-nome { display: block; font-weight: 500; font-size: 13px; color: #fff; line-height: 1.2; }
.user-perfil { font-size: 10px; color: rgba(255,255,255,0.4); text-transform: capitalize; }

.btn-logout {
  color: rgba(255,255,255,0.35);
  font-size: 17px; padding: .4rem;
  border-radius: var(--radius);
  transition: all .15s;
}
.btn-logout:hover { color: #ff7675; background: rgba(255,118,117,0.1); }

/* ── Main wrapper ───────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}

.page-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.btn-menu-mobile { display: none; }

.topbar-actions { display: flex; gap: .5rem; align-items: center; }

.notif-btn {
  position: relative;
  font-size: 18px; padding: .3rem;
  color: var(--text-muted);
  cursor: pointer;
}
.notif-btn:hover { color: var(--text); }

.notif-badge {
  position: absolute; top: 0; right: -2px;
  background: #e74c3c; color: #fff;
  font-size: 9px; font-weight: 600;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Page content ───────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 1.5rem;
}

.flash-container { padding: 0 1.5rem; }

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 600;
  color: var(--text);
}

/* ── Grid layouts ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

@media (max-width: 900px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Stats cards ────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}

.stat-icon.gold   { background: #FDF6E8; }
.stat-icon.water  { background: var(--water-pale); }
.stat-icon.forest { background: var(--forest-pale); }
.stat-icon.danger { background: #FAECE7; }

.stat-val {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 600;
  color: var(--text); line-height: 1;
}
.stat-lbl {
  font-size: 12px; color: var(--text-muted);
  margin-top: 2px;
}

/* ── Formulários ─────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }

label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  margin-bottom: .4rem;
}

input[type=text], input[type=password], input[type=email],
input[type=tel], input[type=date], input[type=number],
select, textarea {
  width: 100%;
  padding: .6rem .85rem;
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--water);
  box-shadow: 0 0 0 3px rgba(26,107,138,0.12);
}

textarea { min-height: 90px; resize: vertical; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: .25rem; }
.form-erro { font-size: 12px; color: #c0392b; margin-top: .25rem; }

/* ── Botões ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--water);
  color: #fff;
  border-color: var(--water);
}
.btn-primary:hover { background: var(--water-dark); border-color: var(--water-dark); color: #fff; }

.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--water);
  border-color: var(--water);
}
.btn-outline:hover { background: var(--water); color: #fff; }

.btn-danger {
  background: #e74c3c; color: #fff; border-color: #e74c3c;
}
.btn-danger:hover { background: #c0392b; border-color: #c0392b; color: #fff; }

.btn-sm { padding: .35rem .75rem; font-size: 12px; }
.btn-lg { padding: .75rem 1.5rem; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Tabelas ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.tabela thead th {
  background: var(--bg2);
  color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .6px;
  padding: .6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-med);
}

table.tabela tbody td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

table.tabela tbody tr:hover td { background: var(--bg); }
table.tabela tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
}
.badge-success  { background: #EAF4ED; color: #1E4A2D; }
.badge-warning  { background: #FAEEDA; color: #633806; }
.badge-danger   { background: #FAECE7; color: #993C1D; }
.badge-info     { background: var(--water-pale); color: #0D3D52; }
.badge-secondary{ background: var(--bg2); color: var(--text-muted); }
.badge-gold     { background: #FDF6E8; color: var(--gold-dark); }

/* ── Alertas / Flash ─────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent;
}
.alert-sucesso  { background: #EAF4ED; color: #1E4A2D; border-color: #C0DD97; }
.alert-erro     { background: #FAECE7; color: #993C1D; border-color: #F0997B; }
.alert-aviso    { background: #FAEEDA; color: #633806; border-color: #FAC775; }
.alert-info     { background: var(--water-pale); color: #0D3D52; border-color: #B5D4F4; }

/* ── Paginação ───────────────────────────────────────────── */
.paginacao { display: flex; gap: 4px; margin-top: 1rem; justify-content: center; }
.pag-item {
  min-width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-med);
  border-radius: var(--radius);
  font-size: 13px; color: var(--text);
  transition: all .15s;
}
.pag-item:hover, .pag-item.ativo {
  background: var(--water); color: #fff; border-color: var(--water);
}

/* ── Seção vazia ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-family: var(--font-display); font-size: 18px; color: var(--text); margin-bottom: .5rem; }
.empty-state p  { font-size: 14px; }

/* ── Utilitários ─────────────────────────────────────────── */
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.text-muted  { color: var(--text-muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-100 { width: 100%; }
.fw-500 { font-weight: 500; }

h2.section-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 600;
  color: var(--text); margin-bottom: 1rem;
}

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--water-dark);
  position: relative; overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(200,169,90,0.12);
}

.login-page::after {
  content: '';
  position: absolute; bottom: -80px; left: -80px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(200,169,90,0.08);
}

.login-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  position: relative; z-index: 1;
}

.login-logo {
  text-align: center; margin-bottom: 2rem;
}

.login-logo .icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--water-dark), var(--water));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: .75rem;
}

.login-logo h1 {
  font-family: var(--font-display);
  font-size: 22px; color: var(--text);
}

.login-logo p {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}

.input-cpf-mask { position: relative; }
.input-cpf-mask input { padding-right: 2.5rem; }

/* ── Accordion (conduta) ─────────────────────────────────── */
.accordion-item { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: .5rem; overflow: hidden; }
.accordion-header {
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; background: var(--bg-card);
  font-weight: 500; font-size: 14.5px;
  transition: background .15s;
}
.accordion-header:hover { background: var(--bg); }
.accordion-header .acc-icon { font-size: 18px; margin-right: 10px; }
.accordion-chevron { color: var(--text-muted); transition: transform .2s; font-size: 12px; }
.accordion-item.aberto .accordion-chevron { transform: rotate(180deg); }
.accordion-body { display: none; padding: 1rem 1.25rem; border-top: 1px solid var(--border); font-size: 14px; line-height: 1.8; color: var(--text-muted); }
.accordion-item.aberto .accordion-body { display: block; }

/* ── Calendário de escala ────────────────────────────────── */
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day-header { text-align: center; font-size: 11px; font-weight: 500; color: var(--text-muted); padding: .3rem; text-transform: uppercase; }
.cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 13px; cursor: pointer;
  transition: all .15s;
  padding: 4px;
}
.cal-day:hover { border-color: var(--water); }
.cal-day.outro-mes { opacity: .35; }
.cal-day.hoje { border-color: var(--gold); font-weight: 600; }
.cal-day .turno-pill {
  font-size: 9px; font-weight: 500;
  padding: 1px 5px; border-radius: 10px;
  margin-top: 3px;
  white-space: nowrap;
}
.turno-0 { background: #FDF6E8; color: var(--gold-dark); }
.turno-1 { background: var(--water-pale); color: var(--water-dark); }
.turno-2 { background: var(--forest-pale); color: var(--forest); }
.turno-3 { background: #EEEDFE; color: #3C3489; }
.cal-day.folga  { background: var(--forest-pale); }
.cal-day.ferias { background: var(--water-pale); }
.cal-day.falta  { background: #FAECE7; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.aberto {
    transform: translateX(0);
  }
  .main-wrapper { margin-left: 0; }
  .btn-menu-mobile {
    display: block;
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-muted);
  }
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}
