/* MIPS color theme
   Arquivo unico para ajustar a paleta visual do sistema.
   Tema escuro operacional conforme especificacao enviada.
*/

:root {
  --primary: #58a6ff;
  --primary-dark: #2f81f7;
  --primary-light: #8cc8ff;
  --primary-muted: rgba(88, 166, 255, 0.16);
  --primary-hover: #2f81f7;
  --primary-soft: rgba(88, 166, 255, 0.14);
  --primary-chart-fill: rgba(88, 166, 255, 0.16);

  --accent: #4fd1c5;
  --accent-dark: #2bb8aa;

  --bg: #132235;
  --bg-body: #132235;
  --bg-soft: #192c43;
  --bg-panel: #192c43;
  --card: #1f344d;
  --card-solid: #1f344d;
  --surface: #1f344d;
  --surface-2: #183047;

  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --border: rgba(255, 255, 255, 0.10);

  --text: #e7f1fb;
  --text-main: #e7f1fb;
  --muted: #a7b9cc;
  --text-muted: #a7b9cc;
  --muted-strong: #c8ddf6;

  --sidebar-bg: #10263d;
  --sidebar-bg-soft: #18334f;
  --sidebar-text: #e2edf8;
  --sidebar-muted: #9fb3c8;
  --sidebar-active: #58a6ff;
  --sidebar-hover: rgba(88, 166, 255, 0.14);

  --ok: #4fd1c5;
  --ok-bg: rgba(79, 209, 197, 0.16);
  --success: #4fd1c5;
  --warn: #f6c65b;
  --warn-bg: rgba(246, 198, 91, 0.16);
  --warning: #f6c65b;
  --danger: #ff6b6b;
  --danger-bg: rgba(255, 107, 107, 0.16);
  --info: #58a6ff;

  --field-bg: rgba(255, 255, 255, 0.07);
  --field-bg-hover: rgba(255, 255, 255, 0.10);
  --panel-dark: #0c1e35;
  --panel-dark-soft: #132942;

  --shadow-sm: 0 1px 3px rgba(5, 14, 24, 0.22);
  --shadow: 0 8px 22px rgba(5, 14, 24, 0.28);
  --shadow-md: 0 10px 24px rgba(5, 14, 24, 0.30);
  --shadow-lg: 0 14px 36px rgba(5, 14, 24, 0.34);
}

body {
  background: linear-gradient(180deg, #17283c 0%, #192c43 210px, #132235 100%) !important;
  color: var(--text) !important;
}

#view-mips,
.app-layout,
.main-shell,
.content {
  background: var(--bg) !important;
  color: var(--text) !important;
}

.topbar {
  background: rgba(12, 30, 53, 0.94) !important;
  border-bottom-color: var(--line) !important;
  box-shadow: 0 10px 22px rgba(5, 14, 24, 0.28) !important;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-soft) 100%) !important;
  border-right-color: var(--line) !important;
  box-shadow: 10px 0 24px rgba(5, 14, 24, 0.24) !important;
}

.sidebar-brand,
.login-submit,
.executive-panel,
.mips-header {
  background: linear-gradient(135deg, #245b89 0%, #1f7f75 100%) !important;
  border-color: #4b7fab !important;
  color: #ffffff !important;
}

.sidebar-brand {
  box-shadow: 0 8px 18px rgba(5, 14, 24, 0.22) !important;
}

.sidebar-brand h2,
.sidebar-brand small,
.executive-panel h3,
.executive-panel p,
.executive-meta span {
  color: #ffffff !important;
}

.sidebar-user,
.dash-user {
  background: var(--field-bg) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

.sidebar-user .su-name,
.nav-item {
  color: var(--sidebar-text) !important;
}

.nav-group-label,
.sidebar-user .su-role,
.sidebar-user label {
  color: var(--sidebar-muted) !important;
}

.nav-item:hover {
  background: var(--sidebar-hover) !important;
  border-color: rgba(88, 166, 255, 0.22) !important;
  color: #eef7ff !important;
}

.nav-item.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #ffffff !important;
  box-shadow: 0 6px 16px rgba(88, 166, 255, 0.24) !important;
}

.mips-topnav,
.mips-topnav-submenu,
.card,
.mips-card,
.mips-panel,
.metric-card,
.mini-kpi,
.insight-card,
.command-bar,
.table-wrap,
.assistant-message,
.assistant-source,
.kpi,
.mips-kpi {
  background: var(--card) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-sm) !important;
}

