/*
 * Tema do Enecult — visual inspirado no MaterialPro Lite (WrapPixel), recriado do zero
 * sobre Bootstrap 5 + Tabler Icons (ambos MIT). Nenhum arquivo do modelo foi copiado.
 */

:root {
  --app-primary: #1b84ff;
  --app-primary-rgb: 27, 132, 255;
  --app-primary-dark: #0f6fe0;
  --app-secondary: #43ced7;
  --app-body-bg: #eef5f9;
  --app-heading: #3a4752;
  --app-text: #5a6a78;
  --app-muted: #768b9e;
  --app-border: #e5eaef;
  --app-shadow: 0 3px 4px 0 rgba(0, 0, 0, .03), 0 0 1px 0 rgba(0, 0, 0, .10);
  --app-radius: 10px;
  --app-header-height: 64px;
  --app-sidebar-width: 260px;

  --bs-primary: var(--app-primary);
  --bs-primary-rgb: var(--app-primary-rgb);
  --bs-link-color: var(--app-primary);
  --bs-link-color-rgb: var(--app-primary-rgb);
  --bs-link-hover-color: var(--app-primary-dark);
  --bs-body-font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bs-body-font-size: .9rem;
  --bs-body-color: var(--app-text);
  --bs-heading-color: var(--app-heading);
  --bs-border-color: var(--app-border);
  --bs-success: #2cd07e;
  --bs-success-rgb: 44, 208, 126;
  --bs-danger: #f8285a;
  --bs-danger-rgb: 248, 40, 90;
  --bs-warning: #f6c000;
  --bs-warning-rgb: 246, 192, 0;
  --bs-info: #2cabe3;
  --bs-info-rgb: 44, 171, 227;
  --bs-primary-bg-subtle: #edf5fd;
  --bs-success-bg-subtle: #edfdf2;
  --bs-danger-bg-subtle: #fff0f4;
  --bs-warning-bg-subtle: #fffcf0;
  --bs-info-bg-subtle: #e4f5ff;
}

body { background: var(--app-body-bg); }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--app-heading); font-weight: 600; }
h1, .h1 { font-size: 1.45rem; }
h2, .h2 { font-size: 1.2rem; }
h3, .h3 { font-size: 1.05rem; }
h4, .h4 { font-size: .95rem; }
a { text-decoration: none; }

/* ------------------------------------------------------------------ cabeçalho */
.app-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1030;
  height: var(--app-header-height);
  background: var(--app-primary);
  display: flex; align-items: center; gap: .5rem;
  padding: 0 1rem;
  box-shadow: 1px 0 20px rgba(0, 0, 0, .12);
}
.app-brand {
  display: flex; align-items: center; gap: .6rem;
  width: calc(var(--app-sidebar-width) - 1rem);
  color: #fff; font-weight: 600; font-size: 1.15rem; letter-spacing: .02em;
}
.app-brand:hover { color: #fff; }
.app-brand .brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .18); font-size: 1.2rem;
}
.app-brand .brand-light { font-weight: 300; opacity: .85; }
.header-icon-btn {
  color: #fff; background: transparent; border: 0;
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem;
}
.header-icon-btn:hover { background: rgba(255, 255, 255, .15); color: #fff; }
.app-header .btn-light { color: var(--app-primary); font-weight: 500; }
.header-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--app-primary); font-weight: 600; font-size: .85rem;
  display: inline-flex; align-items: center; justify-content: center; border: 0;
}

