:root {
  --theme-bg-main: #06090e;
  --theme-bg-sidebar: #0b0e14;
  --theme-bg-card: #0e131f;
  --theme-bg-card-strong: #111520;
  --theme-bg-topbar: #070a0f;
  --theme-bg-panel: #0b0e14;
  --theme-bg-panel-header: #0e121b;
  --theme-bg-row: #111520;
  --theme-border: #242f47;
  --theme-text-main: #cbd5e1;
  --theme-text-bright: #ffffff;
  --theme-text-muted: #64748b;
  --theme-text-secondary: #8b98ad;
  --theme-green: #00E676;
  --theme-blue: #00B0FF;
  --theme-orange: #FF5A00;
  --theme-red: #ef4444;
  --theme-yellow: #FFD600;
  --theme-shadow-soft: 0 18px 42px rgba(0, 0, 0, 0.28);
  --theme-glow-green: 0 0 18px rgba(0, 230, 118, 0.08);
  --theme-radar-bg:
    radial-gradient(circle at 18% 0%, rgba(0, 230, 118, 0.1), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(0, 176, 255, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(11, 14, 20, 0.98), rgba(7, 10, 16, 0.98));
  --theme-radar-grid: rgba(148, 163, 184, 0.035);
  --theme-radar-circle-bg: radial-gradient(circle, #101826 0%, #0b0f17 64%, #070a0f 100%);
  --theme-radar-circle-shadow: 0 0 0 8px #080b11, 0 0 0 1px rgba(255,255,255,0.02) inset;
  --theme-brand-go: #22c55e;
  --theme-brand-go-border: rgba(34, 197, 94, 0.38);
  --theme-brand-go-glow: rgba(34, 197, 94, 0.28);
  --theme-brand-symbol-main: #ffffff;
  --theme-brand-symbol-detail: #10b981;
  --theme-brand-symbol-hole: #052e1b;
  --theme-brand-maker: #e5edf7;
  --theme-red-soft-bg: rgba(239, 68, 68, 0.1);
  --theme-red-soft-border: rgba(239, 68, 68, 0.2);
  --theme-sidebar-footer-bg: rgba(6, 9, 14, 0.6);
  --theme-nav-text: #8b98ad;
  --theme-nav-icon: #69758a;
  --theme-nav-hover-bg: rgba(255, 255, 255, 0.025);
  --theme-nav-hover-text: #dbe4ef;
  --theme-card-shadow: none;

  --bg-main: var(--theme-bg-main);
  --bg-sidebar: var(--theme-bg-sidebar);
  --bg-card: var(--theme-bg-card);
  --border-color: var(--theme-border);
  --brand-orange: var(--theme-orange);
  --brand-yellow: var(--theme-yellow);
  --brand-blue: var(--theme-blue);
  --brand-green: var(--theme-green);
  --brand-red: var(--theme-red);
  --brand-whatsapp: #25D366;
  --brand-highlight: var(--theme-green);
  --text-main: var(--theme-text-main);
  --text-bright: var(--theme-text-bright);
  --text-muted: var(--theme-text-muted);
  --shadow-soft: var(--theme-shadow-soft);
  --glow-green: var(--theme-glow-green);
}

html.theme-light,
body.theme-light {
  --theme-bg-main: #f9fafb;
  --theme-bg-sidebar: #f1f5f9;
  --theme-bg-card: #ffffff;
  --theme-bg-card-strong: #f8fafc;
  --theme-bg-topbar: #ffffff;
  --theme-bg-panel: #ffffff;
  --theme-bg-panel-header: #ffffff;
  --theme-bg-row: #ffffff;
  --theme-border: #e5e7eb;
  --theme-text-main: #334155;
  --theme-text-bright: #0f172a;
  --theme-text-muted: #64748b;
  --theme-text-secondary: #64748b;
  --theme-shadow-soft: 0 18px 44px rgba(15, 23, 42, 0.1);
  --theme-glow-green: 0 0 0 rgba(0, 230, 118, 0);
  --theme-radar-bg:
    radial-gradient(circle at 12% 0%, rgba(22, 163, 74, 0.08), transparent 30%),
    radial-gradient(circle at 88% 12%, rgba(37, 99, 235, 0.07), transparent 32%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  --theme-radar-grid: rgba(15, 23, 42, 0.018);
  --theme-radar-circle-bg: radial-gradient(circle at 35% 25%, #ffffff 0%, #f8fafc 64%, #eef2f7 100%);
  --theme-radar-circle-shadow: 0 12px 26px rgba(15, 23, 42, 0.11), 0 0 0 7px #ffffff, 0 0 0 1px rgba(15, 23, 42, 0.06) inset;
  --theme-brand-go: #111827;
  --theme-brand-go-border: rgba(17, 24, 39, 0.16);
  --theme-brand-go-glow: rgba(17, 24, 39, 0.08);
  --theme-brand-symbol-main: #111827;
  --theme-brand-symbol-detail: #059669;
  --theme-brand-symbol-hole: #ffffff;
  --theme-brand-maker: #111827;
  --theme-red-soft-bg: rgba(239, 68, 68, 0.08);
  --theme-red-soft-border: rgba(239, 68, 68, 0.18);
  --theme-sidebar-footer-bg: rgba(226, 232, 240, 0.78);
  --theme-nav-text: #475569;
  --theme-nav-icon: #6b7280;
  --theme-nav-hover-bg: rgba(15, 23, 42, 0.055);
  --theme-nav-hover-text: #111827;
  --theme-card-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

html.theme-dark,
body.theme-dark {
  color-scheme: dark;
}

body.theme-light .sidebar {
  background: #f1f5f9;
  border-right-color: #e2e8f0;
  box-shadow: 12px 0 34px rgba(15, 23, 42, 0.06);
}

body.theme-light .brand-mark {
  background: radial-gradient(circle at 38% 25%, rgba(34,197,94,0.14), transparent 44%), #111827;
  border-color: rgba(34, 197, 94, 0.32);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12), 0 0 18px rgba(34,197,94,0.16);
}

body.theme-light .nav-section-label {
  color: #94a3b8;
}

body.theme-light .nav-item a {
  color: #475569;
}

body.theme-light .nav-item a:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.theme-light .nav-item.active a {
  background: #dcfce7;
  color: #047857;
  border-color: #86efac;
  box-shadow: inset 3px 0 0 #16a34a, 0 10px 22px rgba(22, 163, 74, 0.1);
}

body.theme-light .nav-item.active i,
body.theme-light .nav-item.active .nav-chevron {
  color: #16a34a;
}

body.theme-light .plan-box {
  background: #ffffff;
  border-color: #e5e7eb;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

body.theme-light .global-topbar,
body.theme-light .topbar {
  background: #ffffff;
  border-bottom-color: #e5e7eb;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.055);
}

body.theme-light .theme-header-switch {
  background: #ffffff;
  border-color: #dbe3ee;
  color: #1f2937;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

body.theme-light .theme-header-switch:hover {
  border-color: rgba(22, 163, 74, 0.38);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
}

body.theme-light .theme-switch-track {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.34);
}

body.theme-light .theme-switch-thumb {
  background: #16a34a;
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(22, 163, 74, 0.24);
}

body.theme-light .btn-logout {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(220, 38, 38, 0.18);
}

body.theme-light .btn-logout:hover {
  background: #b91c1c;
  box-shadow: 0 16px 30px rgba(220, 38, 38, 0.24);
}

body.theme-light .journey-panel {
  border-color: #e5e7eb;
  border-radius: 16px;
  background:
    radial-gradient(circle at 16% 0%, rgba(22, 163, 74, 0.08), transparent 32%),
    radial-gradient(circle at 88% 8%, rgba(37, 99, 235, 0.07), transparent 34%),
    linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.1);
}

body.theme-light .journey-panel::before {
  opacity: 0.28;
  background-size: 52px 52px;
}

body.theme-light .workshop-journey::before {
  height: 1px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.16), rgba(22, 163, 74, 0.22), rgba(234, 88, 12, 0.16));
  box-shadow: none;
}

body.theme-light .journey-icon {
  background: var(--theme-radar-circle-bg);
  border-color: #dbe3ee;
  color: #64748b;
}

body.theme-light .journey-icon::before {
  border-color: rgba(15, 23, 42, 0.055);
}

body.theme-light .journey-icon::after {
  background: #cbd5e1;
}

body.theme-light .journey-icon i {
  opacity: 0.16;
}

body.theme-light .journey-count {
  color: #0f172a;
  text-shadow: none;
}

body.theme-light .stage-scheduled .journey-icon,
body.theme-light .stage-budget .journey-icon {
  border-color: rgba(37, 99, 235, 0.28);
  color: #2563eb;
}

body.theme-light .stage-approved .journey-icon,
body.theme-light .stage-delivered .journey-icon {
  border-color: rgba(22, 163, 74, 0.3);
  color: #16a34a;
}

body.theme-light .stage-parts .journey-icon {
  border-color: rgba(234, 88, 12, 0.3);
  color: #ea580c;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  display: flex;
  overflow: hidden;
}

/* ================= SIDEBAR ================= */
.sidebar { display: flex !important; width: 260px; background-color: var(--bg-sidebar); border-right: 1px solid var(--border-color); flex-direction: column; justify-content: space-between; flex-shrink: 0; height: 100%; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease; position: relative; z-index: 1001; }
.sidebar-top { padding: 20px 14px; overflow-y: auto; flex: 1; overflow-x: hidden; }

.brand-logo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; padding: 4px 8px 4px 10px; position: relative; }
.brand-lockup { min-width: 0; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 46px; height: 46px; border: 1px solid var(--theme-brand-go-border); border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: radial-gradient(circle at 38% 25%, rgba(34,197,94,0.18), transparent 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(16, 185, 129, 0.12)); box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 0 18px rgba(34,197,94,0.25), 0 14px 30px rgba(0,0,0,0.28); overflow: hidden; }
.brand-mark-img { width: 36px; height: 36px; display: block; object-fit: contain; filter: drop-shadow(0 0 10px var(--theme-brand-go-glow)); }
.brand-mark-svg { width: 36px; height: 36px; display: block; filter: drop-shadow(0 0 10px var(--theme-brand-go-glow)); }
.go-symbol-main { fill: var(--theme-brand-symbol-main); }
.go-symbol-detail { fill: var(--theme-brand-symbol-detail); }
.go-symbol-hole { fill: var(--theme-brand-symbol-hole); }
.brand-login-mark { width: 48px; height: 48px; margin: 0 auto; border: 1px solid var(--theme-brand-go-border); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 38% 25%, rgba(255,255,255,0.1), transparent 44%), linear-gradient(145deg, rgba(255,255,255,0.08), rgba(16, 185, 129, 0.08)); box-shadow: 0 14px 30px rgba(0,0,0,0.28); }
.brand-login-mark .brand-mark-svg { width: 38px; height: 38px; }
.brand-wordmark { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; transition: opacity 0.2s ease; }
.brand-product { color: var(--brand-green); font-size: 20px; font-weight: 900; letter-spacing: 0.08em; margin-top: 0; text-shadow: 0 0 14px rgba(0, 230, 118, 0.16); }
.brand-icon-wrapper { width: 34px; height: 34px; border: 1px solid rgba(0, 230, 118, 0.42); border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--brand-green); background: linear-gradient(135deg, rgba(0, 230, 118, 0.14), rgba(255, 90, 0, 0.08)); box-shadow: 0 0 0 1px rgba(255,255,255,0.02) inset; }
.brand-icon-wrapper i { width: 18px; height: 18px; }
.brand-name { display: flex; flex-direction: column; line-height: 1; white-space: nowrap; transition: opacity 0.2s ease; }
.brand-go { color: var(--text-bright); font-size: 20px; font-weight: 900; letter-spacing: 0; }
.brand-oficina { color: var(--brand-green); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; margin-top: 4px; }