.card:hover,
.metric-card:hover,
.mini-kpi:hover,
.insight-card:hover {
  box-shadow: 0 8px 20px rgba(5, 14, 24, 0.28) !important;
}

.card-header,
.mips-card-header,
.mips-panel-head,
.assistant-form,
.command-bar {
  background: #203851 !important;
  border-color: var(--line) !important;
}

.drawer-panel,
.manage-modal {
  background: var(--panel-dark) !important;
  border-color: var(--line-strong) !important;
  color: var(--text) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.50) !important;
}

.drawer-head,
.drawer-foot,
.manage-modal-head {
  background: var(--panel-dark-soft) !important;
  border-color: var(--line) !important;
}

.page-head h3,
.dashboard-title h3,
.topbar-title,
.card-header h4,
.drawer-head h4,
.manage-modal-head h4,
.collapsible-filter-title strong,
.production-calendar-side h5,
.metric-card strong,
.mini-kpi strong,
.kpi strong,
.batch-bar strong {
  color: #edf6ff !important;
}

.page-head p,
.dashboard-title p,
.topbar-sub,
.small,
.field label,
.modal-field label,
.filter-field label,
.dash-field label,
.metric-card small,
.metric-card span,
.mini-kpi small,
.production-calendar-side p,
.production-calendar-legend,
.production-calendar-day small,
.pagination-bar,
.table-footer-bar,
.manage-modal-body p,
.modal-note {
  color: var(--muted) !important;
}

input,
select,
textarea,
.toolbar input,
.toolbar select,
.dash-field input,
.dash-field select,
.filter-field input,
.filter-field select,
.sidebar-user select,
.field input,
.field select,
.field textarea,
.modal-field input,
.modal-field textarea {
  background: var(--field-bg) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

input::placeholder,
textarea::placeholder {
  color: #7fa8cc !important;
}

#mips-login-screen input,
#mips-login-screen select,
#mips-login-screen textarea,
.login-input {
  background: #ffffff !important;
  border-color: #9cc9ff !important;
  color: #172033 !important;
}

#mips-login-screen input::placeholder,
#mips-login-screen textarea::placeholder,
.login-input::placeholder {
  color: #8fa2bc !important;
  opacity: 1 !important;
}

#mips-login-screen input:focus,
#mips-login-screen select:focus,
#mips-login-screen textarea:focus,
.login-input:focus {
  background: #ffffff !important;
  border-color: #58a6ff !important;
  color: #172033 !important;
  box-shadow: 0 0 0 4px rgba(88, 166, 255, 0.22) !important;
}

input:focus,
select:focus,
textarea:focus,
.toolbar input:focus,
.toolbar select:focus,
.dash-field input:focus,
.dash-field select:focus,
.filter-field input:focus,
.filter-field select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  background: var(--field-bg-hover) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.16) !important;
}

option {
  background: #213b57 !important;
  color: var(--text) !important;
}

.btn {
  background: var(--field-bg) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}

.btn:hover,
.btn-ghost:hover,
.mips-topnav-item:hover,
.mips-topnav-subitem:hover,
.rec-tab:hover:not(.active),
.ts-ac-item:hover {
  background: rgba(88, 166, 255, 0.14) !important;
  border-color: rgba(88, 166, 255, 0.28) !important;
  color: #eef7ff !important;
}

.btn-primary,
.quick-periods .btn.active,
.mips-tab.active,
.approval-actions .btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary-dark) !important;
  color: #ffffff !important;
}

.btn-primary:hover,
.quick-periods .btn.active:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
}

.btn-soft,
.filter-chip,
.mips-cat,
.criterio-item.sel,
.municipio-badge {
  background: var(--primary-soft) !important;
  border-color: rgba(88, 166, 255, 0.28) !important;
  color: #c5ddff !important;
}

