/* Sistema Painel da Tata */
:root {
  --creme: #f5ecd9;
  --creme-claro: #faf4e6;
  --navy: #1a2f4a;
  --navy-claro: #2c4a6e;
  --purpura: #6b4a8a;
  --terracota: #c97c5a;
  --ouro: #c9a961;
  --ouro-claro: #e1c889;
  --verde: #5a7c4a;
  --cinza: #6e6e6e;
  --vinho: #a64a4a;
  --sombra: 0 4px 14px rgba(26, 47, 74, 0.08);
  --sombra-forte: 0 10px 30px rgba(26, 47, 74, 0.15);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--creme);
  color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 .5em 0;
}

h1 { font-size: 2.2rem; letter-spacing: -.02em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

a { color: var(--purpura); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: .7rem 1.4rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--navy);
  color: var(--creme-claro);
  transition: transform .12s, box-shadow .15s, background .15s;
  display: inline-flex; align-items: center; gap: .5rem;
}
button:hover, .btn:hover { transform: translateY(-1px); box-shadow: var(--sombra); background: var(--navy-claro); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-ouro { background: var(--ouro); color: var(--navy); }
.btn-ouro:hover { background: var(--ouro-claro); }
.btn-purpura { background: var(--purpura); color: var(--creme-claro); }
.btn-purpura:hover { background: #7a5a99; }
.btn-terracota { background: var(--terracota); color: white; }
.btn-verde { background: var(--verde); color: white; }
.btn-vinho { background: var(--vinho); color: white; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost:hover { background: var(--navy); color: var(--creme-claro); }
.btn-sm { padding: .4rem .9rem; font-size: .85rem; }

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  padding: .75rem 1rem;
  border: 1.5px solid #d5c8a8;
  border-radius: 8px;
  background: var(--creme-claro);
  color: var(--navy);
  width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--purpura);
  box-shadow: 0 0 0 3px rgba(107, 74, 138, 0.15);
}
textarea { min-height: 180px; resize: vertical; font-family: 'Montserrat', sans-serif; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--navy); }

.card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--sombra);
  border: 1px solid rgba(201, 169, 97, 0.2);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.navbar {
  background: var(--navy);
  color: var(--creme-claro);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sombra);
}
.navbar h1 { color: var(--ouro); font-size: 1.4rem; margin: 0; font-family: 'Cormorant Garamond', serif; }
.navbar a { color: var(--creme-claro); margin: 0 .8rem; font-weight: 500; }
.navbar a:hover { color: var(--ouro); text-decoration: none; }
.navbar .nav-direita { display: flex; align-items: center; gap: 1rem; }
.user-chip { background: rgba(201, 169, 97, 0.15); padding: .4rem .9rem; border-radius: 20px; font-size: .85rem; }

.flex { display: flex; gap: 1rem; }
.flex-col { display: flex; flex-direction: column; gap: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.tag {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--ouro);
  color: var(--navy);
}
.tag-purpura { background: var(--purpura); color: white; }
.tag-verde { background: var(--verde); color: white; }
.tag-cinza { background: #d5c8a8; color: var(--navy); }

.alerta {
  padding: .9rem 1.1rem;
  border-radius: 8px;
  margin: 1rem 0;
  font-size: .9rem;
  border-left: 4px solid;
}
.alerta-erro { background: #fae5e5; color: var(--vinho); border-color: var(--vinho); }
.alerta-sucesso { background: #e5f0e0; color: var(--verde); border-color: var(--verde); }
.alerta-info { background: #f0e8f5; color: var(--purpura); border-color: var(--purpura); }
.alerta-aviso { background: #fae8d5; color: var(--terracota); border-color: var(--terracota); }

.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: var(--ouro);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid #e8dec0; }
th { background: rgba(201, 169, 97, 0.1); font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--navy); }
tbody tr:hover { background: rgba(201, 169, 97, 0.05); }

.mapa-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--sombra);
  border: 1px solid rgba(201, 169, 97, 0.2);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
  display: flex; flex-direction: column; gap: .5rem;
  height: 100%;
}
.mapa-card:hover { transform: translateY(-3px); box-shadow: var(--sombra-forte); }
.mapa-card h3 { margin: 0 0 .25rem 0; color: var(--navy); }
.mapa-card .meta { font-size: .8rem; color: var(--cinza); display: flex; gap: .5rem; flex-wrap: wrap; }

.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--creme) 0%, var(--ouro-claro) 100%);
  padding: 2rem;
}
.login-box {
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 16px;
  box-shadow: var(--sombra-forte);
  width: 100%; max-width: 420px;
  border-top: 5px solid var(--ouro);
}
.login-box h1 { text-align: center; color: var(--navy); margin-bottom: .25rem; }
.login-box .subtitulo { text-align: center; color: var(--cinza); font-size: .9rem; margin-bottom: 2rem; font-style: italic; }
.login-box button { width: 100%; padding: .9rem; font-size: 1rem; margin-top: .5rem; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--cinza); }
.empty-state h3 { font-style: italic; }

.hidden { display: none !important; }
