/* =========================================================
   JC Serviços — Bootstrap 5 theme overlay
   Cores da marca (laranja) + admin dark navy (mockup)
   ========================================================= */

:root {
  /* Marca original */
  --brand:        #F57C00;
  --brand-dark:   #C85F00;
  --brand-darker: #A34C00;
  --brand-light:  #FFF3E6;
  --brand-tint:   #FFE3C2;

  /* Admin (navy dos mockups) */
  --navy:         #0F2547;
  --navy-dark:    #0A1A34;
  --navy-light:   #143063;

  --ink:          #1C1C1E;
  --ink-soft:     #6B6B70;
  --ink-faint:    #9A9AA0;
  --paper:        #FFFFFF;
  --surface:      #FAFAFA;
  --surface-2:    #F4F4F5;
  --line:         #EAEAEC;
  --success:      #1E9E5A;
  --success-tint: #E7F7EE;
  --danger:       #E23D3D;
  --danger-tint:  #FDEAEA;
  --warning:      #F5A623;
  --warning-tint: #FEF3E2;
  --info:         #0F82D6;
  --info-tint:    #E4F1FB;
  --star:         #F5A623;
  --shadow-sm:    0 1px 2px rgba(28,28,30,.04), 0 1px 8px rgba(28,28,30,.05);
  --shadow-md:    0 4px 10px rgba(28,28,30,.06), 0 10px 30px rgba(28,28,30,.07);
  --shadow-lg:    0 20px 45px rgba(28,28,30,.14);
  --radius:       16px;
  --radius-sm:    10px;

  /* Overrides Bootstrap */
  --bs-primary:        #F57C00;
  --bs-primary-rgb:    245, 124, 0;
  --bs-body-font-family: 'Inter', system-ui, sans-serif;
  --bs-body-color:     var(--ink);
  --bs-border-color:   var(--line);
  --bs-border-radius:  10px;
  --bs-border-radius-sm: 8px;
  --bs-border-radius-lg: 14px;
}

