/* ============================================================
   CEPRONE 360 — Design System
   Interface própria, moderna e consistente.
   ============================================================ */

@font-face { font-family: 'Inter'; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-400-normal.da03732a27e1.woff2") format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-500-normal.51205681a1ba.woff2") format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-600-normal.2ede57db1a3a.woff2") format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-700-normal.8ca0a5155296.woff2") format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-800-normal.900ae45e40b8.woff2") format('woff2'); }

:root {
  /* Identidade visual CEPRONE (logótipo: azul-violeta, amarelo, vermelho, verde) */
  --brand-900: #1e1856;
  --brand-800: #292070;
  --brand-700: #332896;
  --brand-600: #3b2fa0;
  --brand-500: #4d40c4;
  --brand-100: #e6e3f9;
  --brand-50:  #f4f2fc;
  --accent:    #ffd400;
  --accent-dark: #c7a300;
  --logo-vermelho: #ee3124;
  --logo-verde: #00a551;

  /* Neutros */
  --ink-900: #101828;
  --ink-700: #344054;
  --ink-500: #667085;
  --ink-400: #98a2b3;
  --ink-300: #d0d5dd;
  --ink-200: #eaecf0;
  --ink-100: #f2f4f7;
  --ink-50:  #f9fafb;
  --white:   #ffffff;

  /* Semáforo / estados */
  --verde: #12b76a;     --verde-bg: #e7f8f0;
  --amarelo: #f0a400;   --amarelo-bg: #fdf3d7;
  --laranja: #f4762c;   --laranja-bg: #feefe4;
  --vermelho: #e33e38;  --vermelho-bg: #fdebea;
  --azul: #2e90fa;      --azul-bg: #e8f3ff;
  --cinza: #8a94a6;     --cinza-bg: #eef1f5;
  --roxo: #7a5af8;      --roxo-bg: #f0ecfe;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow: 0 1px 3px rgba(16,24,40,.10), 0 1px 2px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 24px -6px rgba(16,24,40,.14);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--ink-50);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: none; }

/* ============ Layout ============ */
.app { display: flex; min-height: 100vh; }
.main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-width: 0;
}
.content { padding: 28px 32px 48px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ============ Sidebar ============ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--brand-900) 0%, var(--brand-800) 100%);
  color: #c9c6e4; display: flex; flex-direction: column; z-index: 50;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-logo {
  width: 42px; height: 42px; border-radius: 999px; flex-shrink: 0;
  background: #fff; display: grid; place-items: center; padding: 2px;
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.brand-logo img { width: 100%; height: 100%; display: block; }
.brand-name { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: -.2px; }
.brand-sub { font-size: 10.5px; color: #8a86b8; letter-spacing: .8px; text-transform: uppercase; font-weight: 600; }

.nav { padding: 14px 12px 20px; flex: 1; }
.nav-section {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  color: #6b66a0; padding: 16px 12px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px; margin-bottom: 2px;
  color: #b8b4d8; font-size: 13.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .85; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, var(--brand-600), var(--brand-500));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 10px rgba(59,47,160,.4);
}
.nav-item .pill {
  margin-left: auto; background: var(--vermelho); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08);
}
.sidebar-user .avatar { background: var(--brand-600); color: #fff; }
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: #8a86b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user a.logout { color: #8a86b8; display: grid; place-items: center; }
.sidebar-user a.logout:hover { color: #fff; }

/* ============ Topbar ============ */
.topbar {
  height: 64px; background: var(--white); border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar-meta { font-size: 12.5px; color: var(--ink-500); }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* ============ Componentes ============ */
.avatar {
  width: 34px; height: 34px; border-radius: 999px;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  background: var(--brand-100); color: var(--brand-700); flex-shrink: 0;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }

.card {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--ink-200);
}
.card-title { font-size: 14.5px; font-weight: 700; }
.card-sub { font-size: 12.5px; color: var(--ink-500); margin-top: 1px; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px; }
.kpi {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--kpi-color, var(--brand-500));
}
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin-top: 6px; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--ink-500); }
.kpi-foot { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.kpi-foot .up { color: var(--verde); font-weight: 600; }
.kpi-foot .down { color: var(--vermelho); font-weight: 600; }

/* Badges e semáforo */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge.verde    { background: var(--verde-bg); color: #0a7d4b; }
.badge.amarelo  { background: var(--amarelo-bg); color: #9a6a00; }
.badge.laranja  { background: var(--laranja-bg); color: #c2551a; }
.badge.vermelho { background: var(--vermelho-bg); color: #b3251f; }
.badge.azul     { background: var(--azul-bg); color: #175cd3; }
.badge.cinza    { background: var(--cinza-bg); color: #5b6572; }
.badge.roxo     { background: var(--roxo-bg); color: #5b3df1; }
.badge.brand    { background: var(--brand-100); color: var(--brand-700); }

/* Botões */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  border-radius: 9px; padding: 9px 16px; cursor: pointer;
  border: 1px solid transparent; transition: all .15s;
  text-decoration: none !important;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 2px 6px rgba(59,47,160,.3); }
.btn-primary:hover { background: var(--brand-700); }
.btn-secondary { background: var(--white); color: var(--ink-700); border-color: var(--ink-300); }
.btn-secondary:hover { background: var(--ink-100); }
.btn-danger { background: var(--vermelho); color: #fff; }
.btn-success { background: var(--verde); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand-600); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table thead th {
  text-align: left; font-size: 11.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--ink-500);
  padding: 11px 16px; background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200); white-space: nowrap;
}
.table tbody td { padding: 13px 16px; border-bottom: 1px solid var(--ink-100); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: var(--brand-50); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table a.row-link { color: var(--ink-900); font-weight: 600; }
.table a.row-link:hover { color: var(--brand-600); }
.table .sub { font-size: 12px; color: var(--ink-500); }

/* Formulários */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 13.5px; color: var(--ink-900);
  background: var(--white); border: 1px solid var(--ink-300);
  border-radius: 9px; padding: 9px 12px; transition: border .15s, box-shadow .15s;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(59,47,160,.14);
}
.field .errors { color: var(--vermelho); font-size: 12px; margin-top: 4px; }
.field .help { color: var(--ink-400); font-size: 11.5px; margin-top: 4px; }

/* Pesquisa */
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border: 1px solid var(--ink-300); border-radius: 9px;
  padding: 8px 12px; min-width: 260px;
}
.search input { border: none; outline: none; font-family: inherit; font-size: 13.5px; flex: 1; background: transparent; }
.search svg { width: 16px; height: 16px; color: var(--ink-400); }

/* Page header */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 21px; font-weight: 800; letter-spacing: -.4px; }
.page-sub { font-size: 13px; color: var(--ink-500); margin-top: 3px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Kanban */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.kanban-col { min-width: 265px; width: 265px; flex-shrink: 0; background: var(--ink-100); border-radius: var(--radius); padding: 10px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; }
.kanban-col-title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.kanban-col-title .dot { width: 8px; height: 8px; border-radius: 99px; }
.kanban-count { font-size: 11.5px; font-weight: 700; color: var(--ink-500); background: var(--white); border-radius: 999px; padding: 1px 8px; }
.kanban-card {
  background: var(--white); border: 1px solid var(--ink-200); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow-sm);
  display: block; transition: box-shadow .15s, transform .15s;
}
.kanban-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.kanban-card-title { font-size: 13.5px; font-weight: 600; color: var(--ink-900); }
.kanban-card-sub { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.kanban-card-value { font-size: 13.5px; font-weight: 700; color: var(--brand-700); margin-top: 8px; }
.kanban-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }

/* Progresso */
.progress { height: 7px; background: var(--ink-200); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--brand-500); }
.progress.verde > div { background: var(--verde); }
.progress.amarelo > div { background: var(--amarelo); }
.progress.vermelho > div { background: var(--vermelho); }

/* Mensagens (toasts) */
.messages { position: fixed; top: 76px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-900); color: #fff; font-size: 13.5px; font-weight: 500;
  border-radius: 10px; padding: 12px 18px; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; max-width: 420px;
  animation: slideIn .25s ease;
}
.toast.success { background: #0a7d4b; }
.toast.error { background: #b3251f; }
.toast.warning { background: #9a6a00; }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ink-200); margin-bottom: 20px; }
.tab {
  font-size: 13.5px; font-weight: 600; color: var(--ink-500);
  padding: 10px 16px; border-bottom: 2px solid transparent; cursor: pointer;
}
.tab:hover { color: var(--ink-900); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-600); }

/* Detalhe: lista de definição */
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 10px 16px; font-size: 13.5px; }
.dl dt { color: var(--ink-500); font-weight: 500; }
.dl dd { font-weight: 600; color: var(--ink-900); }

/* Timeline de actividades */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--ink-200); }
.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item::before {
  content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px;
  border-radius: 999px; background: var(--brand-500); border: 2.5px solid var(--white);
  box-shadow: 0 0 0 1.5px var(--ink-300);
}
.timeline-item .t-title { font-size: 13px; font-weight: 600; }
.timeline-item .t-meta { font-size: 11.5px; color: var(--ink-500); }
.timeline-item .t-body { font-size: 13px; color: var(--ink-700); margin-top: 3px; }

/* Grids auxiliares */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-31 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--ink-500); }
.small { font-size: 12.5px; }
.bold { font-weight: 700; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }

