/* =========================
   RESET
========================= */

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

/* =========================
   BASE
========================= */

body {
  font-family: Arial, Helvetica, sans-serif;
  background: #f4f6f9;
  color: #2c3e50;
  height: 100vh;
}

/* =========================
   LAYOUT
========================= */

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  height: 60px;
  background: #1f2937;
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-weight: 600;
}

.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.sidebar {
  width: 240px;
  background: #111827;
  color: white;
  padding-top: 20px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  padding: 14px 20px;
  cursor: pointer;
  color: #cbd5e1;
  transition: 0.2s;
}

.sidebar li:hover {
  background: #1f2937;
  color: white;
}

.sidebar li.active {
  background: #4f46e5;
  color: white;
}

#content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

/* =========================
   COMPONENTS
========================= */

.card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

button {
  background: #4f46e5;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  background: #4338ca;
}

/* =========================
   TABLE
========================= */

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
}

tr:hover {
  background: #f3f4f6;
}

/* =========================
   FORMS (PADRÃO ÚNICO)
========================= */

.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #dcdcdc;
  border-radius: 6px;
  font-size: 14px;
}

.form-control:focus {
  border-color: #5b4bdb;
  outline: none;
}

.form-group {
  margin-bottom: 16px;
}

/* =========================
   MODAL (CORRIGIDO DEFINITIVO)
========================= */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.5);

  z-index: 999999; /* MUITO acima de tudo */
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 420px;
  max-width: 90%;

  background: #fff;
  padding: 28px;
  border-radius: 10px;

  box-shadow: 0 20px 40px rgba(0,0,0,0.3);

  position: relative;
  z-index: 1000000; /* sempre acima */
}

/* =========================
   DASHBOARD
========================= */

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 20px;
}

.metric-card {
  background: linear-gradient(135deg, #ffffff, #f3f4f6);
  padding: 20px;
  border-radius: 10px;
  border-left: 5px solid #6366f1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.metric-title {
  font-size: 14px;
  color: #6b7280;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

/* =========================
   DRE
========================= */

.dre-grid {
  display: flex;
  gap: 20px;
}

.dre-item {
  flex: 1;
  padding: 15px;
  border-radius: 10px;
  background: #f9fafb;
  text-align: center;
}

.dre-item.receita {
  border-left: 5px solid #22c55e;
}

.dre-item.despesa {
  border-left: 5px solid #ef4444;
}

.dre-item.resultado {
  border-left: 5px solid #3b82f6;
  font-size: 18px;
}

/* =========================
   LOGIN MODERNO
========================= */

.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  position: relative;
}

/* efeito suave no fundo */
.login-page::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1), transparent),
              radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1), transparent);
}

.login-card {
  width: 360px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  z-index: 1;
}

/* HEADER */
.login-header {
  padding: 30px 20px;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
}

.login-header h1 {
  font-size: 22px;
  margin-bottom: 5px;
}

.login-header p {
  font-size: 13px;
  opacity: 0.9;
}

/* BODY */
.login-body {
  padding: 30px 20px;
  text-align: center;
}

.login-body h2 {
  margin-bottom: 20px;
  color: #1f2937;
}

.header {
  position: relative;
  z-index: 1;
}

/* INPUT */
.input-group {
  margin-bottom: 15px;
}

.input-group input {
  width: 100%;
  padding: 12px;
  border-radius: 25px;
  border: none;
  background: #f1f5f9;
  font-size: 14px;
  text-align: center;
}

.input-group input:focus {
  outline: none;
  background: #e2e8f0;
}

/* BUTTON */
.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 25px;
  border: none;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

.login-btn:hover {
  opacity: 0.9;
}