@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&family=Maitree:wght@300;400;500;600;700&display=swap');

:root {
  /* Identidade do Governo do Ceará (baseada no Manual 2023) */
  --primary-color: rgb(0, 130, 65);
  --primary-hover: rgb(0, 198, 139);
  --secondary-color: rgb(0, 135, 209);
  --bg-color: #f8fafc;
  --surface-color: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: rgba(0, 130, 65, 0.15);
  --danger-color: #ef4444;
}

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

body {
  font-family: 'Maitree', serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(circle at 100% 0%, rgba(0, 198, 139, 0.1) 0%, transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(0, 135, 209, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6, .nav-brand, .btn-primary, .badge, th {
  font-family: 'Kanit', sans-serif;
}

/* Glassmorphism utils */
.glass-panel {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Auth Container */
.auth-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.login-box {
  width: 100%;
  max-width: 400px;
  padding: 2.5rem;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.login-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-family: 'Kanit', sans-serif;
}

.form-group input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: var(--text-main);
  font-family: 'Maitree', serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-hover);
  box-shadow: 0 0 0 3px rgba(0, 198, 139, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 198, 139, 0.25);
}

/* Dashboard Layout */
.dashboard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.nav-brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--primary-color);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-user .user-name {
  font-weight: 600;
  color: var(--text-main);
}

.btn-outline {
  display: inline-block;
  white-space: nowrap;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.dashboard-container {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.dash-header {
  margin-bottom: 2rem;
}

.dash-header h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.dash-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Table Design */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: rgba(0, 130, 65, 0.03);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: var(--primary-color);
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: background 0.2s;
}

tr:hover {
  background: rgba(0, 130, 65, 0.02);
}

td {
  font-size: 1.05rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 135, 209, 0.1);
  color: var(--secondary-color);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 5px;
}

.alert {
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  font-family: 'Kanit', sans-serif;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger-color);
  color: var(--danger-color);
}

/* MODAL / POPUP */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center; justify-content: center;
    z-index: 999999;
}
.modal {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25);
    max-width: 600px;
    width: 90%;
    border: 1px solid var(--primary-color);
}

/* SALA DE SITUAÇÃO */
.situation-room {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.05);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
}
.stat-header {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-number {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.5rem;
    font-family: 'Kanit', sans-serif;
}
.stat-number .stat-total {
    font-size: 1.4rem;
    color: var(--text-muted);
    font-weight: 400;
}
.highlight-danger { color: var(--danger-color) !important; }
.highlight-secondary { color: var(--secondary-color) !important; }

.stat-progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin: 0.5rem 0;
    overflow: hidden;
}
.stat-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 1s ease-out;
}
.stat-perc {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* MUNICIPIO GRID CARDS */
.municipios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}
.mun-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.95);
    transition: transform 0.2s, box-shadow 0.2s;
}
.mun-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}
.mun-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.mun-header h3 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--text-main);
}
.mun-progress {
    margin-bottom: 1.5rem;
}
.mun-progress-bar {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-bottom: 0.3rem;
}
.mun-progress-fill {
    height: 100%;
    background: var(--secondary-color);
    border-radius: 3px;
}
.mun-perc-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: right;
    font-weight: 600;
}
.mun-stats {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
}
.mun-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 0.5rem;
}
.mun-stat-item:last-child { border-bottom: none; }
.ms-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}
.ms-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Kanit', sans-serif;
}
.ms-value small {
    font-size: 0.8rem;
    color: #94a3b8;
}