/* Empty state */
.empty { text-align: center; padding: 48px 24px; color: var(--ink-500); }
.empty .icon { font-size: 34px; margin-bottom: 8px; }
.empty .title { font-weight: 700; color: var(--ink-700); font-size: 15px; }

/* Login */
.login-page {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
}
.login-hero {
  background: linear-gradient(150deg, var(--brand-900) 0%, var(--brand-700) 70%, var(--brand-600) 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 56px; position: relative; overflow: hidden;
}
.login-hero::after {
  content: ''; position: absolute; right: -120px; bottom: -120px;
  width: 420px; height: 420px; border-radius: 999px;
  background: radial-gradient(circle, rgba(255,212,0,.22), transparent 65%);
}
.login-hero::before {
  content: ''; position: absolute; left: -80px; top: -80px;
  width: 300px; height: 300px; border-radius: 999px;
  background: radial-gradient(circle, rgba(0,165,81,.28), transparent 65%);
}
.login-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.8px; line-height: 1.2; max-width: 420px; }
.login-hero p { color: #b3aede; margin-top: 14px; max-width: 400px; font-size: 14.5px; }
.login-hero .features { display: flex; flex-direction: column; gap: 12px; margin-top: 32px; position: relative; z-index: 1; }
.login-hero .feat { display: flex; gap: 10px; align-items: center; font-size: 13.5px; color: #c9c6e4; }
.login-hero .feat .fdot { width: 22px; height: 22px; border-radius: 7px; background: rgba(255,255,255,.12); display: grid; place-items: center; font-size: 12px; }
.login-form-side { display: grid; place-items: center; padding: 40px; background: var(--ink-50); }
.login-card { width: 100%; max-width: 400px; }
.login-card .card-pad { padding: 34px 34px 30px; }
.login-title { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.login-sub { font-size: 13.5px; color: var(--ink-500); margin: 4px 0 24px; }

/* Aging bars (mapa de antiguidade) */
.aging { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.aging-cell { background: var(--white); border: 1px solid var(--ink-200); border-radius: 10px; padding: 14px; text-align: center; }
.aging-cell .a-label { font-size: 11px; font-weight: 700; color: var(--ink-500); text-transform: uppercase; letter-spacing: .4px; }
.aging-cell .a-value { font-size: 16px; font-weight: 800; margin-top: 6px; }
.aging-cell.hot { border-color: var(--vermelho); background: var(--vermelho-bg); }
.aging-cell.warm { border-color: var(--laranja); background: var(--laranja-bg); }

/* Funil */
.funnel-step { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.funnel-bar { height: 30px; border-radius: 7px; background: linear-gradient(90deg, var(--brand-600), var(--brand-500)); min-width: 40px; display: flex; align-items: center; padding: 0 10px; color: #fff; font-size: 12px; font-weight: 700; }
.funnel-label { width: 110px; font-size: 12.5px; font-weight: 600; color: var(--ink-700); flex-shrink: 0; }
.funnel-value { font-size: 12.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; }

/* Responsivo */
@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-31 { grid-template-columns: 1fr; }
  .aging { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Impressão */
@media print {
  .sidebar, .topbar, .page-actions, .messages { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}