body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--surface); }
h1,h2,h3,h4,h5,h6,.font-display { font-family: 'Sora', system-ui, sans-serif; font-weight: 700; }
.num, .price { font-family: 'Sora', system-ui, sans-serif; font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

/* ---------- Botões custom ---------- */
.btn-brand { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-brand:hover, .btn-brand:focus { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn-navy:hover, .btn-navy:focus { background: var(--navy-light); border-color: var(--navy-light); color: #fff; }
.btn-outline-brand { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.btn-outline-brand:hover { background: var(--brand); color: #fff; }
.btn-outline-navy { border-color: var(--navy); color: var(--navy); font-weight: 600; }
.btn-outline-navy:hover { background: var(--navy); color: #fff; }

/* ---------- Ícone tile ---------- */
.icon-tile {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--brand-light), var(--brand-tint));
  color: var(--brand-dark);
  border-radius: 10px;
  width: 40px; height: 40px;
  position: relative; overflow: hidden;
}
.icon-tile-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.icon-tile-sm { width: 32px; height: 32px; font-size: .8rem; }
.icon-tile.icon-navy { background: linear-gradient(145deg, #E9EEF7, #D3DDEE); color: var(--navy); }

/* ---------- Badge de desconto (ticket-cut) ---------- */
.badge-cut {
  position: absolute; top: 12px; left: -2px; z-index: 3;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .72rem;
  padding: .32rem .6rem .32rem .75rem;
  clip-path: polygon(0 0, 100% 0, 88% 50%, 100% 100%, 0 100%);
  box-shadow: var(--shadow-sm); letter-spacing: .02em;
}

/* ---------- Badges custom ---------- */
.badge-success-soft { background: var(--success-tint); color: var(--success); }
.badge-danger-soft  { background: var(--danger-tint);  color: var(--danger); }
.badge-warning-soft { background: var(--warning-tint); color: var(--warning); }
.badge-info-soft    { background: var(--info-tint);    color: var(--info); }
.badge-neutral      { background: var(--surface-2);    color: var(--ink-soft); }

/* ---------- Card estilo JC ---------- */
.card-jc { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.card-jc:hover { box-shadow: var(--shadow-md); }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); transition: transform .2s ease, box-shadow .2s ease; }

/* ---------- Stat card ---------- */
.stat-card { border: none; border-radius: 14px; color: #fff; overflow: hidden; }
.stat-card .stat-icon { width: 48px; height: 48px; border-radius: 12px; background: rgba(255,255,255,.2); display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; }
.stat-card .stat-value { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.7rem; line-height: 1.1; }
.stat-card .stat-label { opacity: .9; font-size: .82rem; }
.stat-bg-brand   { background: linear-gradient(135deg, #F57C00, #FF9D3D); }
.stat-bg-navy    { background: linear-gradient(135deg, #0F2547, #143063); }
.stat-bg-success { background: linear-gradient(135deg, #1E9E5A, #26B96A); }
.stat-bg-info    { background: linear-gradient(135deg, #0F82D6, #3AA3F0); }
.stat-bg-warning { background: linear-gradient(135deg, #F5A623, #F7C361); }

/* ---------- Estrelas ---------- */
.stars { color: var(--star); letter-spacing: 1px; font-size: .8rem; }

/* ---------- Preço ---------- */
.price-old { text-decoration: line-through; color: var(--ink-faint); font-size: .85em; }
.price-new { color: var(--brand-dark); font-weight: 700; }

/* ---------- Admin sidebar (dark navy do mockup) ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 320px; background: var(--navy); color: #C7D3E8;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  transition: width .2s ease;
}
.admin-sidebar.collapsed { width: 80px; }
.admin-sidebar.collapsed .sidebar-label { display: none; }
.admin-sidebar .brand-block {
  height: 80px; display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem;
  background: rgba(0,0,0,.15); border-bottom: 1px solid rgba(255,255,255,.06);
}
.admin-sidebar .brand-block img { height: 42px; width: 42px; border-radius: 10px; object-fit: cover; }
.admin-sidebar .brand-block .brand-name { font-family: 'Sora'; font-weight: 800; color: #fff; font-size: 1.05rem; letter-spacing: .02em; }
.admin-sidebar .nav-link {
  color: #C7D3E8; padding: .85rem 1.15rem; border-radius: 10px; margin: 2px .7rem;
  display: flex; align-items: center; gap: .95rem; font-size: 1rem; font-weight: 500;
}
.admin-sidebar .nav-link i { width: 24px; text-align: center; font-size: 1.1rem; }
.admin-sidebar .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar .nav-link.active { background: var(--brand); color: #fff; }
.admin-sidebar .sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem 0; }
.admin-sidebar .sidebar-footer { padding: .75rem; border-top: 1px solid rgba(255,255,255,.08); }

/* ---------- Sidebar groups (submenus) ---------- */
.admin-sidebar .sidebar-group { margin: 0; }
.admin-sidebar .sidebar-group-header {
  width: calc(100% - 1.4rem); background: transparent; border: 0; color: #C7D3E8;
  padding: .85rem 1.15rem; border-radius: 10px; margin: 2px .7rem;
  display: flex; align-items: center; gap: .95rem;
  font-size: 1rem; font-weight: 500; text-align: left;
  transition: background .15s ease, color .15s ease;
}
.admin-sidebar .sidebar-group-header:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-sidebar .sidebar-group-header i.fa-solid:first-child { width: 24px; text-align: center; font-size: 1.1rem; }
.admin-sidebar .sidebar-group-caret {
  margin-left: auto; font-size: .7rem !important; transition: transform .2s ease; opacity: .7;
}
.admin-sidebar .sidebar-group.open .sidebar-group-caret { transform: rotate(180deg); opacity: 1; }
.admin-sidebar .sidebar-group.open .sidebar-group-header { color: #fff; }

.admin-sidebar .sidebar-group-items {
  display: none;
  padding: .25rem 0 .35rem;
  position: relative;
}
.admin-sidebar .sidebar-group.open .sidebar-group-items { display: block; }

.admin-sidebar .nav-link.nav-sub {
  padding-left: 3rem;
  margin: .15rem .7rem;
  font-size: .92rem;
  position: relative;
}
.admin-sidebar .nav-link.nav-sub::before { display: none; }
.admin-sidebar .nav-link.nav-sub i.fa-solid { font-size: .82rem; }
.admin-sidebar .nav-link.nav-sub::after {
  content: '';
  position: absolute; left: 1.35rem; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.25);
}
.admin-sidebar .nav-link.nav-sub.active::after { background: #fff; }
.admin-sidebar .nav-link.nav-sub:hover::after { background: rgba(255,255,255,.6); }

/* Collapsed sidebar: hide group items completely */
.admin-sidebar.collapsed .sidebar-group-items { display: none !important; }
.admin-sidebar.collapsed .sidebar-group-header { justify-content: center; }
.admin-sidebar.collapsed .sidebar-group-caret { display: none; }

.admin-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 72px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; position: sticky; top: 0; z-index: 30;
}
.admin-topbar h1 { font-size: 1.1rem; margin: 0; font-weight: 700; }
.topbar-subtitle { font-size: .72rem; color: var(--ink-soft); font-weight: 500; letter-spacing: .02em; }
.topbar-icons { display: flex; gap: .35rem; }
.topbar-icons a {
  width: 36px; height: 36px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--navy); text-decoration: none;
  font-size: .95rem; transition: background .15s ease, color .15s ease;
}
.topbar-icons a:hover { background: var(--brand); color: #fff; }
.admin-main { flex: 1; padding: 1.5rem; }

/* Mobile: sidebar off-canvas simulada */
@media (max-width: 992px) {
  .admin-sidebar { position: fixed; z-index: 1040; transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); }
  .admin-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1030; display: none; }
  .admin-backdrop.show { display: block; }
}

/* ---------- Site (público) navbar ---------- */
.site-navbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.site-topbar { background: var(--navy); color: rgba(255,255,255,.85); font-size: .82rem; padding: .45rem 0; }
.site-topbar a { color: #fff; text-decoration: none; }
.site-footer { background: var(--navy-dark); color: #C7D3E8; }
.site-footer a { color: #C7D3E8; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h5 { color: #fff; font-family: 'Sora'; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero-jc { background: linear-gradient(120deg, var(--brand-darker), var(--brand) 55%, #FF9D3D); color: #fff; position: relative; overflow: hidden; }
.hero-jc::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, transparent, rgba(0,0,0,.9) 40%, transparent 95%);
  pointer-events: none;
}

/* ---------- Table admin ---------- */
.table-jc { --bs-table-hover-bg: #f8fafc; }
.table-jc thead th { background: #f4f6fa; color: var(--ink-soft); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.table-jc td, .table-jc th { padding: .9rem 1rem; vertical-align: middle; }

/* ---------- Quantity stepper ---------- */
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty-stepper button { width: 34px; height: 34px; background: transparent; border: 0; color: var(--ink-soft); }
.qty-stepper button:hover { background: var(--brand-light); color: var(--brand-dark); }
.qty-stepper input { width: 42px; text-align: center; border: 0; background: transparent; font-weight: 600; }

/* ---------- Utilities ---------- */
.text-brand { color: var(--brand) !important; }
.text-navy { color: var(--navy) !important; }
.text-ink-faint { color: var(--ink-faint) !important; }
.bg-brand-light { background: var(--brand-light) !important; }
.bg-navy { background: var(--navy) !important; color: #fff !important; }
.border-jc { border: 1px solid var(--line) !important; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chk { accent-color: var(--brand); width: 16px; height: 16px; }

/* Form focus color to match brand */
.form-control:focus, .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}

/* Fade-up load animation */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s ease both; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- Page header pattern ---------- */
.page-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.5rem;
}
.page-header .page-title { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.5rem; margin: 0; color: var(--navy); }
.page-header .page-subtitle { color: var(--ink-soft); font-size: .85rem; margin: .1rem 0 0; }
.page-header .page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Page hero (título em card com destaque) ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(120deg, #ffffff 0%, #FFF9F2 60%, #FFF3E6 100%);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 1.5rem 1.75rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.page-hero::before {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(245,124,0,.16), transparent 65%);
  pointer-events: none;
}
.page-hero .page-hero-left { display: flex; align-items: center; gap: 1rem; position: relative; z-index: 1; }
.page-hero .page-hero-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #FF9D3D);
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: 0 8px 20px rgba(245,124,0,.32);
  flex-shrink: 0;
}
.page-hero .page-title {
  font-family: 'Sora', sans-serif; font-weight: 800; font-size: 1.6rem;
  margin: 0; color: var(--navy); line-height: 1.15;
}
.page-hero .page-subtitle {
  color: var(--ink-soft); font-size: .88rem; margin: .25rem 0 0;
}
.page-hero .page-actions { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; z-index: 1; }

/* ---------- Toolbar card (filtros/busca agrupados) ---------- */
.toolbar-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: .85rem 1rem; box-shadow: var(--shadow-sm);
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem;
}

/* ---------- Content panel (segunda body) ---------- */
.content-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}
.content-panel > .toolbar-card {
  background: var(--surface); box-shadow: none;
}
.content-panel > .card-jc {
  border: 1px solid var(--line); box-shadow: none;
}
.content-panel .stat-card { box-shadow: 0 12px 28px rgba(15,37,71,.14), 0 2px 4px rgba(15,37,71,.05); }
.content-panel .stat-card:hover { transform: translateY(-3px); transition: transform .2s ease, box-shadow .2s ease; box-shadow: 0 20px 36px rgba(15,37,71,.20), 0 4px 8px rgba(15,37,71,.08); }

/* KPI cards com sombra reforçada sempre que estiverem no topo do conteúdo */
.kpi-row .stat-card {
  box-shadow: 0 12px 28px rgba(15,37,71,.14), 0 2px 4px rgba(15,37,71,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.kpi-row .stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 36px rgba(15,37,71,.20), 0 4px 8px rgba(15,37,71,.08);
}

/* ---------- Filter tabs (chips) ---------- */
.filter-tabs {
  display: inline-flex; flex-wrap: wrap; gap: .35rem;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: .35rem;
  box-shadow: var(--shadow-sm);
}
.filter-tabs .filter-chip {
  border: 0; background: transparent; color: var(--ink-soft);
  padding: .45rem .95rem; border-radius: 8px; font-size: .82rem; font-weight: 600;
  text-decoration: none; transition: background .15s ease, color .15s ease;
  display: inline-flex; align-items: center; gap: .35rem; line-height: 1;
}
.filter-tabs .filter-chip:hover { background: var(--surface-2); color: var(--navy); }
.filter-tabs .filter-chip.active { background: var(--brand); color: #fff; }
.filter-tabs .filter-chip .count {
  background: rgba(0,0,0,.08); color: inherit; padding: .1rem .45rem;
  border-radius: 999px; font-size: .68rem; font-weight: 700;
}
.filter-tabs .filter-chip.active .count { background: rgba(255,255,255,.25); }

/* ---------- Search box (topo de tabelas) ---------- */
.search-inline {
  position: relative; max-width: 340px; flex: 1;
}
.search-inline .form-control {
  padding-left: 2.2rem; border-radius: 10px; border-color: var(--line); background: #fff;
}
.search-inline i {
  position: absolute; left: .8rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); font-size: .85rem;
}

/* ---------- Data table refinements ---------- */
.table-jc tbody tr { transition: background .15s ease; }
.table-jc tbody tr:hover { background: #f8fafc; }
.table-jc tbody td { border-bottom: 1px solid var(--line); }
.table-jc tbody tr:last-child td { border-bottom: 0; }
.cell-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(145deg, var(--brand-light), var(--brand-tint));
  color: var(--brand-dark); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .78rem; flex-shrink: 0;
}
.cell-user { display: flex; align-items: center; gap: .65rem; }
.cell-user .name { font-weight: 600; color: var(--ink); line-height: 1.2; }
.cell-user .sub { color: var(--ink-soft); font-size: .75rem; }

/* ---------- Icon action buttons (row actions) ---------- */
.btn-icon {
  width: 34px; height: 34px; border-radius: 8px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  transition: all .15s ease;
}
.btn-icon:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.btn-icon.btn-icon-danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-tint); }
.btn-icon.btn-icon-success:hover { border-color: var(--success); color: var(--success); background: var(--success-tint); }

/* ---------- Form modern (labels + fields) ---------- */
.form-modern .form-label { font-size: .78rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.form-modern .form-control, .form-modern .form-select {
  border-radius: 10px; border-color: var(--line); padding: .6rem .8rem; font-size: .9rem;
}
.form-modern .form-control:focus, .form-modern .form-select:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}

/* ---------- Info block (client card etc.) ---------- */
.info-block { display: flex; flex-direction: column; gap: .1rem; padding: .75rem 0; border-bottom: 1px dashed var(--line); }
.info-block:last-child { border-bottom: 0; }
.info-block .label { font-size: .7rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.info-block .value { font-size: .9rem; color: var(--ink); font-weight: 500; word-break: break-word; }

/* ---------- Rating stars (avaliações) ---------- */
.rating-stars { color: var(--star); font-size: .95rem; letter-spacing: 2px; }
.rating-stars .off { color: var(--line); }

/* ---------- Timeline (histórico de estado) ---------- */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(to bottom, var(--brand), var(--brand-tint));
  border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute; left: -1.5rem; top: 4px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.timeline-item.done::before { background: var(--brand); border-color: var(--brand); }
.timeline-item .ts-status { font-weight: 600; color: var(--navy); font-size: .9rem; }
.timeline-item .ts-meta { font-size: .75rem; color: var(--ink-soft); }

/* ---------- Proof-of-payment card ---------- */
.proof-preview {
  border: 2px dashed var(--line); border-radius: 12px; overflow: hidden;
  background: var(--surface-2); transition: border-color .15s ease;
}
.proof-preview:hover { border-color: var(--brand); }

/* ---------- Sidebar checkbox indicator ---------- */
.admin-sidebar .nav-link::before {
  content: ''; width: 14px; height: 14px; border-radius: 3px;
  border: 1.5px solid rgba(255,255,255,.25); background: transparent;
  flex-shrink: 0; display: inline-block; transition: all .15s ease;
}
.admin-sidebar .nav-link.active::before {
  background: #fff; border-color: #fff;
  box-shadow: inset 0 0 0 3px var(--brand);
}
.admin-sidebar.collapsed .nav-link::before { display: none; }
