/* ═══════════════════════════════════════════════════════════════
   FGSC — SISTEMA DE DESIGN
   /public_html/assets/css/fgsc-ui.css

   Única fonte de verdade do visual (admin + portal cliente).
   Alterações de cor, tipografia ou componentes fazem-se AQUI.

   Uso na página:
     <link rel="stylesheet" href="/assets/css/fgsc-ui.css?v=3">
     <script src="/assets/js/fgsc-app.js?v=3" defer></script>
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. TOKENS ─────────────────────────────────────────────── */
:root {
  --primary:        #0098DA;
  --primary-dark:   #023E8A;
  --primary-light:  #00B4D8;
  --primary-deep:   #03045E;

  --coral:          #F47450;
  --warning:        #F9A826;
  --success:        #22C55E;
  --info:           #6366F1;
  --purple:         #8B5CF6;

  --bg:             #F6F8FB;
  --bg-alt:         #F1F5F9;
  --card:           #FFFFFF;
  --border:         #E5EAF0;
  --border-strong:  #CBD5E1;

  --ink:            #0F172A;
  --ink-2:          #475569;
  --ink-3:          #64748B;
  --ink-4:          #94A3B8;

  --success-bg: #DCFCE7; --success-fg: #15803D;
  --warning-bg: #FEF3C7; --warning-fg: #92400E;
  --danger-bg:  #FEE2E2; --danger-fg:  #B91C1C;
  --info-bg:    #EEF2FF; --info-fg:    #4338CA;
  --neutral-bg: #F1F5F9; --neutral-fg: #475569;

  --font: 'Century Gothic',Arial,sans-serif;
  --font-mono: 'Century Gothic',Arial,sans-serif;

  --r:     14px;
  --r-sm:  8px;
  --r-pill: 999px;

  --sh-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.03);
  --sh-md: 0 4px 12px rgba(15,23,42,.06), 0 2px 4px rgba(15,23,42,.04);
  --sh-lg: 0 16px 48px rgba(15,23,42,.16);

  --grad-primary: linear-gradient(135deg, #0098DA 0%, #023E8A 100%);
  --grad-soft:    linear-gradient(135deg, #E0F2FE 0%, #F8FAFC 100%);
  --grad-coral:   linear-gradient(135deg, #F47450 0%, #F9A826 100%);

  --sidebar-w: 232px;
  --topbar-h:  60px;

  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t-base: 200ms cubic-bezier(.4,0,.2,1);
}

/* ── 2. BASE ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family:'Century Gothic',Arial,sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { max-width: 100%; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); }

/* ── 3. ESTRUTURA ──────────────────────────────────────────── */
.shell { display: flex; min-height: 100vh; }
.main  { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content {
  flex: 1;
  padding: 22px 26px 40px;
  max-width: 1600px;
  width: 100%;
}

/* ── 4. SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}
.sb-brand {
  padding: 20px 18px 16px;
  display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sb-brand img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.sb-brand-tx strong {
  display: block; font-size: 16px; font-weight: 700;
  color: #fff; letter-spacing: 3px; line-height: 1.1;
}
.sb-brand-tx span {
  display: block; font-size: 8.5px; color: rgba(255,255,255,.42);
  letter-spacing: .8px; margin-top: 2px;
}
.sb-user {
  margin: 14px 12px; padding: 11px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  display: flex; align-items: center; gap: 10px;
}
.sb-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-user-nm { font-size: 11.5px; font-weight: 600; color: #fff; line-height: 1.3; }
.sb-user-rl { font-size: 9.5px; color: rgba(255,255,255,.42); }

.sb-nav { flex: 1; padding: 4px 0 12px; }
.sb-group {
  font-size: 8.5px; font-weight: 700; color: rgba(255,255,255,.3);
  letter-spacing: 1.6px; text-transform: uppercase;
  padding: 16px 20px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; margin: 1px 10px;
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.6);
  font-size: 12.5px; text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.92); }
.nav-item.on { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.nav-item i { font-size: 16px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--primary); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-pill); flex-shrink: 0;
}
.nav-badge.alerta { background: var(--coral); }
.sb-foot { padding: 12px 10px 16px; border-top: 1px solid rgba(255,255,255,.06); }

/* ── 5. TOPBAR ─────────────────────────────────────────────── */
.topbar {
  min-height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 10px 26px;
  position: sticky; top: 0; z-index: 90;
}
.tb-title h1 { font-size: 17px; font-weight: 700; line-height: 1.25; }
.tb-title p  { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.tb-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.tb-date { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.tb-icon {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); text-decoration: none; flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.tb-icon:hover { background: var(--border); color: var(--ink); }
.tb-icon i { font-size: 17px; }
.tb-count {
  position: absolute; top: -3px; right: -3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--coral); color: #fff;
  font-size: 9.5px; font-weight: 700;
  border-radius: var(--r-pill); border: 2px solid var(--card);
  display: flex; align-items: center; justify-content: center;
}
.burger {
  display: none; width: 38px; height: 38px; border-radius: var(--r-sm);
  background: var(--bg-alt); border: 1px solid var(--border);
  align-items: center; justify-content: center; cursor: pointer;
  color: var(--ink); flex-shrink: 0;
}
.burger i { font-size: 20px; }

/* ── 6. HERO ───────────────────────────────────────────────── */
.hero {
  background: var(--grad-primary);
  border-radius: var(--r);
  padding: 24px 28px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; color: #fff; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.hero-tx { position: relative; z-index: 1; min-width: 0; }
.hero-tx h2 { font-size: 21px; font-weight: 400; line-height: 1.3; }
.hero-tx h2 strong { font-weight: 700; }
.hero-tx p { font-size: 12.5px; opacity: .82; margin-top: 4px; }
.hero-stats { display: flex; gap: 34px; text-align: right; flex-shrink: 0; position: relative; z-index: 1; }
.hero-v { font-size: 26px; font-weight: 700; line-height: 1.1; }
.hero-l { font-size: 11px; opacity: .78; margin-top: 2px; }

/* ── 7. CARTÕES ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.card-hd {
  padding: 14px 18px;
  border-bottom: 1px solid var(--bg-alt);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-hd h3 {
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.card-hd h3 i { font-size: 15px; color: var(--primary); flex-shrink: 0; }
.card-sub { font-size: 10.5px; color: var(--ink-4); }
.card-body { padding: 18px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.kpi {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--sh-sm);
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.kpi:hover { box-shadow: var(--sh-md); transform: translateY(-1px); }
.kpi-ic {
  width: 44px; height: 44px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.kpi-ic i { font-size: 21px; }
.kpi-ic.azul   { background: #E0F2FE; color: var(--primary-dark); }
.kpi-ic.ambar  { background: var(--warning-bg); color: var(--warning-fg); }
.kpi-ic.coral  { background: var(--danger-bg); color: var(--danger-fg); }
.kpi-ic.verde  { background: var(--success-bg); color: var(--success-fg); }
.kpi-ic.roxo   { background: #F3E8FF; color: #6B21A8; }
.kpi-v { font-size: 25px; font-weight: 700; line-height: 1.05; }
.kpi-l { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.kpi-d { font-size: 10px; color: var(--ink-4); margin-top: 2px; }
.kpi-d.sobe  { color: var(--success-fg); }
.kpi-d.desce { color: var(--danger-fg); }

/* ── 8. BOTÕES ─────────────────────────────────────────────── */
.btn {
  font-family:'Century Gothic',Arial,sans-serif; font-size: 12px; font-weight: 600;
  padding: 9px 16px; border-radius: var(--r-sm);
  border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn i { font-size: 14px; }
.btn-primary   { background: var(--primary-dark); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-accent    { background: var(--primary); color: #fff; }
.btn-accent:hover { background: var(--primary-dark); }
.btn-ghost     { background: var(--card); color: var(--ink-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--ink); border-color: var(--border-strong); }
.btn-danger    { background: var(--card); color: var(--danger-fg); border-color: #FECACA; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-success   { background: var(--success-bg); color: var(--success-fg); border-color: #86EFAC; }
.btn-success:hover { background: #BBF7D0; }
.btn-sm { padding: 6px 12px; font-size: 11px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; }
.btn-icon i { font-size: 15px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ── 9. BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  padding: 4px 11px; border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge i { font-size: 11px; }
.badge-verde   { background: var(--success-bg); color: var(--success-fg); }
.badge-ambar   { background: var(--warning-bg); color: var(--warning-fg); }
.badge-coral   { background: var(--danger-bg);  color: var(--danger-fg); }
.badge-azul    { background: var(--info-bg);    color: var(--info-fg); }
.badge-neutro  { background: var(--neutral-bg); color: var(--neutral-fg); }

/* ── 10. TABELAS ───────────────────────────────────────────── */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th {
  text-align: left; padding: 11px 18px;
  font-size: 9.5px; font-weight: 700; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .9px;
  background: var(--bg); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td { padding: 13px 18px; border-bottom: 1px solid var(--bg-alt); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover td { background: var(--bg); }
.td-nm  { font-weight: 600; color: var(--ink); }
.td-sub { font-size: 10px; color: var(--ink-4); margin-top: 2px; font-family:'Century Gothic',Arial,sans-serif; }
.td-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* ── 11. FORMULÁRIOS ───────────────────────────────────────── */
.label {
  display: block; font-size: 10px; font-weight: 700; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .9px; margin-bottom: 6px;
}
.input, select.input, textarea.input {
  width: 100%; padding: 10px 13px;
  font-family:'Century Gothic',Arial,sans-serif; font-size: 12.5px; color: var(--ink);
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,152,218,.12); }
.input::placeholder { color: var(--ink-4); }
textarea.input { resize: vertical; min-height: 76px; }
.campo { margin-bottom: 14px; }

/* ── 12. MODAIS ────────────────────────────────────────────── */
.modal-ov {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.5); backdrop-filter: blur(3px);
  z-index: 9999; align-items: center; justify-content: center; padding: 20px;
}
.modal-ov.open { display: flex; }
.modal-card {
  background: var(--card); border-radius: var(--r);
  padding: 24px; width: 440px; max-width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--sh-lg);
}
.modal-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 11.5px; color: var(--ink-4); margin-bottom: 18px; }
.modal-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ── 13. TOAST + DESTAQUE ──────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translate(-50%, 12px);
  z-index: 99999; padding: 11px 22px;
  border-radius: var(--r-sm); font-family:'Century Gothic',Arial,sans-serif;
  font-size: 12px; font-weight: 600; box-shadow: var(--sh-md);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok  { background: var(--success-bg); color: var(--success-fg); }
.toast.err { background: var(--danger-bg);  color: var(--danger-fg); }

@keyframes focoPulso {
  0%   { box-shadow: 0 0 0 0 rgba(0,152,218,.45); }
  70%  { box-shadow: 0 0 0 12px rgba(0,152,218,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,152,218,0); }
}
.foco-destaque { animation: focoPulso 1.5s ease-out 3; }

/* ── 14. LISTAS / ALERTAS ──────────────────────────────────── */
.lista-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--bg-alt);
  text-decoration: none; color: inherit;
  transition: background var(--t-fast);
}
.lista-row:last-child { border-bottom: none; }
.lista-row:hover { background: var(--bg); }
.lista-ic {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lista-ic i { font-size: 16px; }
.lista-ic.coral { background: var(--danger-bg);  color: var(--danger-fg); }
.lista-ic.ambar { background: var(--warning-bg); color: var(--warning-fg); }
.lista-ic.azul  { background: #E0F2FE;           color: var(--primary-dark); }
.lista-tx { flex: 1; min-width: 0; }
.lista-nm { font-size: 12px; font-weight: 600; }
.lista-sub { font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
.lista-meta { font-size: 10px; color: var(--ink-4); flex-shrink: 0; white-space: nowrap; }

/* ── 15. ESTADO VAZIO ──────────────────────────────────────── */
.vazio { text-align: center; padding: 52px 20px; color: var(--ink-4); }
.vazio i { font-size: 38px; display: block; margin-bottom: 12px; opacity: .35; }
.vazio p { font-size: 12.5px; }
.vazio .btn { margin-top: 16px; }

/* ── 16. UTILITÁRIOS ───────────────────────────────────────── */
.mono { font-family:'Century Gothic',Arial,sans-serif; }
.link { color: var(--primary); text-decoration: none; font-size: 11.5px; font-weight: 600; }
.link:hover { text-decoration: underline; }
.grid { display: grid; gap: 14px; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: 14px; } .mb-4 { margin-bottom: 20px; }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.chart-wrap { position: relative; width: 100%; }

.filtros {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; flex-wrap: wrap;
}
.filtros .input { width: auto; min-width: 150px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab {
  font-size: 11px; font-weight: 600; padding: 7px 14px;
  border-radius: var(--r-pill); border: 1px solid var(--border);
  background: var(--card); color: var(--ink-3);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: all var(--t-fast);
}
.tab:hover { border-color: var(--border-strong); color: var(--ink); }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ── 17. RESPONSIVO ────────────────────────────────────────── */
.sb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,.5); z-index: 99;
}
.sb-overlay.open { display: block; }

@media (max-width: 1024px) {
  .content { padding: 18px; }
  .topbar { padding: 10px 18px; }
  .hero { padding: 20px; }
  .hero-stats { gap: 24px; }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-100%);
    transition: transform var(--t-base);
    box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .burger { display: flex; }
  .topbar { position: sticky; }
  .hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero-stats { text-align: left; width: 100%; justify-content: space-between; }
  .tb-date { display: none; }
}

@media (max-width: 560px) {
  body { font-size: 13.5px; }
  .content { padding: 14px; }
  .topbar { padding: 10px 14px; }
  .tb-title h1 { font-size: 15px; }
  .tb-title p { display: none; }
  .hero { padding: 18px; border-radius: 12px; }
  .hero-tx h2 { font-size: 18px; }
  .hero-v { font-size: 22px; }
  .kpi { padding: 14px; }
  .kpi-ic { width: 38px; height: 38px; }
  .kpi-ic i { font-size: 18px; }
  .kpi-v { font-size: 21px; }
  .card-hd, .card-body { padding: 14px; }
  .tbl th, .tbl td { padding: 10px 12px; }
  .modal-card { padding: 18px; border-radius: 12px; }
  .btn { padding: 9px 14px; }
  .toast { bottom: 16px; }

  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody, .tbl-cards tr, .tbl-cards td { display: block; width: 100%; }
  .tbl-cards tr {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--r-sm); margin-bottom: 10px; padding: 12px;
  }
  .tbl-cards td { border: none; padding: 5px 0; }
  .tbl-cards td[data-rot]::before {
    content: attr(data-rot); display: block;
    font-size: 9px; font-weight: 700; color: var(--ink-4);
    text-transform: uppercase; letter-spacing: .8px; margin-bottom: 3px;
  }
  .tbl-cards .td-acts { justify-content: flex-start; padding-top: 10px; }
}

@media print {
  .sidebar, .topbar, .btn, .fab, .toast { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}
