/* ==========================================================
   Zcolab Portal — CSS v2.1 — Sidebar Colapsável + Tema Dinâmico
   ========================================================== */

/* ── Variáveis base (overrides via portal_theme_helper) ─── */
:root {
  --zc-dark:          #0f172a;
  --zc-sidebar-w:     236px;
  --zc-sidebar-w-col: 62px;
  --zc-topbar-h:      52px;
  --zc-blue:          var(--zc-accent, #378ADD);
  --zc-blue-dark:     var(--zc-btn, #185FA5);
  --zc-blue-light:    #dbeafe;
  --zc-bg:            #f1f5f9;
  --zc-white:         #ffffff;
  --zc-border:        #e2e8f0;
  --zc-text:          #0f172a;
  --zc-muted:         #64748b;
  --zc-subtle:        #94a3b8;
  --zc-radius:        10px;
  --zc-shadow:        0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
  --zc-shadow-md:     0 4px 12px rgba(15,23,42,.10);
  /* Fallbacks para variáveis de tema (sobrescritas pelo helper PHP) */
  --zc-sidebar-start: #1a3a6b;
  --zc-sidebar-end:   #0f2548;
  --zc-accent:        #378ADD;
  --zc-sidebar-text:  #ffffff;
  --zc-font:          system-ui, sans-serif;
  --zc-topbar:        #ffffff;
  --zc-btn:           #185FA5;
  --zc-btn-end:       #378ADD;
  --zc-sidebar-bg:    var(--zc-sidebar-start);
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body.customers {
  background: var(--zc-bg) !important;
  color: var(--zc-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding-top: 0 !important;
  margin: 0;
}

/* Garantir que margin da sidebar admin não vaze pro portal */
body.customers #wrapper,
body.customers.zcolab-global #wrapper,
body.customers.zcolab-ui-enabled #wrapper {
  margin-left: 0 !important;
}
body.customers #header,
body.customers.zcolab-global #header,
body.customers.zcolab-ui-enabled #header {
  left: 0 !important;
  width: 100% !important;
  margin-left: 0 !important;
}

/* ── Reset admin margin leak ──────────────────────────── */
body.customers #wrapper,
body.customers.zcolab-global #wrapper,
body.customers.zcolab-ui-enabled #wrapper { margin-left: 0 !important; }
body.customers #header,
body.customers.zcolab-global #header,
body.customers.zcolab-ui-enabled #header { left:0 !important; width:100% !important; margin-left:0 !important; }

/* ── Wrapper principal ─────────────────────────────────── */
#zc-portal-wrap {
  display: flex;
  min-height: 100vh;
  font-family: var(--zc-font);
}

/* Mantém classe legada .zc-portal-layout */
.zc-portal-layout { display: flex; min-height: 100vh; }
.zc-portal-main { flex: 1; margin-left: var(--zc-sidebar-w); min-width: 0; display: flex; flex-direction: column; }

/* ── Área principal (novo layout) ─────────────────────── */
#zc-main {
  flex: 1;
  margin-left: var(--zc-sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left .28s cubic-bezier(.4,0,.2,1);
}
#zc-portal-wrap.sidebar-collapsed #zc-main {
  margin-left: var(--zc-sidebar-w-col);
}

/* ── Topbar ────────────────────────────────────────────── */
#zc-topbar {
  height: var(--zc-topbar-h);
  background: var(--zc-topbar);
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 1px 0 var(--zc-border);
  flex-shrink: 0;
}
.zc-topbar-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: transparent; border: none; cursor: pointer;
  color: var(--zc-muted); transition: background .14s, color .14s;
  text-decoration: none;
  position: relative;
}
.zc-topbar-btn:hover { background: var(--zc-bg); color: var(--zc-dark); }
.zc-topbar-brand { text-decoration: none !important; }
.zc-notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; background: #ef4444; border-radius: 50%;
  border: 1.5px solid var(--zc-topbar);
}
.zc-tp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--zc-btn, #185FA5); color: #fff;
  font-size: 11px; font-weight: 700; cursor: pointer;
  border: none; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zc-topbar-profile { position: relative; }
