/* ============================================
   SISTEMA DE GESTÃO — TEMA AZUL (Notika Style)
   ============================================ */

:root {
  --blue-primary:   #1a73e8;
  --blue-dark:      #1557b0;
  --blue-darker:    #0d47a1;
  --blue-medium:    #4285f4;
  --blue-light:     #74a9f7;
  --blue-lightest:  #e8f0fe;

  --sidebar-bg:     #0f1e35;
  --sidebar-hover:  #1a2e4a;
  --sidebar-active: #1a73e8;
  --sidebar-label:  #64748b;
  --sidebar-text:   #cbd5e1;
  --sidebar-width:  220px;

  --topbar-height:  64px;
  --topbar-bg:      #ffffff;
  --topbar-shadow:  0 1px 3px rgba(0,0,0,.08);

  --body-bg:        #f0f4f8;
  --card-bg:        #ffffff;
  --card-radius:    12px;
  --card-shadow:    0 2px 8px rgba(0,0,0,.06);
  --card-border:    1px solid #e2e8f0;

  --text-primary:   #1e293b;
  --text-secondary: #64748b;
  --text-muted:     #6b7280;

  --font:           'Inter', sans-serif;

  /* ── Semantic color tokens ───────────────────── */
  --danger:           #dc2626;
  --danger-vivid:     #ef4444;
  --danger-bg:        #fef2f2;
  --danger-bg-soft:   #fee2e2;
  --danger-border:    #fecaca;

  --success:          #16a34a;
  --success-bg:       #f0fdf4;
  --success-bg-soft:  #dcfce7;
  --success-border:   #bbf7d0;

  --warning:          #ca8a04;
  --warning-bg:       #fef9c3;

  /* ── Spacing scale (4px grid) ──────────────── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
}

/* ─── RESET / BASE ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: var(--font); font-size: 14px; color: var(--text-primary); background: var(--body-bg); }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ─── SKIP LINK (acessibilidade — teclado) ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  z-index: 10000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--blue-primary);
  color: #fff;
  border-radius: 0 0 8px 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top .1s;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ─── LAYOUT ────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease, width .3s ease;
  overflow: hidden;
}

.main-wrapper {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .3s ease;
}

/* ─── SIDEBAR BRAND ─────────────────────────── */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo {
  height: 64px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}

.brand-text {
  display: block;
  color: rgba(255,255,255,.80);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  text-align: center;
  line-height: 1;
}

/* ─── SIDEBAR NAV ───────────────────────────── */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-list { padding: 0 8px; }

.nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-label);
  padding: 16px 12px 6px;
}

.nav-item { margin-bottom: 2px; }

.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .2s, color .2s;
  cursor: pointer;
  position: relative;
}

.nav-item .nav-link i:first-child {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
}

.nav-item .nav-link span { flex: 1; }

.nav-item .nav-link .arrow {
  font-size: 11px;
  transition: transform .25s;
  margin-left: auto;
  width: auto !important;
}

.nav-item .nav-link:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.nav-item.active .nav-link,
.nav-item .nav-link.active {
  background: var(--sidebar-active);
  color: #ffffff;
}

/* Badge count on nav */
.badge-count {
  background: var(--blue-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  line-height: 1.4;
}

.nav-item.active .badge-count { background: rgba(255,255,255,.25); }

/* Link externo na sidebar (ex: APP Log) */
.nav-link-external span {
  font-style: italic;
  opacity: .85;
  letter-spacing: .02em;
}
.nav-link-external i:first-child {
  opacity: .75;
}

/* Submenu */
.submenu {
  display: none;
  margin: 4px 0 4px 28px;
  padding: 4px 0;
  border-left: 2px solid rgba(255,255,255,.08);
}

.submenu.open { display: block; }

.submenu li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--sidebar-text);
  font-size: 13px;
  border-radius: 6px;
  transition: background .2s, color .2s;
}

.submenu li a i { font-size: 10px; color: var(--sidebar-label); }