.btn-sidebar-toggle { position: absolute; right: -10px; top: 32px; background: var(--bg-card); border: 1px solid var(--border-color); color: var(--text-muted); width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; z-index: 10; }
.btn-sidebar-toggle:hover { color: var(--brand-orange); border-color: var(--brand-orange); }
.btn-sidebar-toggle i { width: 14px; height: 14px; }

.nav-menu { display: flex; flex-direction: column; gap: 3px; list-style: none; }
.nav-section-label { margin: 14px 10px 6px; color: var(--theme-text-muted); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.nav-item a { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; color: var(--theme-nav-text); text-decoration: none; font-size: 14px; font-weight: 600; border-radius: 8px; transition: all 0.2s ease; border: 1px solid transparent; overflow: hidden; }
.nav-item-content { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.nav-item i { width: 18px; height: 18px; color: var(--theme-nav-icon); transition: transform 0.2s ease, color 0.2s ease; flex-shrink: 0; }
.nav-item-content span { transition: opacity 0.2s ease; }
.nav-chevron { width: 15px; height: 15px; color: var(--text-muted); opacity: 0; transition: opacity 0.2s ease; }
.nav-item a:hover { background-color: var(--theme-nav-hover-bg); color: var(--theme-nav-hover-text); }
.nav-item a:hover i { color: var(--theme-nav-hover-text); }

.nav-item.active a { background: linear-gradient(90deg, rgba(0, 230, 118, 0.14) 0%, rgba(0, 230, 118, 0.035) 100%); color: var(--brand-green); border: 1px solid rgba(0, 230, 118, 0.28); box-shadow: inset 3px 0 0 rgba(0, 230, 118, 0.78); }
.nav-item.active i { color: var(--brand-green); }
.nav-item.active .nav-chevron { opacity: 1; color: var(--brand-green); }
.nav-support a { color: var(--brand-green); }
.nav-support i { color: var(--brand-green); }
.nav-support a:hover { background: rgba(0, 230, 118, 0.08); color: var(--brand-green); }

.sidebar-footer-card { padding: 14px; border-top: 1px solid var(--border-color); background-color: var(--theme-sidebar-footer-bg); transition: padding 0.3s ease; }
.plan-box { background-color: var(--theme-bg-card-strong); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; overflow: hidden; }
.plan-info-row { display: flex; align-items: center; gap: 10px; }
.plan-badge-icon { width: 28px; height: 28px; background: rgba(255, 90, 0, 0.1); border: 1px solid rgba(255, 90, 0, 0.2); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--brand-orange); flex-shrink: 0; }
.plan-text { transition: opacity 0.2s ease; white-space: nowrap; }
.plan-text .title { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.plan-text .subtitle { font-size: 12px; font-weight: 600; color: var(--brand-orange); }
.sidebar-version { margin-top: 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; white-space: nowrap; }
.sidebar-version-credit { display: flex; align-items: baseline; justify-content: center; gap: 4px; color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; }
.sidebar-version-prefix { color: var(--text-muted); font-weight: 700; }
.sidebar-version-maker { color: var(--theme-brand-maker); font-weight: 900; }

/* COLLAPSED STATE */
.sidebar.collapsed { width: 70px !important; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.sidebar.collapsed .brand-name,
.sidebar.collapsed .brand-wordmark,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .nav-item-content span,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .plan-text,
.sidebar.collapsed .sidebar-version,
.sidebar.collapsed span { display: none !important; }
.sidebar.collapsed .nav-item i { transform: scale(1.3); font-size: 1.4rem; margin: 0 auto; }
.sidebar.collapsed .nav-item a { justify-content: center; padding: 14px 0; }
.sidebar.collapsed .nav-item-content { gap: 0; width: 100%; justify-content: center; }
.sidebar.collapsed .sidebar-footer-card { padding: 14px 10px; }
.sidebar.collapsed .btn-sidebar-toggle { right: 23px; top: 32px; }

/* ================= GLOBAL TOPBAR ================= */
.global-topbar { height: 70px; background: var(--theme-bg-topbar); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; flex-shrink: 0; position: sticky; top: 0; z-index: 1000; }
.btn-mobile-menu { display: none; background: none; border: none; color: var(--text-bright); cursor: pointer; padding: 8px; }
.btn-mobile-menu i { width: 24px; height: 24px; }
.topbar-workshop-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: -0.01em;
}
.header-user-nav { display: flex; align-items: center; gap: 16px; }
.theme-header-switch {
  min-height: 40px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #151b27;
  color: #e5edf7;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.theme-header-switch:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 230, 118, 0.36);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26), 0 0 18px rgba(0, 230, 118, 0.08);
}
.theme-switch-track {
  width: 46px;
  height: 24px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0b0f17;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.theme-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.26);
  transform: translateX(0);
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.theme-switch-thumb i {
  width: 13px;
  height: 13px;
}
.theme-header-switch.is-dark .theme-switch-track {
  background: #111827;
  border-color: rgba(96, 165, 250, 0.28);
}
.theme-header-switch.is-dark .theme-switch-thumb {
  transform: translateX(22px);
  background: #1e293b;
  color: #facc15;
}
.theme-switch-label {
  font-size: 12px;
  font-weight: 800;
  color: inherit;
  white-space: nowrap;
}
.user-info { text-align: right; }
.user-name { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.user-status { font-size: 11px; color: var(--brand-green); font-weight: 600; }
.btn-logout { height: 36px; padding: 0 12px; border-radius: 8px; background: var(--theme-red-soft-bg); border: 1px solid var(--theme-red-soft-border); color: var(--theme-red); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-logout {
  min-height: 40px;
  background: #991b1b;
  border-color: #ef4444;
  color: #fff;
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.28);
}
.btn-logout:hover { background: #dc2626; color: #fff; transform: translateY(-1px); box-shadow: 0 14px 28px rgba(127, 29, 29, 0.34); }

/* ================= RESPONSIVE ================= */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.7); backdrop-filter: blur(2px); z-index: 1000; display: none; }
.sidebar-overlay.active { display: block; }

@media (max-width: 768px) {
    .sidebar { position: fixed; left: -250px; width: 250px !important; z-index: 1001; transition: left 0.3s; transform: none; display: block !important; }
    .sidebar.mobile-active { left: 0 !important; }
    .btn-sidebar-toggle { display: none; }
    .btn-mobile-menu { display: block; }
    .topbar-workshop-name { display: none; }
    .user-info { display: none; }
    .global-topbar { padding: 0 12px; height: 60px; }
    .header-user-nav { gap: 8px; }
    .theme-header-switch { min-height: 38px; padding: 0 8px; }
    .theme-switch-label { display: none; }

    body { display: block; overflow-y: auto; }
    .main-content { min-height: 100vh; overflow-y: visible !important; width: 100vw !important; }
    .hide-mobile { display: none !important; }

    /* FORÇAR CONTADORES LADO A LADO NO MOBILE */
    .container-contadores {
        display: flex !important;
        flex-direction: row !important;
        overflow: hidden !important;
        gap: 8px !important;
        padding: 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .container-contadores .kpi-card {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 8px 4px !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        border-bottom-width: 2px !important;
    }

    .container-contadores .kpi-label {
        display: block !important;
        font-size: 9px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        overflow: hidden !important;
        width: 100% !important;
        text-align: center !important;
        margin-top: 2px !important;
    }

    .container-contadores .kpi-value {
        font-size: 1.3rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        font-weight: 900 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .container-contadores .kpi-icon-wrapper {
        width: 24px !important;
        height: 24px !important;
        margin: 0 0 4px 0 !important;
    }
    .container-contadores .kpi-icon-wrapper i {
        width: 14px !important;
        height: 14px !important;
    }

    .dashboard-layout-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-summary-grid {
        grid-template-columns: 1fr !important;
    }

    .dashboard-container {
        padding: 14px;
        padding-bottom: 72px;
        gap: 16px;
    }

    .dashboard-table {
        min-width: 620px;
    }

    .journey-scroll {
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .workshop-journey {
        min-width: 940px;
    }
}

/* ================= CONTEÚDO PRINCIPAL ================= */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: calc(100vh - 70px);
    overflow-y: auto;
    width: 100%;
}

.topbar { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; border-bottom: 1px solid var(--border-color); background: var(--theme-bg-topbar); }
.topbar-titles h2 { font-size: 21px; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; }
.topbar-titles p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.footer-bar {
    padding: 12px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    background: var(--theme-bg-topbar);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* ================= COMPONENTES COMUNS ================= */
.panel-card { background: var(--theme-bg-panel); border: 1px solid var(--border-color); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; height: 100%; box-shadow: var(--theme-card-shadow); }
.panel-card-header { padding: 16px 20px; background: var(--theme-bg-panel-header); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.panel-card-header h3 { font-size: 15px; font-weight: 700; color: var(--text-bright); display: flex; align-items: center; gap: 8px; }
.panel-card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.row-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--theme-bg-row); border: 1px solid var(--border-color); border-radius: 6px; }

.badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; border: 1px solid rgba(255, 214, 0, 0.25); color: var(--brand-yellow); background: rgba(255, 214, 0, 0.05); }

/* ================= DASHBOARD LAYOUT ================= */
.dashboard-container {
  padding: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: calc(100vh - 70px);
  box-sizing: border-box;
}

.dashboard-layout-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: stretch;
}

.dashboard-footer-alerts {
  margin-top: auto;
  width: 100%;
  padding-top: 10px;
}

.dashboard-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.dashboard-alert-card {
  border-color: rgba(255, 214, 0, 0.24);
}

.dashboard-alert-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 214, 0, 0.18);
  border-radius: 6px;
  background: rgba(255, 214, 0, 0.04);
}