.zc-tp-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--zc-border); border-radius: 10px;
  padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 190px; z-index: 1060;
}
.zc-tp-menu.open { display: block; }
.zc-tp-info { padding: 8px 10px 10px; border-bottom: 1px solid var(--zc-border); margin-bottom: 4px; }
.zc-tp-name  { font-size: 13px; font-weight: 700; color: var(--zc-dark); }
.zc-tp-email { font-size: 11px; color: var(--zc-muted); }
.zc-tp-item  {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 6px;
  font-size: 12.5px; color: var(--zc-text) !important; text-decoration: none !important;
  transition: background .12s;
}
.zc-tp-item:hover { background: var(--zc-bg); }
.zc-tp-danger { color: #dc2626 !important; }
.zc-tp-danger:hover { background: #fef2f2 !important; }
.zc-tp-sep { height: 1px; background: var(--zc-border); margin: 4px 0; }

/* ── Conteúdo principal ────────────────────────────────── */
#zc-content {
  flex: 1;
  background: var(--zc-bg);
}
#zc-content #wrapper { background: transparent !important; }
#zc-content #content { padding-top: 4px; }

/* ── SIDEBAR ───────────────────────────────────────────── */
.zc-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--zc-sidebar-w);
  background: linear-gradient(180deg, var(--zc-sidebar-start) 0%, var(--zc-sidebar-end) 100%);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  overflow: hidden;
  box-shadow: 1px 0 0 rgba(255,255,255,.04), 4px 0 12px rgba(0,0,0,.12);
  transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s cubic-bezier(.4,0,.2,1);
  font-family: var(--zc-font);
}
#zc-portal-wrap.sidebar-collapsed .zc-sidebar {
  width: var(--zc-sidebar-w-col);
}
#zc-portal-wrap.sidebar-collapsed .zcs-collapse-hide {
  opacity: 0;
  pointer-events: none;
  width: 0;
  overflow: hidden;
}
#zc-portal-wrap.sidebar-collapsed .zcs-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}
#zc-portal-wrap.sidebar-collapsed .zcs-group-label { opacity: 0; }
#zc-portal-wrap.sidebar-collapsed .zcs-item { justify-content: center; padding: 8px 0; }
#zc-portal-wrap.sidebar-collapsed .zcs-badge { display: none; }

/* ── Card do usuário ───────────────────────────────────── */
.zcs-user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
  overflow: hidden;
}
.zcs-uc-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zcs-uc-info { flex: 1; min-width: 0; }
.zcs-uc-name    { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zcs-uc-company { font-size: 10px; color: rgba(255,255,255,.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Brasão / crest ────────────────────────────────────── */
.zcs-crest { flex-shrink: 0; display: flex; align-items: center; }

/* ── Marca / Logo ─────────────────────────────────────── */
.zcs-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.zcs-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none !important;
}
.zcs-logo-img {
  max-height: 36px;
  max-width: 160px;
  width: auto;
  object-fit: contain;
  /* Forçar exibição em fundo escuro: usar logo light se tiver */
  filter: brightness(0) invert(1);
  opacity: .9;
}
.zcs-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.4px;
}
.zcs-logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--zc-blue);
  border-radius: 50%;
  margin-left: 2px;
  vertical-align: super;
}

/* ── Nav items ─────────────────────────────────────────── */
.zcs-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 10px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.zcs-nav::-webkit-scrollbar { width: 4px; }
.zcs-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.zcs-group-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: rgba(255,255,255,.25);
  padding: 14px 8px 4px;
  user-select: none;
}

.zcs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.6) !important;
  text-decoration: none !important;
  transition: background .14s, color .14s;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}