.submenu li a:hover { background: var(--sidebar-hover); color: #ffffff; }

.submenu li.active a {
  background: rgba(26, 115, 232, .2);
  color: #ffffff;
  font-weight: 600;
}

.nav-item.open > .nav-link { color: #ffffff; }
.nav-item.open > .nav-link .arrow { transform: rotate(90deg); }

/* ─── SIDEBAR FOOTER ────────────────────────── */
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.user-info { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.user-details { display: flex; flex-direction: column; overflow: hidden; }
.user-name { color: #ffffff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: var(--sidebar-label); font-size: 11px; }

/* ─── TOPBAR ────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: var(--sp-4); }

.topbar-brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.3px;
  white-space: nowrap;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -.4px;
  white-space: nowrap;
}

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: background .2s, color .2s;
}
.sidebar-toggle:hover { background: var(--blue-lightest); color: var(--blue-primary); }


.topbar-right { display: flex; align-items: center; gap: 6px; }

.topbar-icon {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.topbar-icon:hover { background: var(--blue-lightest); color: var(--blue-primary); }

.dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid #fff;
}
.dot-blue { background: var(--blue-primary); }
.dot-red  { background: var(--danger-vivid); }

.topbar-divider {
  width: 1px; height: 32px;
  background: #e2e8f0;
  margin: 0 var(--sp-2);
}

.topbar-user {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background .2s;
}
.topbar-user:hover { background: var(--blue-lightest); }

.topbar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--blue-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 14px;
  overflow: hidden;
}
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.topbar-user-info { display: flex; flex-direction: column; line-height: 1.3; }
.topbar-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user-role { font-size: 11px; color: var(--text-muted); }

/* ─── TOPBAR DROPDOWN ───────────────────────── */
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 160px;
  z-index: 500;
  overflow: hidden;
}
.topbar-dropdown-item {
  width: 100%;
  padding: 11px 16px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  text-align: left;
  transition: background .15s;
  color: var(--text-secondary);
}
.topbar-dropdown-item:hover { background: #f8fafc; }
.topbar-dropdown-danger { color: var(--danger-vivid); }
.topbar-dropdown-danger:hover { background: var(--danger-bg); }
.topbar-dropdown-divider { height: 1px; background: #e2e8f0; margin: 4px 0; }

/* ─── CENTRAL DE NOTIFICAÇÕES ───────────────── */
.sg-notif-wrapper { position: relative; }

.sg-notif-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 16px;
  transition: background .15s, color .15s;
}
.sg-notif-btn:hover { background: #f1f5f9; color: #1e293b; }
.sg-notif-btn.has-notif { color: #3b82f6; }

.sg-notif-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  background: var(--danger-vivid);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
}

.sg-notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  width: 320px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(15,23,42,.13);
  z-index: 9999;
  overflow: hidden;
}

.sg-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.sg-notif-empty {
  padding: 36px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}
.sg-notif-empty i { font-size: 26px; color: #e2e8f0; }

.sg-notif-item {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid #f8fafc;
  align-items: flex-start;
  transition: background .1s;
}
.sg-notif-item:last-child { border-bottom: none; }
.sg-notif-item:hover { background: #fafbfc; }

.sg-notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.sg-notif-body { flex: 1; min-width: 0; }
.sg-notif-title { font-size: 12px; font-weight: 700; color: #1e293b; margin: 0 0 3px; }
.sg-notif-msg   { font-size: 12px; color: #64748b; margin: 0 0 6px; line-height: 1.45; }
.sg-notif-link  { font-size: 11px; color: #f97316; font-weight: 600; text-decoration: none; }
.sg-notif-link:hover { text-decoration: underline; }

.sg-notif-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: #cbd5e1;
  padding: 2px 4px;
  font-size: 13px;
  flex-shrink: 0;
  line-height: 1;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.sg-notif-dismiss:hover { color: #64748b; background: #f1f5f9; }

/* ─── CONTENT AREA ──────────────────────────── */
.content-area {
  flex: 1;
  padding: var(--sp-7) var(--sp-7) 40px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-7);
}

.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.page-sub   { font-size: 13px; color: var(--text-muted); margin: 0; }

.breadcrumb { margin-bottom: 0; font-size: 12px; }
.breadcrumb-item a { color: var(--blue-primary); }
.breadcrumb-item.active { color: var(--text-muted); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ─── STAT CARDS ────────────────────────────── */
.stat-card {
  border-radius: var(--card-radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  overflow: hidden;
  color: #fff;
  transition: transform .2s, box-shadow .2s;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 20px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
}

.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.15); }

.stat-card-blue   { background: linear-gradient(135deg, #1a73e8, #1557b0); }
.stat-card-indigo { background: linear-gradient(135deg, #4f46e5, #3730a3); }
.stat-card-cyan   { background: linear-gradient(135deg, #0288d1, #01579b); }
.stat-card-sky    { background: linear-gradient(135deg, #0ea5e9, #0369a1); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}

.stat-info h3 { font-size: 26px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.stat-info p  { font-size: 13px; opacity: .85; font-weight: 500; }

.stat-change {
  font-size: 12px;
  font-weight: 600;
  opacity: .9;
}
.stat-change.positive i { transform: rotate(0deg); }
.stat-change.negative { opacity: .75; }

/* ─── CARD WIDGET ───────────────────────────── */
.card-widget {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  border: var(--card-border);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.widget-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
}

.widget-header h5 { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.widget-header p  { font-size: 12px; color: var(--text-muted); margin: 0; }

.widget-body { padding: var(--sp-5); }

.widget-actions { display: flex; gap: 4px; }

.btn-widget {
  border: 1px solid #e2e8f0;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  transition: all .2s;
}
.btn-widget.active,
.btn-widget:hover {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: #fff;
}

.btn-see-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font);
  white-space: nowrap;
}
.btn-see-all:hover { color: var(--blue-dark); }

.critico-area-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Donut legend */
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.legend-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
}
.legend-item strong { margin-left: auto; color: var(--text-primary); font-weight: 600; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ─── PERFORMANCE BARS ──────────────────────── */
.perf-item { margin-bottom: 18px; }
.perf-item:last-child { margin-bottom: 0; }
.perf-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-secondary);
  font-weight: 500; margin-bottom: 6px;
}
.perf-bar { height: 6px; border-radius: 4px; background: #f1f5f9; }
.perf-bar .progress-bar { border-radius: 4px; transition: width .6s ease; }

/* ─── TABLE WIDGET ──────────────────────────── */
.table-widget {
  width: 100%;
  border-collapse: collapse;
}
.table-widget th {
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}
.table-widget td {
  padding: 13px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid #f8fafc;
}
.table-widget tbody tr:last-child td { border-bottom: none; }
.table-widget tbody tr:hover td { background: #f8fafc; }

.order-id { font-weight: 600; color: var(--blue-primary); font-size: 12px; }

.badge-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}
.badge-success { background: var(--success-bg-soft); color: var(--success); }
.badge-warning { background: var(--warning-bg);     color: var(--warning); }
.badge-info    { background: var(--blue-lightest);  color: var(--blue-primary); }
.badge-danger  { background: var(--danger-bg-soft); color: var(--danger); }

/* ─── ACTIVITY FEED ─────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: var(--sp-4); }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}

.activity-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.bg-blue-soft   { background: #e8f0fe; color: var(--blue-primary); }
.bg-indigo-soft { background: #ede9fe; color: #7c3aed; }
.bg-cyan-soft   { background: #e0f2fe; color: #0288d1; }
.bg-sky-soft    { background: #f0f9ff; color: #0ea5e9; }

.activity-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.activity-text strong { color: var(--text-primary); font-weight: 600; }

.activity-time {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── TODO LIST ─────────────────────────────── */
.todo-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  transition: border-color .2s;
}
.todo-item:hover { border-color: #e2e8f0; }

.todo-check { position: relative; width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; }
.todo-check input { position: absolute; opacity: 0; cursor: pointer; }
.checkmark {
  display: block;
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 2px solid #cbd5e1;
  background: #fff;
  transition: all .2s;
}
.todo-check input:checked ~ .checkmark {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
}
.todo-check input:checked ~ .checkmark::after {
  content: '';
  position: absolute;
  top: 3px; left: 6px;
  width: 5px; height: 9px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}

.todo-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  transition: color .2s;
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.todo-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.tag-blue   { background: #e8f0fe; color: var(--blue-primary); }
.tag-indigo { background: #ede9fe; color: #7c3aed; }
.tag-cyan   { background: #e0f2fe; color: #0288d1; }
.tag-sky    { background: #f0f9ff; color: #0ea5e9; }

/* ─── SIDEBAR COLLAPSED ─────────────────────── */
body.sidebar-collapsed .sidebar {
  width: 68px;
}
body.sidebar-collapsed .main-wrapper {
  margin-left: 68px;
}
body.sidebar-collapsed .sidebar-brand { padding: 16px 0; }
body.sidebar-collapsed .sidebar-brand .sidebar-logo { height: 30px; max-width: 44px; }
body.sidebar-collapsed .sidebar-brand .brand-text { display: none !important; }
body.sidebar-collapsed .nav-label { opacity: 0; pointer-events: none; }
body.sidebar-collapsed .nav-item .nav-link span,
body.sidebar-collapsed .nav-item .nav-link .arrow,
body.sidebar-collapsed .badge-count { display: none; }
body.sidebar-collapsed .nav-item .nav-link { justify-content: center; padding: 10px 0; }
body.sidebar-collapsed .nav-item .nav-link i:first-child { width: auto; font-size: 17px; }
body.sidebar-collapsed .submenu { display: none !important; }
body.sidebar-collapsed .user-details,
body.sidebar-collapsed .sidebar-footer .user-info { display: none; }

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
  body.sidebar-collapsed .main-wrapper { margin-left: 0; }

}

@media (max-width: 575px) {
  .content-area    { padding: 16px; }
  .page-header     { flex-direction: column; gap: 8px; }
  .topbar-user-info { display: none; }

  /* KPI stat-cards */
  .stat-info h3 { font-size: 20px; }
  .stat-info p  { font-size: 12px; }
  .stat-icon    { width: 40px; height: 40px; font-size: 17px; }

  /* Modal */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-panel   { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-header  { padding: 16px 16px 12px; }
  .modal-header h4 { font-size: 15px; }

  /* rg-stats-row compacto */
  .rg-stats-row  { gap: 0; }
  .rg-stat       { padding: 12px 10px; }
  .rg-stat-num   { font-size: 20px; }
  .rg-stat-label { font-size: 10px; }

  /* Toast */
  .sg-toast { right: 12px; left: 12px; max-width: none; }

}

/* ─── MODAL FOTO DE PERFIL ──────────────────── */
.foto-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.foto-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}

.foto-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid #f1f5f9;
}
.foto-modal-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.foto-modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
  padding: 4px 7px; border-radius: 6px; line-height: 1;
  transition: color .15s, background .15s;
}
.foto-modal-close:hover { color: var(--text-primary); background: #f1f5f9; }

.foto-modal-body {
  padding: var(--sp-6) var(--sp-5) var(--sp-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}

.foto-preview-wrap {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--blue-primary);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 42px;
  overflow: hidden;
  border: 3px solid #e2e8f0;
  flex-shrink: 0;
}
.foto-preview-wrap img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 50%;
}

.foto-modal-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
  margin: 0;
}

.foto-modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.btn-foto-upload {
  padding: 9px 16px;
  background: var(--blue-lightest);
  color: var(--blue-primary);
  border: 1.5px solid #bfdbfe;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, border-color .2s;
}
.btn-foto-upload:hover { background: #dbeafe; border-color: #93c5fd; }

.btn-foto-remover {
  padding: 9px 14px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--danger-vivid);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-foto-remover:hover { background: var(--danger-bg); border-color: var(--danger-border); }

.btn-foto-salvar {
  padding: 9px 20px;
  background: var(--blue-primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background .2s;
  margin-left: auto;
}
.btn-foto-salvar:hover { background: var(--blue-dark); }
.btn-foto-salvar:disabled { opacity: .6; cursor: default; }

/* ─── STATUS BADGE (planos de ação) ─────────── */
.pa-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* ─── NO DATA BANNER (compartilhado) ────────── */
.no-data-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.no-data-icon { font-size: 36px; color: #d97706; flex-shrink: 0; }
.no-data-banner h4 { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.no-data-banner p  { color: var(--text-secondary); font-size: 13px; margin: 0; }

/* ─── TOAST NOTIFICATIONS ───────────────────── */
.sg-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .25s, transform .25s;
  max-width: 340px;
  line-height: 1.4;
}
.sg-toast.sg-toast-show    { opacity: 1; transform: translateY(0); }
.sg-toast-error   { background: var(--danger-bg);   color: var(--danger);   border: 1px solid var(--danger-border); }
.sg-toast-success { background: var(--success-bg);  color: var(--success);  border: 1px solid var(--success-border); }
.sg-toast-info    { background: #eff6ff; color: #1a73e8; border: 1px solid #bfdbfe; }
.sg-toast-warning { background: #fffbeb; color: #92400e; border: 1px solid #fcd34d; }
.sg-toast-danger  { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* ─── MODAL (compartilhado) ─────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 53, .55);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}

.modal-panel {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.modal-header h4 { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.modal-header p  { font-size: 13px; color: var(--text-muted); margin: 0; }

.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.modal-close:hover { background: var(--danger-bg-soft); color: var(--danger); }

/* ─── FILTROS (compartilhado) ───────────────── */
.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.filter-select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-primary);
  background: #fff;
  outline: none;
  transition: border-color .2s;
}
.filter-select:focus { border-color: var(--blue-primary); }

/* ─── BOTÕES COMPARTILHADOS ─────────────────── */
.btn-upload {
  display: inline-flex;
  align-items: center;
  background: var(--blue-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-upload:hover  { background: var(--blue-dark); transform: translateY(-1px); }
.btn-upload:active { transform: translateY(0); }

.btn-new-import {
  background: none;
  border: 2px dashed #cbd5e1;
  border-radius: 10px;
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font);
  cursor: pointer;
  transition: all .2s;
}
.btn-new-import:hover { border-color: var(--blue-primary); color: var(--blue-primary); background: var(--blue-lightest); }

.btn-ns-cancel {
  padding: 9px 18px;
  background: none;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background .15s;
}
.btn-ns-cancel:hover { background: #f8fafc; }

/* ─── FILTRO DE MÊS (pills + select compartilhado) ── */
.mes-tabs { /* container neutro */ }

.mes-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.mes-tab {
  padding: 5px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
  line-height: 1.6;
}
.mes-tab:hover {
  border-color: var(--blue-primary);
  color: var(--blue-primary);
  background: var(--blue-lightest);
}
.mes-tab.active {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
  color: #fff;
}

/* Select visível apenas em mobile */
.mes-select-mobile { display: none; }

@media (max-width: 768px) {
  .mes-pills { display: none; }
  .mes-select-mobile {
    display: block;
    width: 100%;
    max-width: 260px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 13px;
    font-family: var(--font);
    color: var(--text-primary);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
  }
  .mes-select-mobile:focus { border-color: var(--blue-primary); }
}

/* ─── SIDEBAR PLACEHOLDER — previne flash antes do JS ── */
#sidebar-placeholder {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
}
@media (max-width: 991px) {
  #sidebar-placeholder { display: none; }
}

/* ─── TOPBAR PLACEHOLDER — reserva altura antes do JS ── */
#topbar-placeholder {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  flex-shrink: 0;
}

/* ─── BARRA DE PROGRESSO DE CARREGAMENTO ── */
#sg-loading-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: var(--blue-primary);
  z-index: 99999;
  width: 0;
  animation: sgBarGrow 10s cubic-bezier(0.1, 0.6, 0.2, 1) forwards;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
#sg-loading-bar.sg-bar-done {
  width: 100% !important;
  animation: none;
  opacity: 0;
}
@keyframes sgBarGrow {
  0%   { width: 0%;  }
  20%  { width: 42%; }
  50%  { width: 68%; }
  80%  { width: 84%; }
  100% { width: 92%; }
}

/* ─── ANIMACAO DE ENTRADA DA PAGINA ── */
@keyframes sgPageIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.content-area {
  animation: sgPageIn 0.2s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .content-area { animation: none; }
  #sg-loading-bar { animation: none; width: 70%; }
}
