/* ============================================================
   assets/css/style.css — Painel Administrativo v4
   Umbanda Rainha da Justiça
   ============================================================ */

/* ── BASE ───────────────────────────────────────────────────── */
:root {
  --roxo:      #4B0082;
  --roxo-m:    #6A1FA0;
  --roxo-cl:   #EDE0F7;
  --ouro:      #C9A84C;
  --ouro-cl:   #FFF8E7;
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    8px;
  --shadow:    0 2px 12px rgba(0,0,0,.08);
  --transition: .2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #f0f2f5;
  color: #212529;
  font-size: 14px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

/* ── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #1a0a2e 0%, #0d0618 100%);
  border-right: 1px solid rgba(201,168,76,.15);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 2px; }

.sidebar-brand {
  padding: 1.1rem 1rem .9rem;
  border-bottom: 1px solid rgba(201,168,76,.15);
  font-family: 'Cinzel', 'Segoe UI', serif;
  font-size: .82rem;
  font-weight: 700;
  color: var(--ouro);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sidebar-brand .star {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 4px var(--ouro));
}

.sidebar-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 1.1rem 1rem .4rem;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid rgba(255,255,255,.07);
  margin: .4rem .75rem;
}

/* ── ACCORDION ──────────────────────────────────────────────── */
.sidebar-accordion {
  border-radius: var(--radius);
  margin: .1rem .6rem;
}
.sidebar-accordion-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255,255,255,.6);
  font-size: .78rem;
  font-weight: 600;
  padding: .55rem .75rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: color var(--transition), background var(--transition);
  letter-spacing: .01em;
}
.sidebar-accordion-btn:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.sidebar-accordion-btn.active { color: var(--ouro); }
.sidebar-accordion-btn .arrow {
  margin-left: auto;
  font-size: .6rem;
  transition: transform var(--transition);
  opacity: .5;
}
.sidebar-accordion-btn.open .arrow { transform: rotate(180deg); }

.sidebar-accordion-body { display: none; padding-left: .5rem; }
.sidebar-accordion-body.open { display: block; }

.sidebar-accordion-body .nav-link {
  font-size: .76rem;
  padding: .42rem .75rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  margin-left: .25rem;
}
.sidebar-accordion-body .nav-link.active {
  border-left-color: var(--ouro);
  background: rgba(201,168,76,.1);
  color: var(--ouro) !important;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: rgba(255,255,255,.58);
  font-size: .8rem;
  padding: .5rem .75rem;
  border-radius: 6px;
  margin: .05rem .6rem;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.06); }
.nav-link.active,
.nav-link.fw-semibold { color: var(--ouro) !important; font-weight: 600; }
.nav-link i { font-size: .9rem; flex-shrink: 0; }

/* ── TOPBAR / HEADER ────────────────────────────────────────── */
.admin-topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.admin-topbar .brand {
  font-weight: 700;
  font-size: .9rem;
  color: var(--roxo);
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid #f0f0f0;
  font-weight: 600;
  font-size: .88rem;
}

/* KPI Cards */
.kpi-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  border: 1px solid #e8eaed;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--kpi-color, var(--roxo));
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.kpi-card .kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  background: rgba(0,0,0,.04);
  margin-bottom: .85rem;
}
.kpi-card .kpi-num {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: .3rem;
}
.kpi-card .kpi-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6c757d;
}