.zcs-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff !important;
}
.zcs-item.active {
  background: rgba(55,138,221,.18);
  color: #fff !important;
  border-left: 3px solid var(--zc-accent, #378ADD);
}
.zcs-item.active .zcs-icon svg { stroke: var(--zc-accent, #378ADD); }

.zcs-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.zcs-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.zcs-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Rodapé da sidebar ────────────────────────────────── */
.zcs-footer {
  padding: 8px 10px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
/* Footer avatar só aparece quando colapsado */
#zc-portal-wrap:not(.sidebar-collapsed) .zcs-footer .zcs-uc-avatar { display: none; }
.zcs-footer-item {
  font-size: 12.5px;
}
.zcs-badge-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: #ef4444;
  border-radius: 50%;
  border: 1.5px solid var(--zc-sidebar-bg);
}

/* ── Perfil dropdown na sidebar ──────────────────────── */
.zcs-profile-wrap { position: relative; }
.zcs-profile-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 7px;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background .14s;
  text-align: left;
}
.zcs-profile-btn:hover { background: rgba(255,255,255,.07); }
.zcs-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--zc-blue-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.zcs-profile-info { flex: 1; min-width: 0; }
.zcs-profile-name {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zcs-profile-company {
  font-size: 10px;
  color: rgba(255,255,255,.35);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.zcs-profile-btn .zcs-icon .zc-caret {
  width: 12px;
  height: 12px;
  transition: transform .2s;
}
.zcs-profile-wrap.open .zcs-profile-btn .zc-caret { transform: rotate(180deg); }

.zcs-profile-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 -8px 24px rgba(0,0,0,.4);
}
.zcs-profile-wrap.open .zcs-profile-menu { display: block; }
.zcs-profile-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  color: rgba(255,255,255,.65) !important;
  text-decoration: none !important;
  transition: background .12s, color .12s;
}
.zcs-profile-menu a:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.zcs-profile-menu a .zcs-icon { width: 15px; height: 15px; }
.zcs-pm-sep { height: 1px; background: rgba(255,255,255,.08); margin: 4px 0; }
.zcs-pm-danger { color: #fca5a5 !important; }
.zcs-pm-danger:hover { background: rgba(239,68,68,.12) !important; }

/* ── Mobile topbar ────────────────────────────────────── */
.zc-mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: var(--zc-mob-h);
  background: var(--zc-sidebar-bg);
  position: sticky;
  top: 0;
  z-index: 1030;
  flex-shrink: 0;
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
}
.zc-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,.7);
  border-radius: 7px;
  transition: background .14s, color .14s;
}
.zc-hamburger:hover { background: rgba(255,255,255,.08); color: #fff; }
.zc-mob-logo { flex: 1; text-align: center; }
.zc-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--zc-blue-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
#zc-sidebar-overlay,
.zc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
}
#zc-sidebar-overlay.open,
.zc-sidebar-overlay.open { display: block; }

/* ── Conteúdo principal ──────────────────────────────── */
#wrapper { background: var(--zc-bg); min-height: calc(100vh - var(--zc-mob-h)); }
#content { background: var(--zc-bg); padding-bottom: 48px; }
#content > .container:first-of-type { padding-top: 16px; }
#content > .container { padding-top: 24px; }

/* Container centralizado */
.container {
  max-width: 1200px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
}
.row { margin-left: -10px; margin-right: -10px; }
[class*="col-"] { padding-left: 10px; padding-right: 10px; }

/* Remover submenu legado */
.customer-top-submenu { display: none !important; }
/* Topbar antiga — ocultar no portal cliente */
body.customers .zc-topbar { display: none !important; }
body.customers .zc-mobile-menu { display: none !important; }

