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

:root {
  --acu-ink: #0b1c28;
  --acu-sidebar: #0d2433;
  --acu-sidebar-2: #143447;
  --acu-panel: #102c3d;
  --acu-accent: #0f9f7a;
  --acu-accent-deep: #0b7a5e;
  --acu-accent-soft: rgba(15, 159, 122, 0.12);
  --acu-sand: #f4efe6;
  --acu-mist: #e8eef2;
  --acu-warn: #c47a12;
  --acu-danger: #c83c3c;
  --acu-info: #2a6f97;
  --acu-text: #17212b;
  --acu-muted: #5f6f7c;
  --acu-card: #ffffff;
  --acu-border: #d9e2e8;
  --acu-radius: 14px;
  --acu-radius-sm: 10px;
  --sidebar-w: 280px;
  --topbar-h: 68px;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  --shadow-soft: 0 10px 30px rgba(11, 28, 40, 0.06);
  --shadow-lift: 0 16px 40px rgba(11, 28, 40, 0.1);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--acu-text);
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(15, 159, 122, 0.10), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(42, 111, 151, 0.10), transparent 50%),
    linear-gradient(180deg, #f2f5f7 0%, #eef2f4 40%, #f7f5f1 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acu-accent-deep); text-decoration: none; }
a:hover { color: var(--acu-accent); }

.app-shell { display: flex; min-height: 100vh; }

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-w);
  background:
    linear-gradient(165deg, rgba(15, 159, 122, 0.12), transparent 28%),
    linear-gradient(180deg, var(--acu-sidebar) 0%, var(--acu-sidebar-2) 100%);
  color: #dce7ee;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1040;
  overflow-y: auto;
  transition: transform .28s var(--ease);
  border-right: 1px solid rgba(255,255,255,.04);
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 99px; }

.sidebar .brand {
  padding: 1.35rem 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  position: sticky;
  top: 0;
  background: rgba(13, 36, 51, 0.92);
  backdrop-filter: blur(8px);
  z-index: 2;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  background:
    linear-gradient(145deg, #1bb889, #0c6f57 55%, #0f2a3d);
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar .brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  margin: 0;
  line-height: 1.1;
}
.sidebar .brand-sub {
  font-size: .72rem;
  color: #8fa8b8;
  margin-top: .15rem;
  letter-spacing: .04em;
}

.nav-group { padding: .35rem 0 .15rem; }
.nav-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  color: #7f97ab;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: .85rem 1.25rem .4rem;
  cursor: pointer;
}
.nav-group-toggle i { transition: transform .2s var(--ease); font-size: .75rem; }
.nav-group.collapsed .nav-group-toggle i { transform: rotate(-90deg); }
.nav-group.collapsed .nav-group-body { display: none; }

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  color: #b7c8d4;
  padding: .58rem 1.15rem .58rem 1.1rem;
  margin: 0 .55rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .92rem;
  font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.sidebar .nav-link i {
  width: 1.25rem;
  text-align: center;
  opacity: .85;
  font-size: 1rem;
}
.sidebar .nav-link .nav-hint {
  display: none;
}
.sidebar .nav-link:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
  transform: translateX(2px);
}
.sidebar .nav-link.active {
  background: linear-gradient(90deg, rgba(15,159,122,.22), rgba(15,159,122,.08));
  color: #fff;
  border-color: rgba(15,159,122,.25);
}
.sidebar .nav-link.active i { color: #5fd4b0; opacity: 1; }

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.15rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .75rem;
  color: #7f97ab;
}
.flow-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  padding: .25rem .6rem;
  margin: .15rem .15rem 0 0;
  color: #c5d5e0;
  font-size: .68rem;
}

/* ——— Main / Topbar ——— */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(217, 226, 232, .9);
  padding: 0 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.topbar .search-wrap { flex: 1; max-width: 520px; }
.topbar .search-wrap input {
  border-radius: 12px;
  border: 1px solid var(--acu-border);
  padding: .62rem 1rem .62rem 2.55rem;
  width: 100%;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85zm-5.242.656a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E") 0.95rem center no-repeat;
  box-shadow: 0 1px 0 rgba(255,255,255,.8);
  transition: border-color .15s, box-shadow .15s;
}
.topbar .search-wrap input:focus {
  outline: none;
  border-color: rgba(15,159,122,.45);
  box-shadow: 0 0 0 3px var(--acu-accent-soft);
}
#globalSearchResults {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--acu-border);
  margin-top: .4rem;
}
.topbar-actions .btn {
  border-radius: 11px;
  border-color: var(--acu-border);
  background: #fff;
}
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  border-radius: 999px !important;
  padding: .35rem .7rem .35rem .4rem !important;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #1bb889, #0f2a3d);
  color: #fff;
  display: grid; place-items: center;
  font-size: .75rem;
  font-weight: 700;
}