.dashboard-alert-title {
  color: var(--text-bright);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-alert-detail {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.journey-panel {
  position: relative;
  background: var(--theme-radar-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--theme-shadow-soft), inset 0 1px 0 rgba(255,255,255,0.03);
}

.journey-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--theme-radar-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-radar-grid) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.8), transparent 78%);
}

.radar-header {
  position: relative;
  z-index: 1;
  padding: 22px 24px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.radar-title-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.radar-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.radar-title-line i {
  width: 20px;
  height: 20px;
  color: var(--brand-green);
}

.radar-title-line h3 {
  color: var(--text-bright);
  font-size: 20px;
  font-weight: 900;
}

.radar-title-group p {
  color: var(--theme-text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.journey-scroll {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  padding: 28px 24px 34px;
}

.journey-scroll::-webkit-scrollbar {
  height: 5px;
}

.journey-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.36);
  border-radius: 999px;
}

.workshop-journey {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  align-items: start;
  gap: 0;
}

.workshop-journey::before {
  content: "";
  position: absolute;
  top: 42px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, rgba(0, 176, 255, 0.34), rgba(0, 230, 118, 0.42), rgba(255, 90, 0, 0.28));
  box-shadow: var(--theme-glow-green);
}

.journey-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.journey-icon {
  position: relative;
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 50%;
  background: var(--theme-radar-circle-bg);
  color: #93a2b8;
  box-shadow: var(--theme-radar-circle-shadow);
}

