/* Zoaria Hub — tema claro Sage & Creme (estilo DRE MKB) */
:root {
  --bg:          #ede2d1;
  --bg-sidebar:  #f4ecdd;
  --bg-card:     #fffdf9;
  --bg-card-hover: #f8f2e8;
  --bg-input:    #fffefb;
  --borda:       #dccdb6;
  --borda-sutil: #e5dccb;
  --texto:       #2f3b2f;
  --texto-2:     #55614e;
  --texto-3:     #808a74;
  /* acento (mantém nomes --roxo* usados nos templates, agora em sage) */
  --roxo:        #6e7f63;
  --roxo-dark:   #566450;
  --roxo-claro:  #4f6a47;
  --roxo-glow:   rgba(110, 127, 99, .14);
  --verde:       #4d8a3f;
  --amarelo:     #b0813f;
  --sidebar-w:   250px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--texto);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--borda);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--borda); border-radius: 4px; }

.sidebar-top {
  padding: 24px 20px 20px;
}
.brand {
  color: var(--texto);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -.01em;
}
.brand-logo {
  height: 26px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 4px 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 2px 0 6px;
}
.sidebar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--texto);
  padding: 16px 20px 6px;
  font-weight: 800;
}
.sidebar-label .ico {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: .9;
}
.sidebar-link {
  display: flex;
  align-items: center;
  padding: 7px 20px 7px 20px;
  color: var(--texto-2);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 500;
  border-radius: 0;
  transition: all .15s ease;
  position: relative;
}
a.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: transparent;
  border-radius: 0 2px 2px 0;
  transition: background .15s;
}
a.sidebar-link:hover {
  background: var(--roxo-glow);
  color: var(--texto);
}
a.sidebar-link:hover::before {
  background: var(--roxo);
}
.sidebar-link.disabled {
  display: block;
  opacity: .55;
  cursor: default;
  line-height: 1.4;
}

.sidebar-bottom {
  border-top: 1px solid var(--borda);
  padding: 4px 0 0;
  margin-top: auto;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
}
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--roxo), var(--roxo-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: .8rem;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name {
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--texto);
}
.user-logout {
  font-size: .72rem;
  color: var(--texto-3);
  text-decoration: none;
  transition: color .15s;
}
.user-logout:hover { color: var(--roxo); }

/* ── Main content ────────────────────────────────────────── */
.main-with-sidebar {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 40px 44px;
}
.main-full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(110, 127, 99, .12) 0%, transparent 60%);
}

/* ── Home ────────────────────────────────────────────────── */
.welcome { margin-bottom: 36px; }
.welcome h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -.02em;
}
.welcome-sub { color: var(--texto-3); font-size: .88rem; }

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 12px;
  padding: 18px 20px 20px;
  color: var(--texto);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
  position: relative;
  box-shadow: 0 1px 5px rgba(75, 70, 45, .06);
}
a.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--roxo);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(110, 127, 99, .2);
}
.card-modulo {
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--texto-3);
  margin-bottom: 8px;
  font-weight: 700;
}
.card-nome {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: .95rem;
  letter-spacing: -.01em;
  padding-right: 20px;
}
.card-desc {
  color: var(--texto-2);
  font-size: .82rem;
  line-height: 1.5;
}
.card-breve { opacity: .6; box-shadow: none; }
.card-top-breve {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.card-top-breve .card-modulo { margin-bottom: 0; }

/* selo IA — sage tint + brilho */
.ia-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #4d6a45;
  background: #e2ebde;
  border: 1px solid #bcd0b5;
  padding: 3px 9px;
  border-radius: 999px;
}
.ia-badge .ico-ia { width: 11px; height: 11px; }

/* seta de "abrir" no hover */
.card-arrow {
  position: absolute;
  right: 16px;
  top: 16px;
  color: var(--texto-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s, color .2s;
}
.card-arrow .ico-arrow { width: 16px; height: 16px; display: block; }
a.card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--roxo);
}

