﻿/* ============================================================
   PABLO ERP - Shared Stylesheet
   Fonts: DM Sans (UI) + DM Mono (figures)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  --sidebar-bg: #0f1117;
  --sidebar-w: 260px;
  --topbar-h: 56px;
  --accent: #2563eb;
  --accent2: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --page-bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --card-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
}

/* --- Dark theme (navy palette, inspired by admin.html) --- */
[data-theme="dark"] {
  --page-bg:      #0d1117;
  --card-bg:      #161b22;
  --border:       #21262d;
  --text-primary: #cdd6f4;
  --text-secondary: #8b949e;
  --text-muted:   #484f58;
  --card-shadow:  0 1px 6px rgba(0,0,0,.5), 0 0 0 1px #21262d;
}
[data-theme="dark"] .erp-topbar       { background: #161b22; border-color: #21262d; }
[data-theme="dark"] .emodal           { background: #161b22; }
[data-theme="dark"] .emodal-header,
[data-theme="dark"] .emodal-footer    { border-color: #21262d; }
[data-theme="dark"] .erp-dropdown     { background: #161b22; border-color: #21262d; }
[data-theme="dark"] .eform-control,
[data-theme="dark"] .eform-select     { background: #0d1117; color: var(--text-primary); border-color: #21262d; }
[data-theme="dark"] .eform-control::placeholder { color: var(--text-muted); }
[data-theme="dark"] .topbar-search input { background: #0d1117; color: var(--text-primary); border-color: #21262d; }
[data-theme="dark"] .topbar-search input::placeholder { color: var(--text-muted); }
[data-theme="dark"] .etable thead th  { background: #0d1117; border-color: #21262d; }
[data-theme="dark"] .etable tbody td  { border-color: #21262d; }
[data-theme="dark"] .etable tbody tr:hover td { background: rgba(255,255,255,.03); }
[data-theme="dark"] .drawer           { background: #161b22; }
[data-theme="dark"] .kpi-card         { background: var(--card-bg); border: 1px solid #21262d; }
[data-theme="dark"] .ecard            { border: 1px solid #21262d; }
[data-theme="dark"] .ecard-header     { border-color: #21262d; }
[data-theme="dark"] .notif-item:hover,
[data-theme="dark"] .profile-menu-item:hover { background: rgba(255,255,255,.04); }
[data-theme="dark"] .ebtn-secondary   { background: #21262d; border-color: #30363d; color: var(--text-primary); }
[data-theme="dark"] .ebtn-secondary:hover { background: #30363d; }
[data-theme="dark"] .ebtn-ghost       { color: var(--text-secondary); }
[data-theme="dark"] .ebtn-ghost:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .kanban-card      { box-shadow: 0 1px 4px rgba(0,0,0,.4); }
[data-theme="dark"] .kanban-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.5); border-color: var(--accent); }
[data-theme="dark"] .kanban-col-body  { background: #080c12; }
[data-theme="dark"] .kpi-icon         { background: rgba(255,255,255,.07) !important; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'DM Sans', system-ui, sans-serif; background: var(--page-bg); color: var(--text-primary); font-size: 14px; }

/* === LAYOUT SHELL === */
.erp-shell { display: flex; height: 100vh; overflow: hidden; }

/* === SIDEBAR === */
#erp-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .25s cubic-bezier(.4,0,.2,1);
  z-index: 100;
}
#erp-sidebar.collapsed { width: 60px; }
#erp-sidebar.collapsed .nav-item span,
#erp-sidebar.collapsed .nav-group-label,
#erp-sidebar.collapsed .nav-badge,
#erp-sidebar.collapsed .sidebar-brand-text,
#erp-sidebar.collapsed .sidebar-footer-text { display: none; }
#erp-sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
#erp-sidebar.collapsed .nav-item i { margin: 0; font-size: 1.2rem; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  min-height: 64px;
  flex-shrink: 0;
}
.sidebar-logo {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem; color: #fff;
  flex-shrink: 0;
}
.sidebar-brand-text { flex: 1; min-width: 0; }
.sidebar-brand-text strong { display: block; color: #f1f5f9; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.sidebar-brand-text small { color: var(--text-muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.sidebar-toggle-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; padding: 4px;
  border-radius: 4px; transition: color .15s;
}
.sidebar-toggle-btn:hover { color: #f1f5f9; }

.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 0 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.nav-group { margin-bottom: 4px; }
.nav-group-label {
  font-size: .65rem; font-weight: 600; letter-spacing: .08em;
  color: #4b5563; padding: 10px 14px 4px;
  text-transform: uppercase; white-space: nowrap;
  cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  user-select: none; transition: color .15s;
}
.nav-group-label:hover { color: #9ca3af; }
.ng-toggle { font-size: .6rem; color: #374151; transition: transform .2s ease; flex-shrink: 0; }
.nav-group.ng-closed .ng-toggle { transform: rotate(-90deg); }
.nav-group-items { overflow: hidden; max-height: 600px; transition: max-height .22s ease; }
.nav-group.ng-closed .nav-group-items { max-height: 0; }
.nav-item.coming-soon { opacity: .45; cursor: default; }
#erp-sidebar.collapsed .ng-toggle,
#erp-sidebar.collapsed .nav-group-label { display: none; }
#erp-sidebar.collapsed .nav-group-items { max-height: 600px !important; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px; color: #94a3b8;
  text-decoration: none; font-size: .83rem; font-weight: 500;
  transition: background .15s, color .15s;
  position: relative; border-left: 3px solid transparent;
  white-space: nowrap; overflow: hidden;
}
.nav-item i { font-size: 1rem; flex-shrink: 0; width: 18px; text-align: center; }
.nav-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.nav-item.active { background: rgba(37,99,235,.15); color: var(--accent); border-left-color: var(--accent); }
.nav-item.active i { color: var(--accent); }
.nav-badge {
  font-size: .6rem; font-weight: 700; color: #fff;
  padding: 2px 6px; border-radius: 20px; flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.sidebar-footer-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1d4ed8; color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-footer-text { flex: 1; min-width: 0; }
.sidebar-footer-text strong { display: block; color: #e2e8f0; font-size: .78rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer-text a { color: var(--text-muted); font-size: .7rem; text-decoration: none; }
.sidebar-footer-text a:hover { color: var(--danger); }

/* === MAIN AREA === */
.erp-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* === TOPBAR === */
.erp-topbar {
  height: var(--topbar-h); background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; flex-shrink: 0; z-index: 50;
}
.erp-breadcrumb { display: flex; align-items: center; gap: 0; font-size: .82rem; }
.bc-lnk { color: var(--text-secondary); text-decoration: none; }
.bc-lnk:hover { color: var(--accent); }
.bc-sep { color: var(--text-muted); margin: 0 6px; }
.bc-cur { color: var(--text-primary); font-weight: 600; }
.topbar-search {
  flex: 1; max-width: 380px; position: relative;
}
.topbar-search input {
  width: 100%; padding: 7px 12px 7px 34px;
  background: var(--page-bg); border: 1px solid var(--border);
  border-radius: 6px; font-size: .83rem; color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.topbar-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.topbar-search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: .85rem; }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-icon-btn {
  width: 34px; height: 34px; border-radius: 8px; border: none;
  background: none; cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; transition: background .15s, color .15s;
  position: relative;
}
.topbar-icon-btn:hover { background: var(--page-bg); color: var(--text-primary); }
.topbar-notif-badge {
  position: absolute; top: 3px; right: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--danger); color: #fff; font-size: .6rem;
  font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.topbar-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 8px; cursor: pointer;
  transition: background .15s; border: none; background: none;
}
.topbar-user:hover { background: var(--page-bg); }
.topbar-user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700;
}
.topbar-user-name { font-size: .82rem; font-weight: 500; color: var(--text-primary); }
.topbar-user-chevron { color: var(--text-muted); font-size: .75rem; }

/* === TOPBAR DROPDOWNS === */
.erp-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 600; min-width: 280px; overflow: hidden;
  animation: dropIn .15s ease;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-6px) } to { opacity:1; transform:none } }
.notif-header {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-header-title { font-size: .8rem; font-weight: 700; color: var(--text-primary); }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 16px; cursor: pointer; transition: background .12s;
  text-decoration: none;
}
.notif-item:hover { background: var(--page-bg); }
.notif-item + .notif-item { border-top: 1px solid var(--border); }
.notif-icon {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: .85rem;
}
.notif-icon.danger { background: #fef2f2; color: var(--danger); }
.notif-icon.warn   { background: #fffbeb; color: var(--warn); }
.notif-icon.info   { background: #eff6ff; color: var(--accent); }
.notif-text { font-size: .8rem; color: var(--text-primary); line-height: 1.4; }
.notif-empty { padding: 20px 16px; text-align: center; color: var(--text-muted); font-size: .82rem; }
.notif-footer { padding: 10px 16px; border-top: 1px solid var(--border); text-align: center; }
.notif-footer a { font-size: .78rem; color: var(--accent); text-decoration: none; }
.profile-menu-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); }
.profile-menu-name { font-size: .85rem; font-weight: 700; color: var(--text-primary); }
.profile-menu-role { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; cursor: pointer; font-size: .83rem;
  color: var(--text-primary); text-decoration: none; transition: background .12s;
}
.profile-menu-item:hover { background: var(--page-bg); }
.profile-menu-item i { font-size: .95rem; color: var(--text-secondary); }

/* === CONTENT AREA === */
.erp-content { flex: 1; overflow-y: auto; padding: 24px; scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.erp-content::-webkit-scrollbar { width: 6px; }
.erp-content::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* === PAGE HEADER === */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: .8rem; color: var(--text-secondary); margin-top: 2px; }
.section-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 12px; }

/* === CARDS === */
.ecard { background: var(--card-bg); border-radius: 10px; box-shadow: var(--card-shadow); border: 1px solid var(--border); }
.ecard-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.ecard-title { font-size: .82rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-secondary); }
.ecard-body { padding: 18px; }
.ecard:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06); transition: all .2s; }

/* === KPI CARDS === */
.kpi-card { background: var(--card-bg); border-radius: 10px; box-shadow: var(--card-shadow); border: 1px solid var(--border); padding: 20px; transition: transform .2s, box-shadow .2s; cursor: default; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }
.kpi-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 14px; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); font-family: 'DM Mono', monospace; line-height: 1; margin-bottom: 4px; }
.kpi-label { font-size: .75rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 8px; }
.kpi-delta { font-size: .75rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-delta.up { color: var(--accent2); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-muted); }

/* === TABLES === */
.etable-wrap { overflow-x: auto; }
.etable { width: 100%; border-collapse: collapse; }
.etable th { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.etable td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: .83rem; color: var(--text-primary); vertical-align: middle; }
.etable tbody tr { transition: background .1s; }
.etable tbody tr:hover { background: #f8fafc; }
.etable tbody tr:hover .muted { color: var(--text-secondary); }
.etable tbody tr:last-child td { border-bottom: none; }
.etable .mono { font-family: 'DM Mono', monospace; font-size: .8rem; }
.etable .val { font-family: 'DM Mono', monospace; font-weight: 600; font-size: .85rem; }
.etable .muted { color: var(--text-secondary); font-size: .78rem; }

/* === BADGES === */
.ebadge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: .68rem; font-weight: 600; white-space: nowrap; }

/* === BUTTONS === */
.ebtn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-size: .82rem; font-weight: 500; cursor: pointer; transition: all .15s; border: 1px solid transparent; font-family: 'DM Sans', sans-serif; text-decoration: none; white-space: nowrap; }
.ebtn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.ebtn-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }
.ebtn-secondary { background: #fff; color: var(--text-primary); border-color: var(--border); }
.ebtn-secondary:hover { background: var(--page-bg); }
.ebtn-success { background: var(--accent2); color: #fff; border-color: var(--accent2); }
.ebtn-success:hover { background: #059669; border-color: #059669; }
.ebtn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.ebtn-danger:hover { background: #dc2626; border-color: #dc2626; }
.ebtn-ghost { background: none; color: var(--text-secondary); border-color: transparent; }
.ebtn-ghost:hover { background: var(--page-bg); color: var(--text-primary); }
.ebtn-sm { padding: 4px 10px; font-size: .75rem; gap: 4px; }
.ebtn-lg { padding: 10px 20px; font-size: .9rem; }

/* === FORMS === */
.eform-group { margin-bottom: 16px; }
.eform-label { display: block; font-size: .78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 5px; }
.eform-control {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: .83rem; color: var(--text-primary);
  background: #fff; font-family: 'DM Sans', sans-serif;
  transition: border-color .15s, box-shadow .15s;
}
.eform-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.eform-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394a3b8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }

/* === MODALS === */
.emodal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.emodal-overlay.open { opacity: 1; pointer-events: all; }
.emodal { background: #fff; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.2); width: 100%; max-width: 520px; max-height: 90vh; display: flex; flex-direction: column; transform: translateY(-20px) scale(.97); transition: transform .2s; }
.emodal-overlay.open .emodal { transform: none; }
.emodal-lg { max-width: 760px; }
.emodal-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.emodal-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.emodal-title { font-size: .95rem; font-weight: 700; color: var(--text-primary); flex: 1; }
.emodal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; padding: 4px; border-radius: 4px; transition: color .15s; }
.emodal-close:hover { color: var(--text-primary); }
.emodal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.emodal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* === DRAWER === */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 800; opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 480px; background: #fff; box-shadow: -8px 0 40px rgba(0,0,0,.15); z-index: 900; transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-close { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.2rem; margin-top: 2px; }
.drawer-close:hover { color: var(--text-primary); }

/* === KANBAN === */
.kanban-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: calc(100vh - 180px); scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
.kanban-col { min-width: 256px; width: 256px; flex-shrink: 0; display: flex; flex-direction: column; }
.kanban-col-header { padding: 10px 14px; border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: space-between; }
.kanban-col-title { font-size: .78rem; font-weight: 700; color: #fff; letter-spacing: .02em; }
.kanban-col-count { background: rgba(255,255,255,.25); color: #fff; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.kanban-col-body { background: var(--page-bg); border-radius: 0 0 8px 8px; padding: 8px; flex: 1; overflow-y: auto; max-height: calc(100vh - 240px); scrollbar-width: thin; }
.kanban-card { background: var(--card-bg); border-radius: 8px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.07); border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.1); border-color: var(--accent); }
.kanban-card.error { border-left: 3px solid var(--danger); }

/* === PROGRESS STEPS === */
.progress-steps { display: flex; align-items: center; gap: 0; margin-bottom: 20px; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; border: 2px solid var(--border); background: var(--card-bg); color: var(--text-primary); transition: all .2s; }
.step-dot.done { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.step-dot.current { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px rgba(37,99,235,.15); }
.step-line { flex: 1; height: 2px; background: var(--border); }
.step-line.done { background: var(--accent2); }
.step-label { font-size: .6rem; color: var(--text-secondary); margin-top: 4px; text-align: center; white-space: nowrap; font-weight: 500; }
.steps-wrap { overflow-x: auto; }

/* === DRE TABLE === */
.dre-table { width: 100%; border-collapse: collapse; }
.dre-table td, .dre-table th { padding: 9px 16px; border-bottom: 1px solid #f1f5f9; font-size: .82rem; }
.dre-table th { font-size: .7rem; font-weight: 600; color: var(--text-secondary); letter-spacing: .05em; text-transform: uppercase; text-align: right; background: #f8fafc; }
.dre-table th:first-child { text-align: left; }
.dre-table td:not(:first-child) { text-align: right; font-family: 'DM Mono', monospace; font-size: .8rem; }
.dre-row-total { background: #f8fafc; }
.dre-row-total td { font-weight: 700; border-top: 1px solid var(--border); }
.dre-pct { color: var(--accent); font-size: .75rem; }
.dre-row-margin td { font-size: .75rem; color: var(--accent); padding-top: 4px; padding-bottom: 8px; background: #eff6ff; }

/* === FLUXO TABLE === */
.fluxo-row-entrada { background: #f0fdf4; }
.fluxo-row-saida { background: #fef2f2; }

/* === TAGS === */
.tag-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* === EMPTY STATE === */
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state-icon { font-size: 2.5rem; color: var(--border); margin-bottom: 12px; }
.empty-state h3 { font-size: .95rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: .82rem; color: var(--text-muted); margin-bottom: 16px; }

/* === STATUS PULSE === */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.status-dot.green { background: var(--accent2); animation: pulse-dot 2s ease-in-out infinite; }
.status-dot.yellow { background: var(--warn); }
.status-dot.red { background: var(--danger); }
.status-dot.gray { background: var(--text-muted); }
@keyframes pulse-dot { 0%,100%{box-shadow:0 0 0 0 rgba(16,185,129,.4)} 50%{box-shadow:0 0 0 5px rgba(16,185,129,0)} }

/* === NF PROCESSANDO PULSE === */
.processing-pulse { animation: pulseBadge 1.5s ease-in-out infinite; }
@keyframes pulseBadge { 0%,100%{opacity:1} 50%{opacity:.5} }

/* === INVENTORY ALERTS === */
@keyframes criticalPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
.critical-badge { animation: criticalPulse 2s ease-in-out infinite; }

/* === SPINNER === */
.spinner { width: 20px; height: 20px; border: 3px solid #e2e8f0; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === PDV === */
.pdv-total { font-size: 2.5rem; font-weight: 700; color: var(--accent); font-family: 'DM Mono', monospace; }

/* === TIMELINE === */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-dot { position: absolute; left: -24px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--accent); top: 2px; }
.timeline-date { font-size: .7rem; color: var(--text-muted); margin-bottom: 2px; }
.timeline-text { font-size: .82rem; color: var(--text-primary); }

/* === QUICK ACTIONS === */
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 12px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--card-shadow); cursor: pointer; transition: all .2s; text-decoration: none; font-size: .75rem; font-weight: 600; color: var(--text-secondary); text-align: center; }
.quick-action:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
[data-theme="dark"] .quick-action { border-color: #21262d; }
[data-theme="dark"] .quick-action-icon { background: rgba(255,255,255,.07) !important; }
.quick-action-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* === RESPONSIVE === */
@media (max-width: 991px) {
  #erp-sidebar { position: fixed; left: -260px; top: 0; height: 100vh; transition: left .25s; z-index: 200; }
  #erp-sidebar.mobile-open { left: 0; }
  .erp-content { padding: 16px; }
}
@media (max-width: 767px) {
  .kpi-card .kpi-value { font-size: 1.4rem; }
  .kanban-board { padding-bottom: 80px; }
  .drawer { width: 100%; }
  .etable th, .etable td { padding: 8px 10px; font-size: .78rem; }
}

/* === UTILITY === */
.gap-8 { gap: 8px !important; }
.text-mono { font-family: 'DM Mono', monospace; }
.text-success { color: var(--accent2) !important; }
.text-danger { color: var(--danger) !important; }
.text-warn { color: var(--warn) !important; }
.text-muted-color { color: var(--text-muted); }
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fs-sm { font-size: .78rem; }
.fs-xs { font-size: .7rem; }