.journey-icon::before {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.journey-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  bottom: -11px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.42);
}

.journey-icon i {
  position: absolute;
  width: 36px;
  height: 36px;
  opacity: 0.18;
  z-index: 1;
  stroke-width: 1.8;
}

.journey-count {
  position: relative;
  z-index: 2;
  color: var(--text-bright);
  font-size: 32px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.stage-scheduled .journey-icon,
.stage-budget .journey-icon {
  color: var(--brand-blue);
  border-color: rgba(0, 176, 255, 0.24);
}

.stage-approved .journey-icon,
.stage-delivered .journey-icon {
  color: var(--brand-green);
  border-color: rgba(0, 230, 118, 0.25);
}

.stage-parts .journey-icon {
  color: var(--brand-orange);
  border-color: rgba(255, 90, 0, 0.22);
}

.journey-copy {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.journey-copy strong {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.25;
}

.journey-copy span {
  color: var(--theme-text-muted);
  font-size: 11px;
  font-weight: 500;
}

.journey-copy b {
  color: var(--theme-text-secondary);
  font-weight: 600;
}

.quick-actions-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--theme-bg-panel);
  box-shadow: var(--theme-shadow-soft);
}

.quick-actions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-actions-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.quick-actions-header h3 i {
  width: 16px;
  height: 16px;
  color: var(--brand-blue);
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.quick-action-button {
  min-height: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid rgba(34, 197, 94, 0.45);
  border-radius: 8px;
  background: #121a28;
  color: var(--text-bright);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255,255,255,0.04);
  transition: all 0.18s ease;
}