.content { padding: 1.35rem 1.5rem 2rem; }

/* ——— Page chrome ——— */
.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.breadcrumb-acu {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  font-size: .8rem;
  color: var(--acu-muted);
  margin-bottom: .45rem;
}
.breadcrumb-acu a { color: var(--acu-muted); }
.breadcrumb-acu a:hover { color: var(--acu-accent-deep); }
.breadcrumb-acu .sep { opacity: .5; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .2rem;
  color: var(--acu-ink);
}
.page-sub {
  color: var(--acu-muted);
  margin: 0;
  font-size: .95rem;
  max-width: 52rem;
  line-height: 1.45;
}
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

.help-banner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: linear-gradient(110deg, #0f2a3d 0%, #16485a 55%, #0f7a62 140%);
  color: #e8f2f7;
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}
.help-banner::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.help-banner .help-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(255,255,255,.12);
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.help-banner h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 .25rem;
  font-weight: 700;
}
.help-banner p { margin: 0; font-size: .9rem; opacity: .9; line-height: 1.4; }
.help-banner .btn-close-help {
  position: absolute;
  top: .7rem; right: .8rem;
  background: transparent;
  border: 0;
  color: rgba(255,255,255,.7);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1;
}

/* ——— Cards / KPI ——— */
.card-acu {
  background: var(--acu-card);
  border: 1px solid rgba(217,226,232,.95);
  border-radius: var(--acu-radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.card-acu .card-body { padding: 1.15rem 1.25rem; }
.card-acu .card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1.25rem .15rem;
}
.card-acu .card-head h2,
.card-acu .card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--acu-ink);
}

.kpi {
  background: var(--acu-card);
  border: 1px solid rgba(217,226,232,.95);
  border-radius: var(--acu-radius);
  padding: 1.05rem 1.15rem;
  height: 100%;
  box-shadow: var(--shadow-soft);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--kpi-accent, var(--acu-accent));
}
.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.kpi .label {
  color: var(--acu-muted);
  font-size: .76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.kpi .value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: .35rem 0 .15rem;
  letter-spacing: -.02em;
  color: var(--acu-ink);
}
.kpi .delta { font-size: .8rem; font-weight: 600; }
.kpi .delta.up { color: var(--acu-accent-deep); }
.kpi .delta.down { color: var(--acu-danger); }
.kpi .kpi-icon {
  position: absolute;
  right: .9rem; top: .9rem;
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--acu-accent-soft);
  color: var(--acu-accent-deep);
}

/* ——— Flow / guide ——— */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
}
@media (max-width: 1199.98px) { .guide-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .guide-grid { grid-template-columns: 1fr; } }