/* ---------------------------------------------------------------- barra lateral */
.left-sidebar {
  position: fixed; top: var(--app-header-height); bottom: 0; left: 0; z-index: 1020;
  width: var(--app-sidebar-width);
  background: #fff; box-shadow: var(--app-shadow);
  overflow-y: auto; transition: transform .2s ease-in;
}
.sidebar-user {
  position: relative; padding: 1.25rem 1.25rem 1rem;
  background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-secondary) 100%);
  color: #fff;
}
.sidebar-user .avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .95); color: var(--app-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 1.1rem; margin-bottom: .6rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.sidebar-user .name { font-weight: 600; line-height: 1.3; }
.sidebar-user .email { font-size: .78rem; opacity: .85; word-break: break-all; }
.sidebar-nav { padding: 0 1rem 1.5rem; }
.nav-small-cap {
  margin-top: 1.4rem; padding-bottom: .5rem;
  color: var(--app-heading); font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.sidebar-link {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; border-radius: 26px;
  color: var(--app-heading); font-size: .9rem; white-space: nowrap;
}
.sidebar-link .ti { font-size: 1.25rem; flex-shrink: 0; }
.sidebar-link:hover { background: var(--bs-primary-bg-subtle); color: var(--app-primary); }
.sidebar-link.active { background: var(--app-primary); color: #fff; box-shadow: 0 4px 10px rgba(var(--app-primary-rgb), .3); }
.sidebar-link .badge { margin-left: auto; }

/* -------------------------------------------------------------------- conteúdo */
.body-wrapper { padding-top: var(--app-header-height); margin-left: var(--app-sidebar-width); min-height: 100vh; }
.body-wrapper > .container-fluid { max-width: 1300px; padding: 1.75rem; }
.page-header { margin-bottom: 1.25rem; }
.page-header .back-link { font-size: .85rem; color: var(--app-muted); display: inline-flex; align-items: center; gap: .25rem; }
.page-header .back-link:hover { color: var(--app-primary); }
.page-header h1 { margin: .15rem 0 0; }
.page-header .subtitle { color: var(--app-muted); margin: .15rem 0 0; }

.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .left-sidebar { transform: translateX(-100%); }
  body.show-sidebar .left-sidebar { transform: none; }
  body.show-sidebar .sidebar-backdrop {
    display: block; position: fixed; inset: var(--app-header-height) 0 0 0; z-index: 1010; background: rgba(0, 0, 0, .3);
  }
  .body-wrapper { margin-left: 0; }
  .body-wrapper > .container-fluid { padding: 1.1rem; }
  .app-brand { width: auto; }
}

/* ---------------------------------------------------------------------- cartões */
.card { border: 0; border-radius: var(--app-radius); box-shadow: var(--app-shadow); margin-bottom: 1.5rem; }
.card-body { padding: 1.75rem; }
.card-header { background: transparent; border-bottom: 1px solid var(--app-border); padding: 1.1rem 1.75rem; }
.card-title { font-size: 1.05rem; font-weight: 600; color: var(--app-heading); margin-bottom: .25rem; }
.card-subtitle { color: var(--app-muted); font-size: .82rem; }
.card-body > :last-child { margin-bottom: 0; }
@media (max-width: 575.98px) { .card-body { padding: 1.1rem; } .card-header { padding: .9rem 1.1rem; } }

.stat-icon {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.4rem;
}

/* --------------------------------------------------------------------- botões */
.btn { border-radius: 30px; font-weight: 500; padding: .5rem 1.25rem; font-size: .88rem; }
.btn-sm { padding: .3rem .85rem; font-size: .8rem; }
.btn-primary { --bs-btn-bg: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary-dark); --bs-btn-hover-border-color: var(--app-primary-dark);
  --bs-btn-active-bg: var(--app-primary-dark); --bs-btn-disabled-bg: var(--app-primary); --bs-btn-disabled-border-color: var(--app-primary); }
.btn-outline-primary { --bs-btn-color: var(--app-primary); --bs-btn-border-color: var(--app-primary);
  --bs-btn-hover-bg: var(--app-primary); --bs-btn-hover-border-color: var(--app-primary); --bs-btn-active-bg: var(--app-primary); }
.btn-light-primary { background: var(--bs-primary-bg-subtle); color: var(--app-primary); border: 0; }
.btn-light-primary:hover { background: var(--app-primary); color: #fff; }
.btn .ti { font-size: 1.05rem; vertical-align: -2px; }
form.inline { display: inline; }

/* ------------------------------------------------------------------ formulários */
.form-control, .form-select { border-radius: 8px; border-color: #dfe5ef; padding: .55rem .85rem; font-size: .88rem; color: var(--app-heading); }
.form-control:focus, .form-select:focus { border-color: rgba(var(--app-primary-rgb), .6); box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .12); }
.form-label { font-weight: 500; color: var(--app-heading); margin-bottom: .35rem; font-size: .86rem; }
.form-text { color: var(--app-muted); font-size: .78rem; }
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.errorlist { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--bs-danger); font-size: .8rem; }
.errorlist.nonfield, .errorlist.nonform { padding: .75rem 1rem; border-radius: 8px; background: var(--bs-danger-bg-subtle); margin-bottom: 1rem; }
fieldset[disabled] { opacity: .75; }
.author-row { border: 1px dashed #d5dde8; border-radius: var(--app-radius); padding: 1.1rem 1.1rem .2rem; margin-bottom: 1rem; background: #fbfcfe; }

/* ---------------------------------------------------------------- tabelas etc. */
.table { --bs-table-color: var(--app-text); margin-bottom: 0; font-size: .86rem; }
.table > thead th { color: var(--app-heading); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; border-bottom-width: 1px; white-space: nowrap; }
.table td, .table th { vertical-align: middle; padding: .8rem .75rem; }
.badge { font-weight: 500; border-radius: 30px; padding: .38em .8em; }
.status-badge { font-size: .74rem; }
.alert { border: 0; border-radius: var(--app-radius); display: flex; gap: .6rem; align-items: flex-start; }
.alert .ti { font-size: 1.2rem; line-height: 1.3; }
.filters .form-label { font-size: .78rem; }
details > summary { cursor: pointer; font-weight: 500; color: var(--app-primary); margin-bottom: .75rem; }
.definition-list dt { color: var(--app-muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.definition-list dd { color: var(--app-heading); margin-bottom: .9rem; }
.empty-state { text-align: center; color: var(--app-muted); padding: 2rem 1rem; }
.empty-state .ti { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* ---------------------------------------------------------- telas de entrada */
.auth-wrapper {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
  background: radial-gradient(circle at 10% 10%, rgba(var(--app-primary-rgb), .12), transparent 40%),
              radial-gradient(circle at 90% 90%, rgba(67, 206, 215, .15), transparent 40%), var(--app-body-bg);
}
.auth-card { width: 100%; max-width: 460px; }
.auth-card .app-brand { color: var(--app-primary); width: auto; justify-content: center; margin-bottom: 1.25rem; }
.auth-card .app-brand .brand-mark { background: var(--bs-primary-bg-subtle); }