/* ── Cards ────────────────────────────────────────────── */
.zc-card {
  background: var(--zc-white);
  border: 0.5px solid var(--zc-border);
  border-radius: var(--zc-radius);
  box-shadow: var(--zc-shadow);
  overflow: hidden;
}
.zc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 0.5px solid var(--zc-border);
}
.zc-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--zc-text);
}
.zc-card-title svg {
  width: 16px; height: 16px;
  stroke: var(--zc-blue); fill: none; stroke-width: 2;
}
.zc-card-link {
  font-size: 12px;
  color: var(--zc-blue);
  text-decoration: none !important;
  font-weight: 500;
}
.zc-card-link:hover { color: var(--zc-blue-dark); }
.zc-card-body { padding: 16px 20px; }
.zc-card-footer{ padding: 12px 20px; border-top: 1px solid #f1f5f9; }

/* ── KPI grid ─────────────────────────────────────────── */
.zc-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.zc-kpi {
  background: var(--zc-white);
  border: 0.5px solid var(--zc-border);
  border-radius: var(--zc-radius);
  border-top: 3px solid transparent;
  padding: 18px 20px 16px;
  box-shadow: var(--zc-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.zc-kpi-blue   { border-top-color: var(--zc-blue); }
.zc-kpi-amber  { border-top-color: #f59e0b; }
.zc-kpi-green  { border-top-color: #10b981; }
.zc-kpi-red    { border-top-color: #ef4444; }
.zc-kpi-label  { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--zc-muted); margin-bottom: 8px; }
.zc-kpi-value  { font-size: 28px; font-weight: 800; color: var(--zc-text); line-height: 1; }
.zc-kpi-sub    { font-size: 12px; color: var(--zc-muted); margin-top: 4px; }
.zc-kpi-content { flex: 1; }
.zc-kpi-icon   { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; opacity: .6; flex-shrink: 0; }
.zc-kpi-icon svg { width: 24px; height: 24px; }
.zc-kpi-blue   .zc-kpi-icon { color: #2563eb; }
.zc-kpi-amber  .zc-kpi-icon { color: #d97706; }
.zc-kpi-green  .zc-kpi-icon { color: #16a34a; }
.zc-kpi-red    .zc-kpi-icon { color: #dc2626; }
.zc-kpi-orange { border-top-color: #ea580c; }
.zc-kpi-orange .zc-kpi-icon { color: #ea580c; }
.zc-kpi-teal   { border-top-color: #0d9488; background: linear-gradient(135deg,#f0fdfa,#ccfbf1); border-color: #99f6e4; }
.zc-kpi-teal   .zc-kpi-icon { color: #0d9488; }
.zc-kpi-purple { border-top-color: #7c3aed; background: linear-gradient(135deg,#faf5ff,#ede9fe); border-color: #ddd6fe; }
.zc-kpi-purple .zc-kpi-icon { color: #7c3aed; }
.zc-sub-warn   { color: #d97706 !important; font-weight: 600; }

/* ── Badges ──────────────────────────────────────────── */
.zc-badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; border: 1px solid transparent;
  white-space: nowrap; line-height: 1.5;
}
.zc-badge-blue   { background:#dbeafe; color:#1d4ed8; border-color:#bfdbfe; }
.zc-badge-green  { background:#dcfce7; color:#15803d; border-color:#bbf7d0; }
.zc-badge-amber  { background:#fef9c3; color:#92400e; border-color:#fde68a; }
.zc-badge-red    { background:#fee2e2; color:#b91c1c; border-color:#fecaca; }
.zc-badge-gray   { background:#f1f5f9; color:#475569; border-color:var(--zc-border); }
.zc-badge-purple { background:#f3e8ff; color:#7c3aed; border-color:#ddd6fe; }
.zc-badge-teal   { background:#ccfbf1; color:#0f766e; border-color:#99f6e4; }

/* ── Botões ───────────────────────────────────────────── */
.zc-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px; border-radius: 6px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none !important;
  transition: background .15s, transform .1s; line-height: 1.4;
}
.zc-btn:active { transform: scale(.98); }
.zc-btn-primary   { background: linear-gradient(135deg, var(--zc-btn-end, #378ADD), var(--zc-btn, #185FA5)); color: #fff !important; }
.zc-btn-primary:hover { filter: brightness(1.08); color: #fff !important; }
.zc-btn-secondary { background: var(--zc-white); color: var(--zc-text) !important; border: 1px solid var(--zc-border); }
.zc-btn-secondary:hover { background: var(--zc-bg); }
.zc-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.zc-btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── Boas-vindas ─────────────────────────────────────── */
.zc-welcome-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.zc-welcome-text h2 { font-size: 20px; font-weight: 800; color: var(--zc-text); margin: 0 0 2px; }
.zc-welcome-text p  { font-size: 13px; color: var(--zc-muted); margin: 0; }

/* ── Alertas de dashboard ──────────────────────────── */
.zc-alerts { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.zc-alert   { display:flex; align-items:center; gap:12px; padding:12px 18px; border-radius:10px; font-size:13px; font-weight:500; }
.zc-alert-red  { background:#fef2f2; color:#991b1b; border:1px solid #fca5a5; }
.zc-alert-amber{ background:#fffbeb; color:#92400e; border:1px solid #fcd34d; }

/* ── Listas de itens nos cards ───────────────────────── */
.zc-item-list { display: flex; flex-direction: column; }
.zc-item-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 0.5px solid var(--zc-border);
}
.zc-item-row:last-child { border-bottom: none; padding-bottom: 0; }
.zc-item-row:first-child { padding-top: 0; }
.zc-item-num   { font-size: 11px; font-weight: 700; color: var(--zc-blue); min-width: 48px; }
.zc-item-title { flex: 1; font-size: 13px; color: var(--zc-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zc-item-title a { color: var(--zc-text) !important; text-decoration: none !important; }
.zc-item-title a:hover { color: var(--zc-blue) !important; }
.zc-item-date  { font-size: 11px; color: var(--zc-muted); white-space: nowrap; }

/* ── Empty state ─────────────────────────────────────── */
.zc-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 28px 16px;
  color: var(--zc-subtle); font-size: 13px; gap: 8px; text-align: center;
}
.zc-empty svg { width: 28px; height: 28px; stroke: var(--zc-border); fill: none; stroke-width: 1.5; }

/* ── Progress bar ────────────────────────────────────── */
.zc-progress-bar  { height: 5px; background: var(--zc-bg); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.zc-progress-fill { height: 100%; background: var(--zc-blue); border-radius: 99px; transition: width .4s; }

/* ── Breadcrumb / Page header ────────────────────────── */
.zc-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--zc-muted); margin-bottom: 6px;
}
.zc-breadcrumb a { color: var(--zc-muted) !important; text-decoration: none !important; }
.zc-breadcrumb a:hover { color: var(--zc-blue) !important; }
.zc-breadcrumb-sep { color: var(--zc-border); }
.zc-breadcrumb .current { color: var(--zc-text); font-weight: 500; }
.zc-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.zc-page-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 20px; font-weight: 800; color: var(--zc-text); margin: 0;
}
.zc-page-title svg { width: 22px; height: 22px; stroke: var(--zc-blue); fill: none; stroke-width: 2; }

/* ── Login page ──────────────────────────────────────── */
body.customers.zc-login-page { background: var(--zc-dark) !important; }
body.customers .zc-login-wrap ~ * { display: none; }
.zc-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; background: var(--zc-dark);
}
.zc-login-card {
  background: var(--zc-white); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  width: 100%; max-width: 400px; padding: 40px 40px 32px;
}
.zc-login-logo { text-align: center; margin-bottom: 28px; }
.zc-login-logo .zc-logo-text { font-size: 26px; font-weight: 800; color: var(--zc-dark); }
.zc-login-logo .zc-logo-dot { width: 8px; height: 8px; }
.zc-login-title { font-size: 16px; font-weight: 700; color: var(--zc-text); margin-bottom: 4px; text-align: center; }
.zc-login-sub   { font-size: 13px; color: var(--zc-muted); text-align: center; margin-bottom: 24px; }
.zc-login-card .form-group label { font-size: 13px; font-weight: 600; color: var(--zc-text); margin-bottom: 5px; }
.zc-login-card .form-control {
  height: 40px; border: 1px solid var(--zc-border); border-radius: 7px;
  font-size: 14px; color: var(--zc-text); background: var(--zc-bg);
  transition: border-color .15s, box-shadow .15px;
}
.zc-login-card .form-control:focus { border-color: var(--zc-blue); box-shadow: 0 0 0 3px rgba(55,138,221,.15); background: #fff; }
.zc-login-card .btn-primary  { background: var(--zc-blue-dark) !important; border-color: var(--zc-blue-dark) !important; height: 42px; font-size: 14px; font-weight: 600; border-radius: 7px; }
.zc-login-card .btn-primary:hover { background: #145090 !important; }
.zc-login-card .btn-default  { background: var(--zc-bg) !important; border-color: var(--zc-border) !important; height: 42px; font-size: 14px; font-weight: 600; border-radius: 7px; color: var(--zc-text) !important; }
.zc-login-footer { text-align: center; margin-top: 24px; font-size: 12px; color: var(--zc-subtle); }

/* ── Modal "Nova Solicitação" ────────────────────────── */
.zc-modal .modal-dialog { max-width: 420px; margin-top: 15vh; }
.zc-modal .modal-content { border-radius: 12px; border: none; box-shadow: var(--zc-shadow-md); }
.zc-modal .modal-header { border-bottom: 0.5px solid var(--zc-border); padding: 18px 20px 14px; }
.zc-modal .modal-title  { font-size: 15px; font-weight: 700; }
.zc-modal .modal-body   { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.zc-choice-btn {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border: 1px solid var(--zc-border); border-radius: 10px; cursor: pointer;
  background: var(--zc-white); text-decoration: none !important;
  transition: border-color .15s, background .15s;
}
.zc-choice-btn:hover { border-color: var(--zc-blue); background: #f0f7ff; }
.zc-choice-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.zc-choice-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.75; }
.zc-choice-icon.blue { background: #dbeafe; color: var(--zc-blue-dark); }
.zc-choice-icon.amber { background: #fef3c7; color: #b45309; }
.zc-choice-label { font-size: 14px; font-weight: 600; color: var(--zc-text); }
.zc-choice-desc  { font-size: 12px; color: var(--zc-muted); margin-top: 1px; }

/* ── Bootstrap overrides ─────────────────────────────── */
.alert { border-radius: 8px; border: none; font-size: 13px; }
.alert-success { background: #dcfce7; color: #15803d; }
.alert-danger   { background: #fee2e2; color: #b91c1c; }
.alert-warning  { background: #fef9c3; color: #92400e; }
.alert-info     { background: #dbeafe; color: #1d4ed8; }
.panel_s { background: var(--zc-white); border: 0.5px solid var(--zc-border) !important; border-radius: var(--zc-radius) !important; box-shadow: var(--zc-shadow) !important; overflow: hidden; }
.panel_s .panel-body { padding: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* DataTables overflow fix */
body.customers .dataTables_wrapper { overflow-x: auto; }
body.customers .dataTables_scrollBody { overflow-x: auto !important; }
body.customers table.dataTable { min-width: 500px; }

/* ── Page header (título + breadcrumb) ─────────── */
.zcp-page-hdr { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap; }
.zcp-page-hdr-left h3 { margin:0 0 4px; font-size:18px; font-weight:700; color:var(--zc-dark); line-height:1.2; }
.zcp-breadcrumb { font-size:12px; color:var(--zc-muted); display:flex; align-items:center; gap:4px; }
.zcp-breadcrumb a { color:var(--zc-muted) !important; text-decoration:none !important; }
.zcp-breadcrumb a:hover { color:var(--zc-blue) !important; }
.zcp-breadcrumb span { color:var(--zc-subtle); }
.table { font-size: 13px; }
.table > thead > tr > th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--zc-muted); border-bottom: 0.5px solid var(--zc-border) !important; background: transparent; padding: 10px 14px; }
.table > tbody > tr > td { padding: 10px 14px; border-top: 0.5px solid var(--zc-border) !important; vertical-align: middle; color: var(--zc-text); }
.table-hover > tbody > tr:hover > td { background: #f8fafc; }
.table > tbody > tr > td a { color: var(--zc-text) !important; font-weight: 500; }
.table > tbody > tr > td a:hover { color: var(--zc-blue) !important; }
body.customers .form-control { border-radius: 7px; border-color: var(--zc-border); font-size: 13px; color: var(--zc-text); background: #fff; transition: border-color .15s, box-shadow .15s; }
body.customers .form-control:focus { border-color: var(--zc-blue); box-shadow: 0 0 0 3px rgba(55,138,221,.12); }
body.customers label { font-size: 13px; font-weight: 600; color: var(--zc-text); }
.pagination > li > a, .pagination > li > span { border-radius: 6px !important; margin: 0 2px; font-size: 13px; color: var(--zc-blue) !important; border-color: var(--zc-border) !important; }
.pagination > .active > a { background: var(--zc-blue-dark) !important; border-color: var(--zc-blue-dark) !important; color: #fff !important; }
body.customers h1, body.customers h2, body.customers h3, body.customers h4, body.customers h5 { color: var(--zc-text); font-weight: 700; }

/* ── Table responsive ────────────────────────────────── */
.table-responsive-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive-wrapper .table { min-width: 540px; }

/* ── Skeleton ────────────────────────────────────────── */
.zc-skeleton { background: linear-gradient(90deg,#f1f5f9 25%,#e2e8f0 50%,#f1f5f9 75%); background-size: 200% 100%; animation: zc-shimmer 1.5s infinite; border-radius: 4px; }
@keyframes zc-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Chat / Timeline ─────────────────────────────────── */
.zcp-timeline { display: flex; flex-direction: column; gap: 0; }
.zcp-timeline-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 0.5px solid var(--zc-border); }
.zcp-timeline-item:last-child { border-bottom: none; }
.zcp-tl-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--zc-blue-dark); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.zcp-tl-avatar.staff { background: #7c3aed; }
.zcp-tl-body { flex: 1; min-width: 0; }
.zcp-tl-meta { font-size: 11px; color: var(--zc-muted); margin-bottom: 4px; }
.zcp-tl-text { font-size: 13px; color: var(--zc-text); line-height: 1.6; }
.zcp-tl-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.zcp-tl-file-link { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 6px; background: var(--zc-bg); border: 0.5px solid var(--zc-border); font-size: 11px; font-weight: 500; color: var(--zc-text) !important; text-decoration: none !important; }
.zcp-tl-file-link:hover { background: #e2e8f0; }

/* ── Photo gallery ───────────────────────────────────── */
.zcp-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.zcp-photo-thumb { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; cursor: zoom-in; border: 0.5px solid var(--zc-border); transition: transform .15s, box-shadow .15s; }
.zcp-photo-thumb:hover { transform: scale(1.03); box-shadow: var(--zc-shadow-md); }
.zcp-lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 9999; align-items: center; justify-content: center; }
.zcp-lightbox.open { display: flex; }
.zcp-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; object-fit: contain; }
.zcp-lightbox-close { position: absolute; top: 16px; right: 20px; font-size: 28px; color: #fff; cursor: pointer; background: none; border: none; }

/* ── Checklist ───────────────────────────────────────── */
.zcp-checklist { display: flex; flex-direction: column; gap: 8px; }
.zcp-check-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--zc-text); }
.zcp-check-item .zcp-check-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; }
.zcp-check-item.done .zcp-check-icon { background: #dcfce7; color: #16a34a; }
.zcp-check-item.pending .zcp-check-icon { background: #f1f5f9; color: #94a3b8; }

/* ── QR / Assinatura ─────────────────────────────────── */
.zcp-sig-block { background: #f8fafc; border: 1px solid var(--zc-border); border-radius: 10px; padding: 20px; text-align: center; }
.zcp-sig-img { max-width: 280px; max-height: 100px; object-fit: contain; margin: 0 auto 8px; display: block; }
.zcp-qr-wrap { display: inline-block; padding: 14px; background: #fff; border: 0.5px solid var(--zc-border); border-radius: 10px; box-shadow: var(--zc-shadow); }
.zcp-qr-wrap img { width: 120px; height: 120px; }

/* ── Touch-friendly ──────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  .zc-btn { min-height: 44px; }
  .zcs-item { min-height: 44px; }
  .zc-choice-btn { padding: 18px; }
}

/* ── Sidebar overlay (mobile) ──────────────────────────── */
#zc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1039;
}
#zc-sidebar-overlay.open { display: block; }

/* ── Utilitários mobile ────────────────────────────────── */
.zc-show-mobile { display: none !important; }
.zc-hide-mobile { display: flex !important; }

/* ── Badges da sidebar ─────────────────────────────────── */
.zcs-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #ef4444; color: #fff;
  border-radius: 99px; font-size: 10px; font-weight: 700;
  margin-left: auto; flex-shrink: 0;
}

/* ── Touch improvements (global) ────────────────────────── */
* { -webkit-tap-highlight-color: transparent; }
.zcs-item, .zcs-sub-item, .zc-btn, .zch-foot-btn,
.zcos-kpi-card, .zcos-card, .zcof-section { -webkit-overflow-scrolling: touch; }

/* ── Chart containers globais ───────────────────────────── */
.chart-container {
  position: relative;
  width: 100%;
  height: 220px;
}

/* ════════════════════════════════════════════════════════
   RESPONSIVO
   ════════════════════════════════════════════════════════ */

/* ── ≤ 991px — Tablet / Mobile ─────────────────────────── */
@media (max-width: 991px) {
  /* 2.3 Sidebar como overlay */
  .zc-sidebar {
    transform: translateX(-100%);
    width: var(--zc-sidebar-w) !important;
    z-index: 1050;
  }
  .zc-sidebar.open { transform: translateX(0); }

  /* Main sem margem */
  #zc-main, .zc-portal-main { margin-left: 0 !important; }

  /* Topbar */
  #zc-topbar { padding: 0 12px; }
  .zc-show-mobile { display: flex !important; }
  .zc-hide-mobile { display: none !important; }
  #zc-hamburger  { display: flex !important; }

  /* 2.1 KPI grid 2 colunas */
  .zc-kpi-row { grid-template-columns: repeat(2, 1fr) !important; }

  /* Dashboard cards col-md-6 col-md-4: empilhar */
  .col-md-6, .col-md-4, .col-md-3 { width: 100% !important; float: none !important; }

  /* Botão "Nova solicitação": só ícone */
  .btn-nova-solicitacao span { display: none !important; }
  .btn-nova-solicitacao      { padding: 8px 10px !important; }

  /* Submenus flyout: desativar no mobile (accordion sempre aberto) */
  .zcs-fin-flyout { display: none !important; }
  .zcs-submenu { display: block !important; }

  /* Collapse não funciona no mobile */
  #zc-portal-wrap.sidebar-collapsed .zc-sidebar { width: var(--zc-sidebar-w) !important; }
  #zc-portal-wrap.sidebar-collapsed .zcs-collapse-hide {
    opacity: 1 !important; pointer-events: auto !important;
    width: auto !important; overflow: visible !important;
  }
  #zc-portal-wrap.sidebar-collapsed .zcs-label { opacity: 1 !important; width: auto !important; overflow: visible !important; }
  #zc-portal-wrap.sidebar-collapsed .zcs-group-label { opacity: 1 !important; }
  #zc-portal-wrap.sidebar-collapsed .zcs-item { justify-content: flex-start !important; padding: 8px 10px !important; }

  /* Itens clicáveis: mínimo Apple HIG */
  .zcs-item, .zcs-sub-item { min-height: 44px; }
  .zc-btn, .zch-foot-btn { min-height: 44px; }
  .zc-topbar-btn { min-height: 44px; min-width: 44px; }

  /* OS cards padding */
  .zcos-card-body { padding: 10px 12px; }
  .zcos-card-meta { width: 58px; }

  /* Formulários 2-col → 1-col */
  .zcof-row { flex-direction: column !important; }
  .zcof-wrap { flex-direction: column !important; }
  .zcof-sidebar { width: 100% !important; position: static !important; }

  /* Tabela de itens da OS */
  .zcp-table { font-size: 12px; }

  /* Gráficos */
  .chart-container { height: 180px; }
}

/* ── ≤ 600px — Mobile pequeno ───────────────────────────── */
@media (max-width: 600px) {
  .zc-kpi-row { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .container  { padding-left: 14px !important; padding-right: 14px !important; }
  .zc-page-header  { flex-direction: column; align-items: flex-start; }
  .zc-welcome-bar  { flex-direction: column; align-items: flex-start; }
  .zcp-page-hdr    { flex-direction: column; gap: 8px !important; }

  /* Tabelas com scroll horizontal */
  .panel_s .panel-body, .dataTables_wrapper, table.dataTable { overflow-x: auto; font-size: 11px; }
  table.dataTable { min-width: 500px; }

  /* OS cards: compact */
  .zcos-card { flex-direction: row; }
  .zcos-card-meta { width: 54px; padding: 10px 6px; }
  .zcos-kpi-strip { gap: 6px; }
  .zcos-kpi-card  { padding: 8px 10px; min-width: 70px; }
  .zcos-kpi-num   { font-size: 20px; }

  /* Tabela de itens OS: ocultar Qtd e Valor unit. */
  .zcp-table th:nth-child(3), .zcp-table td:nth-child(3),
  .zcp-table th:nth-child(4), .zcp-table td:nth-child(4) { display: none; }

  /* Galeria de fotos */
  .zcp-photo-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }

  /* Gráficos menor */
  .chart-container { height: 160px; }

  /* Formulários OS */
  .zcof-row { flex-direction: column !important; }
}

/* ── Overlay mobile sidebar ─────────────────────────────── */
#zc-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1039;
  -webkit-tap-highlight-color: transparent;
}
#zc-sidebar-overlay.open { display: block; }

/* ── Hamburger (visível só mobile) ─────────────────────── */
#zc-hamburger { display: none; }

/* ════════════════════════════════════════════════════════
   INVENTÁRIO DE TI — Classes globais
   ════════════════════════════════════════════════════════ */

/* Já definidas inline nas views, aqui as globais */
.inv-card {
  display: block; background: #fff; border-radius: 12px;
  border: 1px solid var(--zc-border); padding: 16px;
  text-decoration: none !important;
  box-shadow: var(--zc-shadow);
  transition: box-shadow .15s, transform .15s;
  color: var(--zc-text);
}
.inv-card:hover { box-shadow: var(--zc-shadow-md); transform: translateY(-2px); }

.inv-icon-wrap {
  width: 44px; height: 44px;
  background: rgba(55,138,221,.08); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.inv-status-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.inv-warranty-ok   { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; background:#dcfce7; color:#15803d; border:1px solid #bbf7d0; }
.inv-warranty-warn { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; background:#fffbeb; color:#92400e; border:1px solid #fde68a; }
.inv-warranty-exp  { display:inline-block; padding:2px 8px; border-radius:20px; font-size:10px; font-weight:700; background:#fee2e2; color:#b91c1c; border:1px solid #fecaca; }

.inv-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--zc-border); }
.inv-tab {
  background: none; border: none; padding: 10px 16px;
  font-size: 13px; font-weight: 600; color: var(--zc-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.inv-tab:hover { color: var(--zc-dark); }
.inv-tab.active { color: var(--zc-accent, #378ADD); border-bottom-color: var(--zc-accent, #378ADD); }
.inv-tab-content { display: none; }
.inv-tab-content.active { display: block; }