.guide-card {
  display: block;
  background: #fff;
  border: 1px solid var(--acu-border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
  color: inherit;
  height: 100%;
  transition: border-color .18s, transform .18s var(--ease), box-shadow .18s;
  box-shadow: var(--shadow-soft);
}
.guide-card:hover {
  border-color: rgba(15,159,122,.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  color: inherit;
}
.guide-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--acu-ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: .65rem;
}
.guide-card h3 {
  font-family: var(--font-display);
  font-size: .98rem;
  margin: 0 0 .3rem;
  font-weight: 700;
}
.guide-card p {
  margin: 0;
  font-size: .84rem;
  color: var(--acu-muted);
  line-height: 1.4;
}

/* ——— Tables / badges / buttons ——— */
.badge-status {
  font-weight: 650;
  font-size: .72rem;
  padding: .38em .7em;
  border-radius: 8px;
  letter-spacing: .02em;
}
.badge-green { background: #e3f7ef; color: #0b6b4f; }
.badge-yellow { background: #fff3d9; color: #8a5a0b; }
.badge-red { background: #fde8e8; color: #9b2c2c; }
.badge-blue { background: #e4f0f8; color: #1d5678; }
.badge-gray { background: #e8eef2; color: #3d4f5c; }

.btn-acu {
  background: linear-gradient(180deg, #14a882, var(--acu-accent-deep));
  border: 1px solid var(--acu-accent-deep);
  color: #fff;
  font-weight: 600;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(15, 159, 122, .22);
}
.btn-acu:hover {
  background: var(--acu-accent-deep);
  border-color: var(--acu-accent-deep);
  color: #fff;
}
.btn-outline-acu {
  color: var(--acu-accent-deep);
  border-color: rgba(15,159,122,.4);
  background: #fff;
  font-weight: 600;
  border-radius: 11px;
}
.btn-outline-acu:hover {
  background: var(--acu-accent-soft);
  color: var(--acu-accent-deep);
  border-color: var(--acu-accent);
}
.btn-soft {
  background: #fff;
  border: 1px solid var(--acu-border);
  color: var(--acu-text);
  border-radius: 11px;
  font-weight: 600;
}
.btn-soft:hover { background: #f7fafb; border-color: #c8d4dc; }

.table-acu { margin-bottom: 0; }
.table-acu thead th {
  background: #f6f9fb;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--acu-muted);
  border-bottom: 1px solid var(--acu-border);
  white-space: nowrap;
  padding-top: .85rem;
  padding-bottom: .85rem;
}
.table-acu td {
  vertical-align: middle;
  font-size: .92rem;
  padding-top: .8rem;
  padding-bottom: .8rem;
  border-color: #edf2f5;
}
.table-acu tbody tr { transition: background .12s; }
.table-acu tbody tr:hover { background: #f8fbfc; }

.form-label {
  font-weight: 650;
  font-size: .84rem;
  color: #334553;
  margin-bottom: .35rem;
}
.form-control, .form-select {
  border-radius: 11px;
  border-color: var(--acu-border);
  padding: .62rem .85rem;
}
.form-control:focus, .form-select:focus {
  border-color: rgba(15,159,122,.45);
  box-shadow: 0 0 0 3px var(--acu-accent-soft);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  color: var(--acu-muted);
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, #e8f7f2, #eef3f7);
  display: grid; place-items: center;
  font-size: 1.6rem;
  color: var(--acu-accent-deep);
}
.empty-state h3 {
  font-family: var(--font-display);
  color: var(--acu-ink);
  font-size: 1.15rem;
  margin-bottom: .4rem;
}
.empty-state p { max-width: 28rem; margin: 0 auto 1.1rem; font-size: .92rem; }

.alert-list .alert {
  margin-bottom: .55rem;
  border-radius: 11px;
  border: 0;
  font-weight: 500;
}
.alert {
  border-radius: 12px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.toolbar .form-control,
.toolbar .form-select { max-width: 240px; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
  margin-bottom: 1rem;
}
@media (max-width: 767.98px) { .stat-strip { grid-template-columns: 1fr; } }
.stat-pill {
  background: #fff;
  border: 1px solid var(--acu-border);
  border-radius: 12px;
  padding: .8rem 1rem;
}
.stat-pill .s-label { font-size: .75rem; color: var(--acu-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat-pill .s-value { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-top: .15rem; }

.semaphore-green { color: #0b8a64; }
.semaphore-yellow { color: #c47a12; }
.semaphore-red { color: #c83c3c; }

/* ——— Auth ——— */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #0b1c28;
}
.auth-visual {
  position: relative;
  padding: clamp(2rem, 5vw, 4rem);
  color: #eef5f8;
  background:
    radial-gradient(600px 360px at 20% 20%, rgba(15,159,122,.28), transparent 60%),
    radial-gradient(500px 320px at 80% 80%, rgba(42,111,151,.25), transparent 55%),
    linear-gradient(160deg, #0b1c28 0%, #123447 55%, #0f4d45 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: auto -10% -20% 20%;
  height: 60%;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.04) 0 2px, transparent 2px 18px);
  transform: rotate(-8deg);
  pointer-events: none;
}
.auth-visual-inner { position: relative; z-index: 1; max-width: 460px; }
.auth-visual .brand-xl {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0 0 .6rem;
}
.auth-visual .lead {
  font-size: 1.05rem;
  opacity: .88;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.auth-points { list-style: none; padding: 0; margin: 0; }
.auth-points li {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  margin-bottom: .85rem;
  font-size: .92rem;
  opacity: .9;
}
.auth-points li i {
  color: #5fd4b0;
  margin-top: .15rem;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background:
    linear-gradient(180deg, #f7f9fa, #eef2f4);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow-lift);
  border: 1px solid rgba(217,226,232,.8);
}
.auth-brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--acu-ink);
  margin-bottom: .15rem;
}
.auth-card .muted { color: var(--acu-muted); margin-bottom: 1.4rem; }

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(8,18,26,.45);
  z-index: 1035;
  backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-backdrop.show { display: block; }
  .main { margin-left: 0; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { min-height: 220px; padding: 1.5rem; }
  .auth-points { display: none; }
}

@media (max-width: 575.98px) {
  .content { padding: .95rem; }
  .kpi .value { font-size: 1.25rem; }
  .btn { min-height: 42px; }
  .page-header { margin-bottom: 1rem; }
}

.fade-up {
  animation: fadeUp .45s var(--ease) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

#toast-container { position: fixed; top: 1rem; right: 1rem; z-index: 2000; min-width: 280px; }
.steps { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.steps .step {
  padding: .4rem .85rem; border-radius: 999px; background: #e8eef2; font-size: .8rem; font-weight: 650;
}
.steps .step.active { background: var(--acu-accent-deep); color: #fff; }
