/* Novo Sistema Control — layout base (Fase 1) */
:root {
  --ns-bg: #f1f5f9;
  --ns-card: #ffffff;
  --ns-ink: #0f172a;
  --ns-muted: #64748b;
  --ns-primary: #4f46e5;
  --ns-primary-2: #7c3aed;
  --ns-ok: #15803d;
  --ns-err: #b91c1c;
  --ns-border: #e2e8f0;
  --ns-sidebar: #0f172a;
}
* { box-sizing: border-box; }
body.ns-body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--ns-bg);
  color: var(--ns-ink);
  min-height: 100vh;
}
.ns-topbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: .55rem 1.25rem;
  background: linear-gradient(120deg, var(--ns-primary), var(--ns-primary-2));
  color: #fff;
  min-height: 48px;
}
.ns-brand { flex: 0 0 auto; }
.ns-brand a { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.ns-user {
  display: flex; gap: .75rem; align-items: center;
  font-size: .9rem; flex: 0 0 auto; white-space: nowrap;
}
.ns-user strong { font-weight: 700; }
.ns-link { color: #fff; text-decoration: underline; }
.ns-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 56px); }
.ns-layout-home { grid-template-columns: 1fr; }
.ns-top-menus {
  display: flex; gap: .45rem; flex-wrap: nowrap;
  justify-content: center; flex: 1 1 auto; min-width: 0;
}
.ns-top-menu-btn {
  color: #fff; text-decoration: none; font-weight: 600; font-size: .85rem;
  padding: .3rem .7rem; border-radius: 8px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  white-space: nowrap;
}
.ns-top-menu-btn:hover, .ns-top-menu-btn.active {
  background: #fff; color: var(--menu-accent, #4f46e5);
}
.ns-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-access-card {
  display: block; text-decoration: none; color: inherit;
  background: var(--ns-card); border: 1px solid var(--ns-border);
  border-radius: 14px; padding: 1.25rem; box-shadow: 0 1px 2px rgba(15,23,42,.04);
  border-top: 4px solid var(--menu-accent, var(--ns-primary));
  transition: transform .15s ease, box-shadow .15s ease;
}
.ns-access-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
.ns-access-card-title { font-size: 1.25rem; font-weight: 700; margin-bottom: .35rem; color: var(--menu-accent, var(--ns-ink)); }
.ns-access-list { margin: .75rem 0 1rem; padding-left: 1.1rem; color: var(--ns-muted); font-size: .9rem; }
.ns-hero-dash h1 { margin-bottom: .35rem; }
.ns-sidebar { background: var(--ns-sidebar); color: #cbd5e1; padding: 1rem .75rem 2rem; }
.ns-menu-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; margin: .75rem .5rem .35rem; }
.ns-menu-sub { font-size: .8rem; color: #a5b4fc; margin: 0 .5rem .4rem; font-weight: 600; }
.ns-sidebar ul { list-style: none; margin: 0; padding: 0; }
.ns-sidebar a {
  display: block;
  color: #e2e8f0;
  text-decoration: none;
  padding: .55rem .7rem;
  border-radius: 8px;
  font-size: .9rem;
}
.ns-sidebar a:hover, .ns-sidebar a.active { background: #1e293b; color: #fff; }
.ns-main { padding: 1.25rem 1.5rem 2rem; }
.ns-footer { text-align: center; color: var(--ns-muted); font-size: .8rem; padding: .75rem; }
.ns-card {
  background: var(--ns-card);
  border: 1px solid var(--ns-border);
  border-radius: 12px;
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.ns-card h1, .ns-card h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
.ns-grid { display: grid; gap: 1rem; }
.ns-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ns-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ns-kpi { font-size: 1.6rem; font-weight: 700; }
.ns-muted { color: var(--ns-muted); font-size: .88rem; }
.ns-btn {
  appearance: none; border: 0; border-radius: 8px; padding: .55rem .9rem;
  background: var(--ns-primary); color: #fff; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-block; font-size: .9rem;
}
.ns-btn:hover { filter: brightness(1.05); }
.ns-btn.secondary { background: #334155; }
.ns-btn.danger { background: var(--ns-err); }
.ns-btn.ok { background: var(--ns-ok); }
.ns-btn.ghost { background: #e2e8f0; color: #0f172a; }
.ns-form-row { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .75rem; margin-bottom: .75rem; }
.ns-form-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; font-weight: 600; }
.ns-form-row input, .ns-form-row select, .ns-form-row textarea {
  font: inherit; padding: .5rem .65rem; border: 1px solid var(--ns-border); border-radius: 8px;
}
.ns-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.ns-table th, .ns-table td { border-bottom: 1px solid var(--ns-border); padding: .55rem .4rem; text-align: left; vertical-align: top; }
.ns-table th { color: var(--ns-muted); font-size: .75rem; text-transform: uppercase; }
.ns-banner { padding: .7rem .9rem; border-radius: 8px; margin-bottom: .75rem; display: none; }
.ns-banner.show { display: block; }
.ns-banner.ok { background: #dcfce7; color: #166534; }
.ns-banner.err { background: #fee2e2; color: #991b1b; }
.ns-banner.info { background: #e0e7ff; color: #3730a3; }
.ns-status { display: inline-block; min-width: 2.5rem; text-align: center; padding: .1rem .35rem; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.ns-status.s2 { background: #dcfce7; color: #166534; }
.ns-status.s3 { background: #e0e7ff; color: #3730a3; }
.ns-status.s4 { background: #ffedd5; color: #9a3412; }
.ns-status.s5 { background: #fee2e2; color: #991b1b; }
.ns-status.s0 { background: #e2e8f0; color: #475569; }
@media (max-width: 960px) {
  .ns-layout { grid-template-columns: 1fr; }
  .ns-sidebar { display: none; }
  .ns-grid-4, .ns-grid-3, .ns-grid-2, .ns-form-row { grid-template-columns: 1fr; }
  .ns-topbar { gap: .5rem; padding: .45rem .75rem; }
  .ns-top-menu-btn { padding: .25rem .55rem; font-size: .8rem; }
  .ns-user { font-size: .8rem; }
}