.quick-action-button i {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: #22c55e;
  opacity: 1;
}

.quick-action-button:hover {
  border-color: #22c55e;
  background: #162133;
  color: var(--text-bright);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.24), 0 0 18px rgba(34, 197, 94, 0.2);
}

@media (max-width: 1100px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-layout-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .quick-action-button {
    justify-content: flex-start;
  }
}

.dashboard-table-body {
  padding: 0;
}

.dashboard-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.dashboard-table th,
.dashboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-table th {
  color: var(--text-muted);
  background: #0e121b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-table td {
  color: var(--text-main);
  font-weight: 650;
}

.dashboard-table tr:last-child td {
  border-bottom: 0;
}

.dashboard-empty-cell,
.dashboard-empty-message {
  color: var(--text-muted) !important;
  text-align: center !important;
  font-size: 13px;
  font-weight: 600;
  padding: 22px !important;
}

.dashboard-agenda-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.dashboard-agenda-title {
  color: var(--brand-highlight);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-agenda-subtitle {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-agenda-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 76px;
}

/* ================= KPI GRID ================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.kpi-card {
    background-color: #0b111e;
    border: 1px solid #161f30;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.kpi-card-action {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #77859b;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    text-decoration: none;
}

.kpi-card-action:hover {
    color: var(--brand-green);
    border-color: rgba(0, 230, 118, 0.32);
    background: rgba(0, 230, 118, 0.07);
}

.kpi-card-action i {
    width: 14px;
    height: 14px;
}

.kpi-data { display: flex; flex-direction: column; }
.kpi-value { font-size: 24px; font-weight: 700; color: #ffffff; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: 14px; color: #64748b; margin: 0; }
.kpi-icon-wrapper { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; }
.kpi-icon-wrapper i { width: 20px; height: 20px; }

.card-total { border-bottom: 3px solid var(--brand-blue); }
.icon-total { background-color: rgba(0, 176, 255, 0.15); color: var(--brand-blue); }
.card-aguardando { border-bottom: 3px solid #f97316; }
.icon-aguardando { background-color: rgba(249, 115, 22, 0.15); color: #f97316; }
.card-confirmados { border-bottom: 3px solid #2563eb; }
.icon-confirmados { background-color: rgba(37, 99, 235, 0.15); color: #3b82f6; }
.card-concluidos { border-bottom: 3px solid #10b981; }
.icon-concluidos { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }

.agenda-row-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: rgba(0, 176, 255, 0.03); border: 1px solid var(--border-color); border-radius: 8px; gap: 12px; }
.agenda-time-display { font-size: 14px; color: var(--brand-blue); font-weight: 800; }
.service-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; background: rgba(255, 255, 255, 0.05); padding: 2px 6px; border-radius: 4px; color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }

/* FORMULÁRIOS */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 12px; font-weight: 700; color: #94a3b8; text-transform: uppercase; }
.form-control { background: #1a2333; border: 1px solid var(--border-color); border-radius: 6px; height: 38px; padding: 0 12px; color: #ffffff; font-size: 14px; font-family: inherit; width: 100%; transition: all 0.2s; }
.form-control:focus { border-color: var(--brand-orange); background: #1e293b; outline: none; box-shadow: 0 0 0 2px rgba(255, 90, 0, 0.1); }

/* MODAIS */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(3, 5, 8, 0.85); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; visibility: hidden; opacity: 0; transition: all 0.25s ease; }
.modal-overlay.active { visibility: visible; opacity: 1; }
.modal-card { background: #0b0e14; border: 1px solid var(--border-color); width: 100%; max-width: 480px; border-radius: 10px; overflow: hidden; }

.btn-modal-cancel,
.btn-secondary,
.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #172033;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.18s ease;
}

.btn-modal-cancel:hover,
.btn-secondary:hover,
.btn:hover {
    background: #22314a;
    border-color: #64748b;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.06);
}

.btn-primary,
.btn-tech {
    min-height: 44px;
    border: 1px solid #00c853;
    border-radius: 8px;
    background: #00a94f;
    color: #fff;
    box-shadow: 0 12px 26px rgba(0, 169, 79, 0.24);
}

.btn-primary:hover,
.btn-tech:hover {
    background: #00c853;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(0, 169, 79, 0.3);
}

body.theme-light .panel-card,
body.theme-light .modal-card,
body.theme-light .kpi-card,
body.theme-light .quick-actions-panel {
    background: #ffffff;
    border-color: #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body.theme-light .panel-card-header,
body.theme-light .dashboard-table th {
    background: #ffffff;
    border-bottom-color: #e5e7eb;
}

body.theme-light .dashboard-table td,
body.theme-light .kpi-value {
    color: #111827;
}

body.theme-light .dashboard-table th,
body.theme-light .dashboard-table td {
    border-bottom-color: #edf0f5;
}

body.theme-light .dashboard-table tr:hover td {
    background: #f8fafc;
}

body.theme-light .dashboard-empty-cell,
body.theme-light .dashboard-empty-message {
    color: #64748b !important;
}

body.theme-light .form-control {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #111827;
}

body.theme-light .form-control:focus {
    background: #ffffff;
    border-color: var(--brand-green);
    box-shadow: 0 0 0 3px rgba(0, 169, 79, 0.12);
}

body.theme-light .quick-action-button,
body.theme-light .btn-modal-cancel,
body.theme-light .btn-secondary,
body.theme-light .btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #111827;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

body.theme-light .quick-actions-panel {
    border-color: #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

body.theme-light .quick-actions-header h3 {
    color: #0f172a;
}

body.theme-light .quick-actions-header h3 i {
    color: #2563eb;
}

body.theme-light .quick-actions-grid {
    gap: 12px;
}

body.theme-light .quick-action-button {
    min-height: 44px;
    height: 44px;
    background: #ffffff;
    color: #111827;
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

body.theme-light .quick-action-button:hover {
    background: #f8fafc;
    color: #111827;
    border-color: #22c55e;
    filter: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12), 0 0 18px rgba(34, 197, 94, 0.2);
}

body.theme-light .quick-action-button i {
    color: #16a34a;
}

body.theme-light .btn-modal-cancel:hover,
body.theme-light .btn-secondary:hover,
body.theme-light .btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #111827;
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

body.theme-light .agenda-row-item {
    background: #ffffff;
    border-color: #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.055);
}

body.theme-light .service-tag {
    background: #eef2f7;
    border-color: #d8dee8;
    color: #64748b;
}

/* TOASTS */
.toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 9999; }
.toast { background: #0e121b; border: 1px solid var(--border-color); color: var(--text-bright); padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; transform: translateX(120%); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.toast.active { transform: translateX(0); }
