/* WayChurch — Painel Super Admin · Identidade visual */
:root {
  /* Primarias */
  --color-navy:       #1B2A4A;
  --color-navy-hover: #243660;
  --color-gold:       #B8972A;
  --color-gold-light: #D4AF37;
  /* Neutras */
  --color-bg:         #F4F6FA;
  --color-surface:    #FFFFFF;
  --color-border:     #E2E8F0;
  --color-text:       #1B2A4A;
  --color-muted:      #64748B;
  /* Semanticas */
  --color-success:    #059669;
  --color-warning:    #D97706;
  --color-danger:     #DC2626;
  --color-info:       #0891B2;

  --font-brand: 'Montserrat', sans-serif;
  --font-ui:    'Inter', sans-serif;

  --sidebar-w: 256px;
  --radius:    12px;
}

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

body {
  font-family: var(--font-ui);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* --- Marca --- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: rgba(184,151,42,0.15);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(184,151,42,0.35);
}
.brand-icon svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-way    { font-family: var(--font-brand); font-weight: 800; font-size: 12px; color: var(--color-gold); letter-spacing: 2px; }
.brand-church { font-family: var(--font-brand); font-weight: 800; font-size: 22px; color: #fff; letter-spacing: -0.5px; }
.brand-tagline { font-family: var(--font-brand); font-weight: 600; font-size: 8px; color: var(--color-gold); letter-spacing: 2px; text-transform: uppercase; margin-top: 2px; }

/* --- Layout app --- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--color-navy);
  border-right: 1px solid rgba(184,151,42,0.2);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0;
}
.sidebar-header { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-logo { width: 190px; max-width: 100%; height: auto; display: block; }
.sidebar-nav { padding: 16px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 8px;
  color: rgba(255,255,255,0.72); font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-item.active {
  background: rgba(184,151,42,0.15);
  border-left: 3px solid var(--color-gold);
  color: var(--color-gold-light);
}
.sidebar-item svg { width: 18px; height: 18px; opacity: .9; }
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.08); }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 28px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-family: var(--font-brand); font-size: 20px; font-weight: 700; }
.topbar .user { display: flex; align-items: center; gap: 10px; color: var(--color-muted); font-size: 13px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-navy); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.content { padding: 28px; }

/* --- Cards / metricas --- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 26px; }
.metric-card { padding: 20px; display: flex; align-items: center; gap: 16px; }
.metric-card-icon {
  width: 52px; height: 52px; border-radius: 10px;
  background: rgba(27,42,74,0.08); color: var(--color-navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.metric-card-icon.gold { background: rgba(184,151,42,0.12); color: var(--color-gold); }
.metric-card-icon svg { width: 26px; height: 26px; }
.metric-value { font-family: var(--font-brand); font-size: 28px; font-weight: 800; line-height: 1; }
.metric-label { color: var(--color-muted); font-size: 13px; margin-top: 4px; }

/* --- Tabela --- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-brand); font-size: 18px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--color-muted); padding: 12px 16px; border-bottom: 1px solid var(--color-border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #FAFBFD; }
.t-strong { font-weight: 600; }
.t-muted { color: var(--color-muted); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* --- Badges --- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: #DCFCE7; color: #166534; }
.badge-muted   { background: #F1F5F9; color: #64748B; }
.badge-gold    { background: rgba(184,151,42,0.14); color: #8a7320; }
.badge-plano   { background: rgba(27,42,74,0.08); color: var(--color-navy); text-transform: capitalize; }

/* --- Botoes --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: 14px;
  border: none; cursor: pointer; font-family: var(--font-ui); transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--color-navy); color: #fff; }
.btn-primary:hover { background: var(--color-navy-hover); }
.btn-gold { background: var(--color-gold); color: #fff; font-weight: 700; }
.btn-gold:hover { background: var(--color-gold-light); }
.btn-ghost { background: transparent; color: var(--color-navy); border: 1px solid var(--color-border); }
.btn-ghost:hover { background: #F1F5F9; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-danger-ghost { background: transparent; color: var(--color-danger); border: 1px solid #FCA5A5; }
.btn-danger-ghost:hover { background: #FEF2F2; }

/* --- Formularios --- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 600; font-size: 13px; }
.hint { color: var(--color-muted); font-size: 12px; }
input, select, textarea {
  border: 1px solid var(--color-border); border-radius: 8px;
  padding: 11px 13px; font-family: var(--font-ui); font-size: 14px; color: var(--color-text);
  background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(27,42,74,0.1);
}
.fieldset { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.fieldset legend { font-weight: 700; padding: 0 8px; color: var(--color-navy); }

/* --- Alertas --- */
.alert { padding: 13px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }

/* --- Paginacao --- */
.pagination { display: flex; gap: 6px; margin-top: 18px; align-items: center; }
.pagination a, .pagination span {
  padding: 7px 12px; border-radius: 7px; border: 1px solid var(--color-border);
  background: #fff; font-size: 13px; color: var(--color-navy);
}
.pagination .current { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }

.empty { text-align: center; padding: 50px 20px; color: var(--color-muted); }

/* --- UX: mascaras, senha, cep --- */
input.input-error { border-color: var(--color-danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
input.is-loading {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%231B2A4A' stroke-width='2'%3E%3Cpath d='M21 12a9 9 0 1 1-6.2-8.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  animation: wc-pulse 0.9s ease-in-out infinite;
}
@keyframes wc-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

.pw-meter { margin-top: 8px; }
.pw-bar { height: 6px; background: #E2E8F0; border-radius: 999px; overflow: hidden; }
.pw-bar span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .2s, background .2s; }
.pw-bar span.s0, .pw-bar span.s1 { background: var(--color-danger); }
.pw-bar span.s2 { background: var(--color-warning); }
.pw-bar span.s3 { background: #16A34A; }
.pw-bar span.s4 { background: var(--color-success); }
.pw-label { font-size: 12px; color: var(--color-muted); margin-top: 4px; min-height: 16px; }
.pw-tools { display: flex; gap: 8px; margin-top: 8px; }
.pw-btn {
  background: #F1F5F9; border: 1px solid var(--color-border); color: var(--color-navy);
  border-radius: 7px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font-ui); transition: background .15s;
}
.pw-btn:hover { background: #E2E8F0; }

/* --- Login --- */
.login-wrap { display: flex; min-height: 100vh; }
.login-left {
  width: 42%; background: var(--color-navy); color: #fff;
  display: flex; flex-direction: column; justify-content: center; padding: 60px;
}
.login-left .brand-church { font-size: 34px; }
.login-left .brand-way { font-size: 15px; }
.login-hero-title { font-family: var(--font-brand); font-size: 26px; font-weight: 800; margin: 36px 0 12px; line-height: 1.2; }
.login-hero-sub { color: rgba(255,255,255,0.65); font-size: 15px; max-width: 360px; }
.login-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--color-bg); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--font-brand); font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-card .sub { color: var(--color-muted); margin-bottom: 26px; }
.login-logo-mark { width: 64px; height: 64px; border-radius: 14px; background: rgba(184,151,42,0.18); border: 1px solid rgba(184,151,42,0.4); display: flex; align-items: center; justify-content: center; }
.login-logo-mark svg { width: 38px; height: 38px; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .login-left { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
