/* ============================================================
   Resan Cloud - Portal do cliente v9
   Identidade visual alinhada ao site público
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root{
  --bg:#f5f7fb;
  --bg-2:#eef3fb;
  --surface:#ffffff;
  --surface-2:#f8fafc;
  --ink:#0b1220;
  --ink-2:#1a2238;
  --muted:#5b6579;
  --muted-2:#8892a6;
  --line:#e2e7f0;
  --line-2:#eef1f7;
  --primary:#0066ff;
  --primary-2:#0052cc;
  --cyan:#00d4ff;
  --cyan-2:#00a8cc;
  --violet:#7c3aed;
  --emerald:#10b981;
  --amber:#f59e0b;
  --rose:#ef4444;
  --indigo:#6366f1;
  --grad-primary: linear-gradient(135deg,#0066ff 0%,#00a8ff 50%,#00d4ff 100%);
  --grad-stripe:  linear-gradient(90deg,#0066ff,#00a8ff,#00d4ff,#7c3aed,#0066ff);
  --grad-heading: linear-gradient(135deg,#0b1220 0%,#0052cc 60%,#0066ff 100%);
  --shadow-sm: 0 2px 8px rgba(15,23,42,.06);
  --shadow: 0 8px 24px rgba(15,23,42,.08), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 16px 48px rgba(15,23,42,.12), 0 4px 10px rgba(15,23,42,.06);
  --radius: 14px;
  --radius-lg: 20px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-feature-settings: "cv11","ss01","ss03";
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background:
    radial-gradient(1100px 640px at 10% -10%, rgba(0,102,255,.08), transparent 60%),
    radial-gradient(900px 520px at 95% 8%, rgba(0,212,255,.10), transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height:100%;
}

/* top stripe animado - igual ao site */
body::before{
  content:"";
  position: fixed;
  left:0; right:0; top:0;
  height: 3px;
  background: var(--grad-stripe);
  background-size: 200% 100%;
  animation: stripeShift 6s linear infinite;
  z-index: 1000;
}
@keyframes stripeShift { to { background-position: -200% 0 } }

a{color: var(--primary); text-decoration:none}
a:hover{color: var(--primary-2)}

::selection{ background: rgba(0,102,255,.18); color: var(--ink) }

/* ===================== Container ===================== */
.container{max-width:1200px; margin:0 auto; padding:22px 20px 80px}