/* ── Page titles (admin) ─────────────────────────────────── */
.page-title {
  font-size: 1.3rem;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.page-sub { color: var(--texto-3); margin-bottom: 28px; font-size: .88rem; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* ── Login ────────────────────────────────────────────────── */
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 14px;
  padding: 44px 36px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(90, 80, 50, .12);
}
.login-logo { margin-bottom: 16px; display: flex; justify-content: center; }
.login-logo-img { height: 48px; width: auto; }
.login-card h1 {
  font-size: 1.3rem;
  margin-bottom: 4px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.login-sub { color: var(--texto-3); margin-bottom: 28px; font-size: .85rem; }
.login-card form { text-align: left; }

/* ── Formulários ─────────────────────────────────────────── */
label {
  display: block;
  font-size: .8rem;
  color: var(--texto-2);
  margin-bottom: 14px;
  font-weight: 500;
}
input, select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--borda);
  border-radius: 8px;
  color: var(--texto);
  font-size: .9rem;
  transition: border-color .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--roxo);
  box-shadow: 0 0 0 2px rgba(110, 127, 99, .18);
}
input::placeholder { color: var(--texto-3); }

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 24px;
  max-width: 720px;
  box-shadow: 0 1px 5px rgba(75, 70, 45, .06);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .span-2 { grid-column: span 2; }
.fieldset-modulos {
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 18px;
}
.fieldset-modulos legend { color: var(--texto-2); font-size: .82rem; padding: 0 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin: 6px 18px 6px 0; color: var(--texto); }
.check input { width: auto; margin: 0; accent-color: var(--roxo); }
.form-acoes { display: flex; gap: 12px; }

.btn-primario {
  background: linear-gradient(135deg, var(--roxo), var(--roxo-dark));
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all .15s;
  letter-spacing: -.01em;
}
.btn-primario:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 16px rgba(110, 127, 99, .3);
}
.login-card .btn-primario { width: 100%; margin-top: 8px; }
.btn-secundario {
  background: transparent;
  border: 1px solid var(--borda);
  color: var(--texto-2);
  padding: 10px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: .9rem;
  transition: all .15s;
}
.btn-secundario:hover {
  border-color: var(--roxo);
  color: var(--texto);
}
.btn-link { background: none; border: none; color: #b25b4c; cursor: pointer; font-size: inherit; padding: 0; }
.btn-link-acao { background: none; border: none; color: var(--roxo-claro); cursor: pointer; font-size: inherit; padding: 0; font-family: inherit; }
.btn-link-acao:hover { text-decoration: underline; }
.login-links { margin-top: 18px; font-size: .8rem; text-align: center; }
.login-links a { color: var(--texto-3); text-decoration: none; transition: color .15s; }
.login-links a:hover { color: var(--roxo); }

/* ── Tabelas ─────────────────────────────────────────────── */
.tabela {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--borda);
  box-shadow: 0 1px 5px rgba(75, 70, 45, .06);
}
.tabela th, .tabela td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--borda-sutil);
}
.tabela th {
  color: var(--texto-3);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  background: #f0e8d8;
}
.tabela tr:hover td { background: var(--roxo-glow); }
.tabela a { color: var(--roxo-claro); text-decoration: none; font-weight: 500; }
.tabela a:hover { text-decoration: underline; }
.mini { color: var(--texto-2); font-size: .8rem; }
.acoes-linha { display: flex; gap: 12px; align-items: center; }
.acoes-linha form { display: inline; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  background: #ece3d3;
  color: var(--texto-2);
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  font-weight: 600;
}
.badge-admin { background: #e2ebde; color: #4d6a45; }

/* badge "em breve" — mesmo estilo no menu e nos cards */
.badge-breve {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  background: #ece3d3;
  color: var(--texto-3);
  border: 1px solid var(--borda);
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: middle;
  flex-shrink: 0;
}
.sidebar-link .badge-breve { margin-left: 6px; }

/* ── Flash ───────────────────────────────────────────────── */
.flash {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: .85rem;
  border: 1px solid;
}
.flash-warning { background: #f6efdd; color: #8a6a2e; border-color: #e3d2a8; }
.flash-success { background: #e7efe4; color: #3f6a37; border-color: #c5d8bf; }
.flash-danger  { background: #f7e7e3; color: #a24a3a; border-color: #e6c3b9; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--borda);
  }
  .sidebar-nav { display: none; }
  .sidebar-bottom { border-top: none; }
  .main-with-sidebar { margin-left: 0; padding: 24px 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