/* ── TABLES ─────────────────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}
.table th {
  background: #f8f9fa;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6c757d;
  padding: .7rem 1rem;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}
.table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 700;
  padding: .25em .65em;
  border-radius: 20px;
  letter-spacing: .03em;
}
.bg-success { background: #d1e7dd !important; color: #0a3622 !important; }
.bg-warning { background: #fff3cd !important; color: #664d03 !important; }
.bg-danger  { background: #f8d7da !important; color: #58151c !important; }
.bg-info    { background: #cff4fc !important; color: #055160 !important; }
.bg-secondary{ background: #e9ecef !important; color: #495057 !important; }
.bg-dark    { background: #343a40 !important; color: #fff !important; }

/* ── FORMS ──────────────────────────────────────────────────── */
.form-control, .form-select {
  border: 1.5px solid #dee2e6;
  border-radius: 6px;
  padding: .5rem .85rem;
  font-size: .88rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  background: #fff;
  color: #212529;
}
.form-control:focus, .form-select:focus {
  border-color: var(--roxo-m);
  box-shadow: 0 0 0 3px rgba(106,31,160,.1);
}
.form-label {
  font-size: .78rem;
  font-weight: 700;
  color: #495057;
  margin-bottom: .35rem;
  display: block;
}
.form-text { font-size: .75rem; color: #6c757d; margin-top: .25rem; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .82rem;
  padding: .5rem 1.1rem;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.btn-warning { background: #c9a84c; border-color: #c9a84c; color: #fff; }
.btn-warning:hover { background: #b8970a; border-color: #b8970a; }
.btn-success { background: #198754; border-color: #198754; color: #fff; }
.btn-success:hover { background: #146c43; }
.btn-danger  { background: #dc3545; border-color: #dc3545; color: #fff; }
.btn-danger:hover  { background: #bb2d3b; }
.btn-dark    { background: #1a0a2e; border-color: #1a0a2e; color: #fff; }
.btn-dark:hover    { background: #0d0618; }
.btn-outline-secondary { background: transparent; border-color: #ced4da; color: #6c757d; }
.btn-outline-secondary:hover { background: #f8f9fa; }
.btn-outline-warning { background: transparent; border-color: #c9a84c; color: #c9a84c; }
.btn-outline-warning:hover { background: #c9a84c; color: #fff; }
.btn-outline-danger  { background: transparent; border-color: #dc3545; color: #dc3545; }
.btn-outline-danger:hover  { background: #dc3545; color: #fff; }
.btn-outline-info    { background: transparent; border-color: #0dcaf0; color: #0dcaf0; }
.btn-outline-info:hover    { background: #0dcaf0; color: #000; }
.btn-outline-success { background: transparent; border-color: #198754; color: #198754; }
.btn-outline-success:hover { background: #198754; color: #fff; }
.btn-outline-light   { background: transparent; border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.7); }
.btn-outline-light:hover   { background: rgba(255,255,255,.1); color: #fff; }
.btn-primary { background: var(--roxo); border-color: var(--roxo); color: #fff; }
.btn-primary:hover { background: var(--roxo-m); }
.btn-sm { font-size: .75rem; padding: .3rem .75rem; }
.btn-lg { font-size: .95rem; padding: .72rem 1.6rem; }
.btn-link { background: none; border: none; color: var(--roxo-m); padding: 0; font-weight: 600; }
.btn-link:hover { color: var(--roxo); text-decoration: underline; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.w-100 { width: 100%; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: .87rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}
.alert-success { background: #d1e7dd; border-color: #a3cfbb; color: #0a3622; }
.alert-danger  { background: #f8d7da; border-color: #f1aeb5; color: #58151c; }
.alert-warning { background: #fff3cd; border-color: #ffe69c; color: #664d03; }
.alert-info    { background: #cff4fc; border-color: #9eeaf9; color: #055160; }
.alert-dismissible { padding-right: 2.5rem; position: relative; }
.btn-close {
  position: absolute; top: .7rem; right: .7rem;
  background: none; border: none;
  font-size: 1rem; cursor: pointer;
  opacity: .5; transition: opacity var(--transition);
}
.btn-close:hover { opacity: 1; }
.btn-close::before { content: '✕'; }

/* ── UTILS ──────────────────────────────────────────────────── */
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.align-items-center { align-items: center !important; }
.align-items-start  { align-items: flex-start !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-end     { justify-content: flex-end !important; }
.gap-0 { gap: 0 !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.text-center { text-align: center !important; }
.text-end    { text-align: right !important; }
.text-muted  { color: #6c757d !important; }
.text-danger { color: #dc3545 !important; }
.text-success{ color: #198754 !important; }
.text-warning{ color: #c9a84c !important; }
.text-white  { color: #fff !important; }
.fw-bold     { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.small, .fs-6 { font-size: .82rem !important; }
.fst-italic  { font-style: italic !important; }
.text-truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.p-0 { padding: 0 !important; }
.p-2 { padding: .5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
.px-2 { padding-left: .5rem !important; padding-right: .5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pt-2 { padding-top: .5rem !important; }
.pb-2 { padding-bottom: .5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.ms-1 { margin-left: .25rem !important; }
.ms-2 { margin-left: .5rem !important; }
.ms-auto { margin-left: auto !important; }
.me-1 { margin-right: .25rem !important; }
.me-2 { margin-right: .5rem !important; }
.h-100 { height: 100% !important; }
.min-width-0 { min-width: 0 !important; }
.opacity-25 { opacity: .25 !important; }
.opacity-50 { opacity: .5 !important; }
.shadow-sm { box-shadow: 0 1px 6px rgba(0,0,0,.07) !important; }
.border   { border: 1px solid #dee2e6 !important; }
.border-0 { border: none !important; }
.border-warning { border-color: #c9a84c !important; }
.border-2 { border-width: 2px !important; }
.rounded  { border-radius: 6px !important; }
.rounded-circle { border-radius: 50% !important; }
.overflow-hidden { overflow: hidden !important; }
.position-relative { position: relative !important; }
.d-none { display: none !important; }
.col-12 { width: 100% !important; }

/* Grid rows/cols básico */
.row { display: flex; flex-wrap: wrap; margin: 0 -.75rem; }
.row > * { padding: 0 .75rem; }
.g-2 > * { margin-bottom: .5rem; }
.g-3 > * { margin-bottom: 1rem; }
.g-4 > * { margin-bottom: 1.5rem; }
.col { flex: 1 0 0; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }

/* ── AVATAR ─────────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--roxo-cl);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: var(--roxo);
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── LIST GROUP ─────────────────────────────────────────────── */
.list-group { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; }
.list-group-item { padding: .7rem 1rem; border-bottom: 1px solid #f0f0f0; background: #fff; }
.list-group-item:last-child { border-bottom: none; }
.list-group-item-action { cursor: pointer; transition: background var(--transition); }
.list-group-item-action:hover { background: #f8f9fa; }
.list-group-flush { border: 1px solid #e8eaed; border-radius: 0 0 var(--radius) var(--radius); }

/* ── PAGINATION ─────────────────────────────────────────────── */
.pagination { display: flex; gap: .25rem; list-style: none; flex-wrap: wrap; }
.page-item .page-link {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  font-size: .82rem;
  font-weight: 600;
  color: var(--roxo-m);
  background: #fff;
  transition: all var(--transition);
}
.page-item .page-link:hover { background: var(--roxo-cl); border-color: var(--roxo-m); }
.page-item.active .page-link { background: var(--roxo); border-color: var(--roxo); color: #fff; }

/* ── PROGRESS ───────────────────────────────────────────────── */
.progress { height: 7px; border-radius: 4px; background: #e9ecef; overflow: hidden; }
.progress-bar { height: 100%; background: var(--roxo); border-radius: 4px; transition: width .4s ease; }

/* ── MODAL (básico) ─────────────────────────────────────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040; }
.modal { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-dialog { background: #fff; border-radius: var(--radius); box-shadow: 0 20px 80px rgba(0,0,0,.3); width: 100%; max-width: 540px; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid #dee2e6; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-weight: 700; font-size: .95rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: .85rem 1.25rem; border-top: 1px solid #dee2e6; display: flex; justify-content: flex-end; gap: .5rem; }

/* ── DISPLAY ─── */
.display-1 { font-size: 4rem; font-weight: 700; }
.fs-1 { font-size: 2rem !important; }
.fs-4 { font-size: 1.1rem !important; }
.fs-5 { font-size: .95rem !important; }

/* ── RESPONSIVE ADMIN ───────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 100%; min-height: auto; position: relative; }
  .flex-grow-1.p-4 { padding: 1rem !important; }
  .kpi-card .kpi-num { font-size: 1.4rem; }
  .table { font-size: .78rem; }
  .col-md-4 { flex: 0 0 100%; max-width: 100%; }
}