/* ===================== Cards ===================== */
.card{
  background: var(--surface);
  border:1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.card::before{
  content:"";
  position:absolute; inset:0 0 auto 0; height:3px;
  background: var(--grad-primary);
  opacity:.0;
  transition: opacity .2s ease;
}
.card:hover::before{ opacity: .18 }

h1{
  font-size: 26px; font-weight: 800; letter-spacing: -.015em;
  margin: 0 0 14px;
  background: var(--grad-heading);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2{
  font-size: 12px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}
h3{ font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 10px }
p{ margin:0 0 10px; color: var(--muted); line-height: 1.55 }
hr{ border:none; border-top:1px solid var(--line); margin:16px 0 }

/* ===================== Sidebar admin (Bento Cards · 2026-06) ===================== */
.rc-sidebar.rc-bento{
  position:fixed; left:0; top:0; bottom:0; width:248px; z-index:90;
  background:#fafbfc; color:#0f172a; display:flex; flex-direction:column;
  border-right:1px solid #eef1f5;
  font-family:inherit;
}
.rc-bento .rc-sb-brand{
  display:flex; align-items:center; gap:11px; padding:18px 16px 14px;
}
.rc-bento .rc-sb-logo{
  width:34px; height:34px; border-radius:9px;
  background:#0a0a0f; color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:800; font-size:16px; letter-spacing:-.02em;
  box-shadow:0 4px 10px rgba(10,10,15,.15);
}
.rc-bento .rc-sb-brand-meta{ line-height:1.15; min-width:0 }
.rc-bento .rc-sb-brand-name{
  font-weight:700; font-size:14px; color:#0f172a; letter-spacing:-.01em;
}
.rc-bento .rc-sb-brand-sub{
  font-size:11px; color:#94a3b8; font-weight:500; margin-top:1px;
}
.rc-bento .rc-sb-nav{
  flex:1 1 auto; overflow-y:auto; overflow-x:hidden;
  padding:6px 12px 16px;
  display:flex; flex-direction:column; gap:8px;
  scrollbar-width:thin; scrollbar-color:#cbd5e1 transparent;
}
.rc-bento .rc-sb-nav::-webkit-scrollbar{ width:6px }
.rc-bento .rc-sb-nav::-webkit-scrollbar-thumb{ background:#cbd5e1; border-radius:6px }
.rc-bento .rc-sb-card{
  background:#fff;
  border:1px solid #eef1f5;
  border-radius:11px;
  padding:8px;
  box-shadow:0 1px 1px rgba(15,23,42,.02);
}
.rc-bento .rc-sb-section-title{
  font-size:10px; letter-spacing:.1em; text-transform:uppercase; font-weight:700;
  color:#94a3b8; padding:6px 8px 4px;
}
.rc-bento .rc-sb-nav a{
  display:flex; align-items:center; gap:10px;
  padding:7px 8px; border-radius:7px;
  color:#475569; font-size:13px; font-weight:500; text-decoration:none;
  transition:background .12s ease, color .12s ease;
  margin:1px 0;
}
.rc-bento .rc-sb-nav a svg{ flex:0 0 16px; color:#94a3b8; transition:color .12s ease }
.rc-bento .rc-sb-nav a span{ flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.rc-bento .rc-sb-nav a:hover{ background:#f4f6fa; color:#0f172a }
.rc-bento .rc-sb-nav a:hover svg{ color:#475569 }
.rc-bento .rc-sb-nav a.active{
  background:linear-gradient(90deg, #eef4ff 0%, #fff 100%);
  color:#0a2a6b; font-weight:600;
  box-shadow:inset 2px 0 0 #2563eb;
}
.rc-bento .rc-sb-nav a.active svg{ color:#2563eb }
.rc-bento .rc-sb-foot{
  padding:10px 12px 14px;
  display:flex; flex-direction:column; gap:8px;
  border-top:1px solid #eef1f5;
  background:#fafbfc;
}
.rc-bento .rc-sb-user{
  display:flex; align-items:center; gap:10px;
  padding:8px; border-radius:10px;
  background:#fff; border:1px solid #eef1f5;
}
.rc-bento .rc-sb-avatar{
  width:32px; height:32px; border-radius:50%;
  background:linear-gradient(135deg,#3b82f6,#06b6d4);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; color:#fff; font-size:13px; flex:0 0 32px;
}
.rc-bento .rc-sb-user-meta{ flex:1; min-width:0 }
.rc-bento .rc-sb-user-name{
  font-weight:600; font-size:13px; color:#0f172a;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.rc-bento .rc-sb-user-role{
  font-size:11px; color:#94a3b8; font-weight:500;
}
.rc-bento .rc-sb-actions{ display:flex; gap:6px }
.rc-bento .rc-sb-btn{
  flex:1;
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:8px 10px; border-radius:8px; font-size:12px; font-weight:600;
  text-decoration:none; border:1px solid transparent; cursor:pointer;
  transition:background .12s ease, color .12s ease, border-color .12s ease;
}
.rc-bento .rc-sb-btn.primary{
  background:#0f172a; color:#fff;
}
.rc-bento .rc-sb-btn.primary:hover{ background:#1e293b }
.rc-bento .rc-sb-btn.ghost{
  background:#fff; color:#475569; border-color:#eef1f5;
}
.rc-bento .rc-sb-btn.ghost:hover{ background:#f4f6fa; color:#0f172a; border-color:#dbe1ea }
.rc-sb-toggle{
  display:none; position:fixed; left:12px; top:12px; z-index:95;
  width:42px; height:42px; border-radius:10px;
  background:#fff; color:#0f172a; border:1px solid #eef1f5; cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.08);
  align-items:center; justify-content:center;
}
.imp-banner{
  position:fixed; left:248px; right:0; top:0; z-index:80;
  background:#f59e0b; color:#fff; padding:8px 16px; font-size:13px; font-weight:700;
  text-align:center;
}
/* Layout: container empurrado para a direita */
body.has-rc-sidebar .container{ padding-left:268px; padding-right:24px; max-width:none; margin:0 }
body.has-rc-sidebar .container > #crumbs:first-child{ margin-top:6px }
/* Mobile: sidebar vira drawer */
@media (max-width: 980px){
  .rc-sidebar.rc-bento{
    transform:translateX(-100%); transition:transform .2s ease;
    width:268px; box-shadow:0 12px 40px rgba(15,23,42,.18);
  }
  .rc-sidebar.rc-bento.open{ transform:translateX(0) }
  .rc-sb-toggle{ display:flex }
  body.has-rc-sidebar .container{ padding-left:16px; padding-right:16px; padding-top:60px }
  .imp-banner{ left:0; top:60px }
}

/* ===================== Top nav (legado, ainda usado por paginas cliente) ===================== */
.nav{
  display:flex; gap:14px; flex-wrap:wrap; align-items:center; justify-content:space-between;
  padding: 12px 22px;
  background: rgba(255,255,255,.82);
  border-bottom:1px solid var(--line);
  position: sticky; top:0; z-index: 100;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}
.nav .left{display:flex; gap:14px; align-items:center; flex-wrap:wrap}
.brand{display:flex; gap:10px; align-items:center; font-weight:900; letter-spacing:-.01em; color: var(--ink)}
.brand img{ height:30px; width:auto; display:block }
.brand span{ font-size: 13px; color: var(--muted); font-weight: 600 }

.badge{
  font-size:11px; font-weight: 700; letter-spacing:.08em; text-transform: uppercase;
  padding: 5px 10px; border:1px solid var(--line);
  border-radius: 999px; color: var(--primary-2);
  background: rgba(0,102,255,.06);
}
.badge.impersonation{
  color:#92400e; background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.35);
}

.menu{ display:flex; gap:4px; flex-wrap:wrap; align-items:center }
.menu a{
  padding: 8px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s ease;
}
.menu a:hover{ color: var(--ink); background: var(--surface-2) }
.menu a.active{
  color: var(--primary-2);
  background: rgba(0,102,255,.08);
  border-color: rgba(0,102,255,.18);
}

/* ===================== Grid ===================== */
.grid{ display:grid; gap:16px }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0,1fr)) }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0,1fr)) }
.grid.cols-4{ grid-template-columns: repeat(4, minmax(0,1fr)) }
@media (max-width: 980px){
  .grid.cols-2, .grid.cols-3, .grid.cols-4{ grid-template-columns: 1fr }
}
@media (max-width: 720px){
  .nav{ padding: 10px 16px }
  .menu a{ padding: 6px 10px; font-size: 13px }
}

/* ===================== Forms ===================== */
.label{
  display:block; font-size:12px; font-weight:700; letter-spacing:.06em;
  text-transform:uppercase; color: var(--muted);
  margin: 12px 0 6px;
}
.input, select.input, textarea.input{
  width:100%; padding: 11px 13px;
  border-radius: 12px;
  border:1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea.input{ min-height: 96px; resize: vertical; line-height: 1.5 }
.input::placeholder{ color: var(--muted-2) }
.input:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0,102,255,.12);
}
.input[readonly]{ background: var(--surface-2); color: var(--muted) }
.input[disabled]{ background: var(--surface-2); color: var(--muted-2); cursor:not-allowed }

/* ===================== Buttons ===================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: 10px 16px; border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 14px; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover{ border-color: var(--primary); color: var(--primary-2); background: rgba(0,102,255,.04) }
.btn.primary{
  background: var(--grad-primary);
  border-color: transparent;
  color:#fff;
  box-shadow: 0 6px 18px rgba(0,102,255,.28);
}
.btn.primary:hover{
  color:#fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,102,255,.34);
}
.btn.ghost{
  background: transparent; border-color: var(--line-2); color: var(--muted);
}
.btn.ghost:hover{ color: var(--ink); background: var(--surface-2); border-color: var(--line) }
.btn.danger{
  background:#fff; border-color: rgba(239,68,68,.40); color:#b91c1c;
}
.btn.danger:hover{ background: rgba(239,68,68,.08); color:#991b1b; border-color: rgba(239,68,68,.65) }
.btn.success{
  background: linear-gradient(135deg,#10b981,#059669);
  border-color: transparent; color:#fff;
  box-shadow: 0 6px 18px rgba(16,185,129,.28);
}
.btn.sm{ padding: 7px 10px; font-size: 12.5px; border-radius: 10px }

/* ===================== Row / actions ===================== */
.row{ display:flex; gap:12px; flex-wrap:wrap; align-items:center; justify-content: space-between }
.actions{ display:flex; gap:8px; flex-wrap:wrap; align-items:center }

/* ===================== Table ===================== */
.table{
  width:100%;
  border-collapse: separate; border-spacing:0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  font-size: 13.5px;
}
.table th, .table td{
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
}
.table th{
  font-size: 11px; font-weight: 800; letter-spacing:.08em;
  color: var(--muted); text-transform: uppercase;
  background: var(--surface-2);
  border-bottom-color: var(--line);
}
.table tr:last-child td{ border-bottom: none }
.table tbody tr{ transition: background .12s ease }
.table tbody tr:hover{ background: rgba(0,102,255,.03) }

/* numérico (valores, datas) */
.table td.num, .table th.num, .mono{
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

/* ===================== KPIs ===================== */
.kpi{ display:flex; flex-direction:column; gap:6px }
.kpi .big{
  font-size: 26px; font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.kpi .small{ font-size: 12.5px; color: var(--muted); font-weight: 500 }
.kpi.accent .big{
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ===================== Toast / notifications ===================== */
.toast{
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,102,255,.08);
  border: 1px solid rgba(0,102,255,.2);
  color: var(--primary-2);
  font-size: 13px;
  min-height: 20px;
}
.toast:empty{ display:none }
.toast.error{ background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.25); color:#b91c1c }
.toast.success{ background: rgba(16,185,129,.08); border-color: rgba(16,185,129,.28); color:#047857 }

/* ===================== Status chips ===================== */
.status{
  font-size: 11px; font-weight: 700; letter-spacing:.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; display:inline-block;
  border:1px solid var(--line);
}
.status.open{
  color: var(--primary-2); border-color: rgba(0,102,255,.25);
  background: rgba(0,102,255,.06);
}
.status.paid, .status.on{
  color: #047857; border-color: rgba(16,185,129,.35);
  background: rgba(16,185,129,.08);
}
.status.overdue, .status.off{
  color: #b91c1c; border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.08);
}
.status.pending{
  color: #92400e; border-color: rgba(245,158,11,.45);
  background: rgba(245,158,11,.08);
}

/* ===================== Login / centro ===================== */
.center-wrap{
  min-height: 100vh;
  display:flex; align-items:center; justify-content:center;
  padding: 40px 20px;
}
.auth-card{ width: min(460px, 100%); padding: 32px }
.auth-card h1{ font-size: 22px; margin-bottom: 4px }
.logo-block{ display:flex; align-items:center; gap:14px; margin-bottom: 14px }
.logo-block img{ height: 44px; width:auto }

/* ===================== Breadcrumbs ===================== */
.breadcrumbs{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  color: var(--muted); font-size: 13px;
  margin-bottom: 14px;
}
.breadcrumbs a{ color: var(--muted); font-weight: 500 }
.breadcrumbs a:hover{ color: var(--primary-2) }
.breadcrumbs > span{ color: var(--muted-2) }

.small-note{ font-size: 12px; color: var(--muted); line-height: 1.55 }

/* ===================== Impersonation banner ===================== */
.imp-banner{
  position: sticky; top: 0; z-index: 99;
  background: linear-gradient(90deg, rgba(245,158,11,.12), rgba(239,68,68,.10));
  border-bottom: 1px solid rgba(245,158,11,.35);
  padding: 9px 20px;
  font-size: 13px; font-weight: 600;
  color: #92400e;
  text-align: center;
}

/* ===================== Sidebar (admin layout opcional) ===================== */
.layout{ display:grid; grid-template-columns: 240px 1fr; gap: 0; min-height:100vh }
@media (max-width: 980px){ .layout{ grid-template-columns: 1fr } }
.sidebar{
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
}
.sidebar h4{
  font-size: 11px; font-weight: 800; letter-spacing:.12em; text-transform: uppercase;
  color: var(--muted); margin: 18px 10px 8px;
}
.sidebar a{
  display:flex; align-items:center; gap:10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--muted); font-size: 13.5px; font-weight: 600;
  margin-bottom: 2px;
}
.sidebar a:hover{ color: var(--ink); background: var(--surface-2) }
.sidebar a.active{
  color: var(--primary-2); background: rgba(0,102,255,.08);
}

/* ===================== Filtros / toolbars ===================== */
.toolbar{
  display:flex; gap:10px; flex-wrap:wrap; align-items:center;
  padding: 12px 0 6px;
}
.toolbar .input{ width:auto; min-width: 180px; flex: 1 1 180px; max-width: 320px }
.toolbar .input.search{ min-width: 240px; flex: 2 1 260px; max-width: 420px }

/* ===================== Charts placeholders ===================== */
.chart-box{
  position:relative; height: 220px; width:100%;
  padding: 8px 4px 4px;
}
.chart-box svg{ width:100%; height:100%; display:block }

/* ===================== Modal minimal ===================== */
.modal-backdrop{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15,23,42,.42);
  backdrop-filter: blur(3px);
  display:flex; align-items:center; justify-content:center;
  padding: 24px;
}
.modal{
  width: min(640px, 100%);
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  max-height: 85vh; overflow: auto;
}
.modal h2{ font-size:13px }
.modal .modal-title{
  font-size: 18px; font-weight: 800; color: var(--ink);
  margin: 0 0 4px;
}

/* ===================== Misc tweaks ===================== */
details{
  border:1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--surface);
}
details summary{
  font-weight: 700; cursor: pointer;
  color: var(--ink);
  list-style: none;
}
details summary::-webkit-details-marker{ display:none }
details[open]{ background: var(--surface-2) }

.pill-row{ display:flex; gap:6px; flex-wrap:wrap }
.pill{
  font-size: 11px; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
}
.pill.active{ color: var(--primary-2); border-color: rgba(0,102,255,.3); background: rgba(0,102,255,.06) }

/* cabeçalho com FAB voltar - no main container */
#crumbs .btn.ghost{ padding: 6px 10px; font-size: 12.5px }

/* scrollbar fina */
*::-webkit-scrollbar{ width:10px; height:10px }
*::-webkit-scrollbar-track{ background: transparent }
*::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.14); border-radius: 10px; border: 2px solid transparent; background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover{ background: rgba(15,23,42,.28); border: 2px solid transparent; background-clip: content-box; }