.filter-chip.muted,
.quality-pill,
.pagination-bar,
.table-footer-bar,
.batch-bar {
  background: var(--field-bg) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

.btn-danger,
.approval-actions .btn-danger {
  background: var(--danger) !important;
  border-color: #d34f4f !important;
  color: #ffffff !important;
}

.btn-success {
  background: #279f8f !important;
  border-color: #218779 !important;
  color: #ffffff !important;
}

.btn-warning {
  background: #d99d24 !important;
  border-color: #b98318 !important;
  color: #172033 !important;
}

.assistant-messages {
  background: #1a2f47 !important;
}

.assistant-message.user {
  background: rgba(88, 166, 255, 0.18) !important;
  border-color: rgba(88, 166, 255, 0.34) !important;
}

.assistant-message.assistant {
  background: var(--field-bg) !important;
}

.executive-meta span {
  background: rgba(255,255,255,0.14) !important;
  border-color: rgba(255,255,255,0.24) !important;
}

.kpi {
  border-left: 3px solid var(--primary) !important;
}

.kpi.kpi-ok {
  border-left-color: var(--ok) !important;
}

.kpi.kpi-warn {
  border-left-color: var(--warn) !important;
}

.kpi.kpi-danger {
  border-left-color: var(--danger) !important;
}

.metric-card {
  background: linear-gradient(180deg, #1f344d 0%, #1b3149 100%) !important;
}

.metric-card.warn {
  background: linear-gradient(180deg, #1f344d 0%, rgba(246, 198, 91, 0.12) 100%) !important;
}

.metric-card.ok {
  background: linear-gradient(180deg, #1f344d 0%, rgba(79, 209, 197, 0.12) 100%) !important;
}

.metric-card.danger {
  background: linear-gradient(180deg, #1f344d 0%, rgba(255, 107, 107, 0.12) 100%) !important;
}

.metric-card::after {
  background: var(--primary) !important;
}

.metric-card.warn::after {
  background: var(--warn) !important;
}

.metric-card.ok::after {
  background: var(--ok) !important;
}

.metric-card.danger::after {
  background: var(--danger) !important;
}

thead th,
.mips-table th,
.ts-table-wrap th {
  background: #203851 !important;
  border-color: var(--line) !important;
  color: #c5ddff !important;
}

tbody td,
.mips-table td,
.ts-table-wrap td {
  background: #243d59 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text) !important;
}

tbody tr:nth-child(even) td {
  background: #1b3149 !important;
}

tbody tr:hover,
tbody tr:hover td,
.mips-table tr:hover td,
.ts-table-wrap tr:hover td {
  background: #263f5c !important;
}

.badge-aprovado,
.mips-badge-ok,
.ts-alert-success,
.daily-status-aprovado {
  background: var(--ok-bg) !important;
  border-color: rgba(79, 209, 197, 0.34) !important;
  color: #66e3d8 !important;
}

.badge-aguardando,
.mips-badge-warn,
.ts-alert-warn,
.daily-status-aguardando,
.mips-alert-row.warn {
  background: var(--warn-bg) !important;
  border-color: rgba(246, 198, 91, 0.34) !important;
  color: #ffd773 !important;
}

.badge-reprovado,
.mips-badge-err,
.ts-alert-error,
.daily-status-reprovado {
  background: var(--danger-bg) !important;
  border-color: rgba(255, 107, 107, 0.34) !important;
  color: #ff8a8a !important;
}

.daily-status-sem_producao {
  background: rgba(127, 168, 204, 0.16) !important;
  color: #a7c7e6 !important;
}

.badge-aprovado .badge-dot,
.production-calendar-status.ok {
  background: var(--ok) !important;
}

.badge-aguardando .badge-dot,
.production-calendar-status.warn {
  background: var(--warn) !important;
}

.badge-reprovado .badge-dot,
.production-calendar-status.danger {
  background: var(--danger) !important;
}

.status-row-aprovado td:first-child {
  box-shadow: inset 3px 0 0 var(--ok) !important;
}

.status-row-aguardando td:first-child {
  box-shadow: inset 3px 0 0 var(--warn) !important;
}

.status-row-reprovado td:first-child {
  box-shadow: inset 3px 0 0 var(--danger) !important;
}

.production-calendar-day,
.production-calendar-blank,
.daily-summary-item,
.app-layout [style*="background:#f8fafc"],
.app-layout [style*="background: #f8fafc"],
.app-layout [style*="background:#fff"],
.app-layout [style*="background: #fff"],
.app-layout [style*="background:#ffffff"],
.app-layout [style*="background: #ffffff"] {
  background: var(--field-bg) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

.daily-row-missing td {
  background: rgba(246, 198, 91, 0.08) !important;
}

.production-calendar-day.is-today {
  background: rgba(88, 166, 255, 0.14) !important;
}

.production-calendar-day.status-ok {
  background: rgba(79, 209, 197, 0.08) !important;
  border-color: rgba(79, 209, 197, 0.30) !important;
}

.production-calendar-day.status-warn {
  background: rgba(246, 198, 91, 0.08) !important;
  border-color: rgba(246, 198, 91, 0.30) !important;
}

.production-calendar-day.status-danger {
  background: rgba(255, 107, 107, 0.08) !important;
  border-color: rgba(255, 107, 107, 0.30) !important;
}

.production-calendar-side {
  border-color: var(--line) !important;
}

.link-cell,
.mips-card-title,
.ts-stat-val,
.production-calendar-total {
  color: var(--primary) !important;
}

code {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #d0e8ff !important;
}

.insight-card strong,
.daily-summary-item strong,
.production-calendar-day strong {
  color: #edf6ff !important;
}

.insight-card span,
.production-calendar-weekday,
.production-calendar-day.status-empty,
.filter-field label,
.toolbar label,
.daily-summary-item span,
.daily-summary-item small {
  color: var(--muted-strong) !important;
}

.main-shell [style*="color:#1f355e"],
.main-shell [style*="color: #1f355e"],
.main-shell [style*="color:#132448"],
.main-shell [style*="color: #132448"],
.main-shell [style*="color:#10243f"],
.main-shell [style*="color: #10243f"],
.main-shell [style*="color:#344054"],
.main-shell [style*="color: #344054"],
.main-shell [style*="color:#475569"],
.main-shell [style*="color: #475569"],
.main-shell [style*="color:#52657d"],
.main-shell [style*="color: #52657d"],
.main-shell [style*="color:#5f7098"],
.main-shell [style*="color: #5f7098"],
.main-shell [style*="color:#64748b"],
.main-shell [style*="color: #64748b"],
.main-shell [style*="color:#667085"],
.main-shell [style*="color: #667085"],
.main-shell [style*="color:#94a3b8"],
.main-shell [style*="color: #94a3b8"],
.content [style*="color:#1f355e"],
.content [style*="color: #1f355e"],
.content [style*="color:#132448"],
.content [style*="color: #132448"],
.content [style*="color:#10243f"],
.content [style*="color: #10243f"],
.content [style*="color:#344054"],
.content [style*="color: #344054"],
.content [style*="color:#475569"],
.content [style*="color: #475569"],
.content [style*="color:#52657d"],
.content [style*="color: #52657d"],
.content [style*="color:#5f7098"],
.content [style*="color: #5f7098"],
.content [style*="color:#64748b"],
.content [style*="color: #64748b"],
.content [style*="color:#667085"],
.content [style*="color: #667085"],
.content [style*="color:#94a3b8"],
.content [style*="color: #94a3b8"],
.app-layout [style*="color:#1f355e"],
.app-layout [style*="color: #1f355e"],
.app-layout [style*="color:#132448"],
.app-layout [style*="color: #132448"],
.app-layout [style*="color:#10243f"],
.app-layout [style*="color: #10243f"],
.app-layout [style*="color:#64748b"],
.app-layout [style*="color: #64748b"],
.app-layout [style*="color:#344054"],
.app-layout [style*="color: #344054"],
.app-layout [style*="color:#475569"],
.app-layout [style*="color: #475569"],
.app-layout [style*="color:#5f7098"],
.app-layout [style*="color: #5f7098"],
.app-layout [style*="color:#52657d"],
.app-layout [style*="color: #52657d"],
.app-layout [style*="color:#667085"],
.app-layout [style*="color: #667085"],
.app-layout [style*="color:#94a3b8"],
.app-layout [style*="color: #94a3b8"] {
  color: var(--muted-strong) !important;
}
