/* AltisBanking — Design System (Refined Gold/Navy) */
/* Based on FidemBankAppInterface design system */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ========================================
   TOKENS
   ======================================== */

:root {
  --primary-color: #FCD535;
  --primary-hover: #f0b90b;
  --primary-light: rgba(252, 213, 53, 0.08);
  --primary-glow: rgba(252, 213, 53, 0.15);

  --success-color: #0ecb81;
  --success-bg: rgba(14, 203, 129, 0.1);
  --error-color: #ff6b7d;
  --error-bg: rgba(255, 107, 125, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --info-color: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.1);
  --purple-color: #A78BFA;
  --purple-bg: rgba(167, 139, 250, 0.1);

  --bg-primary: #0b0e11;
  --bg-secondary: #1e2329;
  --bg-tertiary: #2b3139;
  --bg-card: #1e2329;
  --bg-hover: rgba(252, 213, 53, 0.05);

  --text-primary: #eaecef;
  --text-secondary: #9aa4b1;
  --text-muted: #8b9aab;
  --text-bright: #ffffff;

  --border-color: #2b3139;
  --border-light: rgba(43, 49, 57, 0.7);
  --border-accent: rgba(252, 213, 53, 0.3);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.5);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 1px rgba(252, 213, 53, 0.2);

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  --sidebar-width: 220px;
  --sidebar-collapsed-width: 52px;
  --navbar-height: 56px;

  --transition: all 0.15s ease;
  --transition-fast: all 0.1s ease;
  --transition-slow: all 0.25s ease;
}

/* ========================================
   RESET
   ======================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Keyboard focus — visible ring on every interactive element */
:focus-visible {
  outline: 2px solid var(--info-color);
  outline-offset: 2px;
}

.form-control:focus-visible {
  outline: none; /* handled by border + shadow-glow below */
}


/* ========================================
   ICONS (SVG data-uri system)
   ======================================== */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: brightness(0) saturate(100%) invert(63%) sepia(9%) saturate(629%) hue-rotate(176deg) brightness(92%) contrast(88%);
}
.icon-sm  { width: 16px; height: 16px; }
.icon-md  { width: 20px; height: 20px; }
.icon-lg  { width: 24px; height: 24px; }
.icon-xl  { width: 32px; height: 32px; }
.icon-primary { filter: brightness(0) saturate(100%) invert(90%) sepia(60%) saturate(700%) hue-rotate(2deg) brightness(102%) contrast(102%); }
.icon-success { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.icon-warning { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.icon-error   { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }
.icon-light   { filter: brightness(0) saturate(100%) invert(97%) sepia(3%) saturate(387%) hue-rotate(175deg) brightness(103%) contrast(92%); }
.icon-muted   { filter: brightness(0) saturate(100%) invert(38%) sepia(12%) saturate(629%) hue-rotate(176deg) brightness(80%) contrast(88%); }

/* SVG Icons */
.icon-dashboard    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z'/%3E%3C/svg%3E"); }
.icon-operations   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z'/%3E%3C/svg%3E"); }
.icon-portfolio    { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 12a2.25 2.25 0 00-2.25-2.25H15a3 3 0 11-6 0H5.25A2.25 2.25 0 003 12m18 0v6a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 9m18 0V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v3'/%3E%3C/svg%3E"); }
.icon-rules        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z'/%3E%3C/svg%3E"); }
.icon-settings     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 010 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 010-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E"); }
.icon-users        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z'/%3E%3C/svg%3E"); }
.icon-key          { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z'/%3E%3C/svg%3E"); }
.icon-check        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5'/%3E%3C/svg%3E"); }
.icon-alert        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126zM12 15.75h.007v.008H12v-.008z'/%3E%3C/svg%3E"); }
.icon-plus         { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 4.5v15m7.5-7.5h-15'/%3E%3C/svg%3E"); }
.icon-document     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z'/%3E%3C/svg%3E"); }
.icon-bank         { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 21v-8.25M15.75 21v-8.25M8.25 21v-8.25M3 9l9-6 9 6m-1.5 12V10.332A48.36 48.36 0 0012 9.75c-2.551 0-5.056.2-7.5.582V21M3 21h18M12 6.75h.008v.008H12V6.75z'/%3E%3C/svg%3E"); }
.icon-calendar     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5'/%3E%3C/svg%3E"); }
.icon-refresh      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99'/%3E%3C/svg%3E"); }
.icon-upload       { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5'/%3E%3C/svg%3E"); }
.icon-download     { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3'/%3E%3C/svg%3E"); }
.icon-search       { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z'/%3E%3C/svg%3E"); }
.icon-x           { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M6 18L18 6M6 6l12 12'/%3E%3C/svg%3E"); }
.icon-pencil      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125'/%3E%3C/svg%3E"); }
.icon-trash       { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0'/%3E%3C/svg%3E"); }
.icon-eye         { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3C/svg%3E"); }
.icon-code        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M17.25 6.75L22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3l-4.5 16.5'/%3E%3C/svg%3E"); }
.icon-info        { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z'/%3E%3C/svg%3E"); }
.icon-logout      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15M12 9l-3 3m0 0l3 3m-3-3h12.75'/%3E%3C/svg%3E"); }
.icon-pix         { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5'/%3E%3C/svg%3E"); }
.icon-shield      { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z'/%3E%3C/svg%3E"); }
.icon-chart-bar   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='1.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z'/%3E%3C/svg%3E"); }

.sidebar-icon {
  display: inline-flex;
  width: 18px; height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.6;
  transition: var(--transition-fast);
  filter: brightness(0) saturate(100%) invert(63%) sepia(9%) saturate(629%) hue-rotate(176deg) brightness(92%) contrast(88%);
}
.sidebar a:hover .sidebar-icon,
.sidebar a.active .sidebar-icon {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(90%) sepia(60%) saturate(700%) hue-rotate(2deg) brightness(102%) contrast(102%);
}

/* ========================================
   NAVBAR
   ======================================== */

.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0 24px;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.nav-brand-logo {
  width: 32px; height: 32px;
  background: var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--bg-primary);
  letter-spacing: 1px;
}

.nav-brand-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.nav-user-chip .user-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success-color);
}

.nav-user-chip span {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.nav-env-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 3px 8px;
  background: rgba(252,213,53,0.12);
  color: var(--primary-color);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  position: fixed;
  top: var(--navbar-height);
  left: 0; bottom: 0;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  z-index: 900;
  transition: var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-title {
  font-size: 0.5875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 8px 16px 4px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.sidebar a:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-left-color: rgba(252,213,53,0.3);
}

.sidebar a.active {
  background: var(--primary-light);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.sidebar-logout {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding: 4px 0;
}

/* Collapsed */
body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
body.sidebar-collapsed .sidebar .sidebar-title { font-size: 0; padding: 2px 0; }
body.sidebar-collapsed .sidebar a {
  justify-content: center; padding: 8px 0; gap: 0;
}
body.sidebar-collapsed .sidebar a .sidebar-label { display: none; }
body.sidebar-collapsed .sidebar a .sidebar-icon { width: 20px; height: 20px; }
body.sidebar-collapsed .sidebar .sidebar-section { padding: 4px 0; }

/* ========================================
   CONTENT AREA
   ======================================== */

.content {
  margin-left: var(--sidebar-width);
  margin-top: var(--navbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--navbar-height));
  position: relative;
  z-index: 1;
  transition: margin-left var(--transition-slow);
}

body.sidebar-collapsed .content { margin-left: var(--sidebar-collapsed-width); }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.3px;
}

.page-header-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-header-actions { display: flex; align-items: center; gap: 8px; }

/* ========================================
   CARDS
   ======================================== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

.card:hover { border-color: var(--border-accent); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.stat-card:hover { border-color: var(--border-accent); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.success { background: var(--success-bg); }
.stat-icon.warning { background: var(--warning-bg); }
.stat-icon.error   { background: var(--error-bg); }
.stat-icon.primary { background: var(--primary-light); }
.stat-icon .icon { width: 22px; height: 22px; }
.stat-icon.success .icon { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.stat-icon.warning .icon { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.stat-icon.error .icon   { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }
.stat-icon.primary .icon { filter: brightness(0) saturate(100%) invert(90%) sepia(60%) saturate(700%) hue-rotate(2deg) brightness(102%) contrast(102%); }

.stat-content {}
.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.stat-delta {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
}
.stat-delta.up   { color: var(--success-color); }
.stat-delta.down { color: var(--error-color); }

/* ========================================
   TABLES
   ======================================== */

.table-wrap {
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

thead th {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-hover); }

tbody td {
  padding: 11px 12px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted); }
.td-mono  { font-family: 'Monaco', 'Consolas', monospace; font-size: 0.75rem; }
.td-num   { font-variant-numeric: tabular-nums; text-align: right; }

/* ========================================
   BADGES
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.badge-success { background: var(--success-bg); color: var(--success-color); }
.badge-error   { background: var(--error-bg);   color: var(--error-color); }
.badge-warning { background: var(--warning-bg); color: var(--warning-color); }
.badge-info    { background: var(--info-bg);    color: var(--info-color); }
.badge-primary { background: var(--primary-light); color: var(--primary-color); }
.badge-neutral { background: var(--bg-tertiary);   color: var(--text-secondary); }
.badge-purple  { background: var(--purple-bg);  color: var(--purple-color); }

.badge-dot::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn .icon { width: 16px; height: 16px; }

.btn-primary {
  background: var(--primary-color);
  color: #181a20;
  border-color: var(--primary-color);
}
.btn-primary .icon { filter: brightness(0) saturate(100%) invert(8%) sepia(20%) saturate(1000%) hue-rotate(176deg) brightness(95%) contrast(95%); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border-color);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-accent); color: var(--text-primary); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger {
  background: var(--error-bg);
  color: var(--error-color);
  border-color: rgba(255,107,125,0.25);
}
.btn-danger:hover { background: rgba(255,107,125,0.15); }

.btn-success {
  background: var(--success-bg);
  color: var(--success-color);
  border-color: rgba(14,203,129,0.2);
}
.btn-success:hover { background: rgba(14,203,129,0.15); }

.btn-sm { padding: 4px 10px; font-size: 0.75rem; min-height: 24px; min-width: 24px; }
.btn-lg { padding: 10px 20px; font-size: 0.9375rem; }

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========================================
   FORMS
   ======================================== */

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required { color: var(--error-color); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control { cursor: pointer; }

.form-row {
  display: grid;
  gap: 12px;
}
.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-row-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.form-hint {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toggle PF/PJ */
.toggle-group {
  display: inline-flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  background: transparent;
}

.toggle-btn.active {
  background: var(--primary-color);
  color: #181a20;
}

/* ========================================
   STEPPER
   ======================================== */

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 0;
  overflow-x: auto;
  margin-bottom: 24px;
}

.stepper::-webkit-scrollbar { height: 0; }

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
  min-width: 90px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 16px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 1px;
  background: var(--border-color);
  z-index: 0;
}

.step.done:not(:last-child)::after { background: var(--primary-color); opacity: 0.4; }
.step.active:not(:last-child)::after { background: var(--border-color); }

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
  transition: var(--transition);
}

.step.done .step-circle {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.step.active .step-circle {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #181a20;
  font-weight: 700;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
  font-weight: 500;
}

.step.done .step-label  { color: var(--text-secondary); }
.step.active .step-label { color: var(--primary-color); font-weight: 600; }

/* ========================================
   SCORE BAR
   ======================================== */

.score-bar-wrap {
  margin-top: 8px;
}

.score-bar-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.score-bar-fill.low   { background: var(--error-color); }
.score-bar-fill.mid   { background: var(--warning-color); }
.score-bar-fill.high  { background: var(--success-color); }

.score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   BUREAU CARDS
   ======================================== */

.bureau-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 16px 0;
}

.bureau-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.bureau-logo {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.bureau-info .bureau-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bureau-info .bureau-score {
  font-size: 1.125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ========================================
   MOTOR DE REGRAS
   ======================================== */

.rule-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-fast);
}

.rule-row:hover { background: var(--bg-hover); }
.rule-row:last-child { border-bottom: none; }

.rule-icon {
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rule-icon.pass   { background: var(--success-bg); }
.rule-icon.fail   { background: var(--error-bg); }
.rule-icon.warn   { background: var(--warning-bg); }
.rule-icon.script { background: var(--purple-bg); }
.rule-icon.pass .icon   { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.rule-icon.fail .icon   { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }
.rule-icon.warn .icon   { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.rule-icon.script .icon { filter: brightness(0) saturate(100%) invert(60%) sepia(20%) saturate(700%) hue-rotate(220deg) brightness(110%) contrast(90%); }

.rule-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.rule-condition {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-family: 'Monaco', 'Consolas', monospace;
}

.rule-found {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}

.rule-action { min-width: 100px; text-align: right; }

/* ========================================
   DOCUMENT LIST
   ======================================== */

.doc-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.doc-item:last-child { border-bottom: none; }

.doc-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-info { flex: 1; min-width: 0; }

.doc-name {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.doc-actions { display: flex; align-items: center; gap: 6px; }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--border-accent);
  background: var(--primary-light);
}

.dropzone-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.dropzone-link { color: var(--primary-color); }

/* ========================================
   CCB PREVIEW
   ======================================== */

.ccb-preview {
  background: #fff;
  border-radius: var(--radius-md);
  padding: 32px 40px;
  color: #1a1a2e;
  font-size: 0.8125rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  min-height: 400px;
}

.ccb-preview h2 {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  color: #181a20;
  text-transform: uppercase;
}

.ccb-preview .ccb-sub {
  text-align: center;
  font-size: 0.75rem;
  color: #546A83;
  margin-bottom: 24px;
}

.ccb-preview .ccb-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 16px;
}

.ccb-preview .ccb-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8B9DB7;
  margin-bottom: 8px;
}

.ccb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.ccb-field-label {
  font-size: 0.6875rem;
  color: #8B9DB7;
  font-weight: 500;
}

.ccb-field-value {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1a1a2e;
}

/* ========================================
   CHECKLIST
   ======================================== */

.checklist { list-style: none; }

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.checklist-item:last-child { border-bottom: none; }

.check-circle {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-circle.ok      { background: var(--success-bg); }
.check-circle.pending { background: var(--bg-tertiary); border: 1.5px dashed var(--border-color); }
.check-circle.warn    { background: var(--warning-bg); }
.check-circle.fail    { background: var(--error-bg); }

.check-circle.ok .icon    { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.check-circle.warn .icon  { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.check-circle.fail .icon  { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }

.checklist-label { font-size: 0.8125rem; font-weight: 500; color: var(--text-primary); flex: 1; }
.checklist-label.muted { color: var(--text-muted); }

/* ========================================
   PARCELAS / RÉGUA DE COBRANÇA
   ======================================== */

.regua-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0;
  position: relative;
  padding: 16px 0;
}

.regua-line {
  position: absolute;
  top: 30px;
  left: 20px;
  right: 20px;
  height: 2px;
  background: var(--border-color);
  z-index: 0;
}

.regua-node {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

.regua-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.regua-dot.done { background: var(--primary-color); }
.regua-dot.done .icon { filter: brightness(0) saturate(100%) invert(8%) sepia(20%) saturate(1000%) hue-rotate(176deg) brightness(95%) contrast(95%); }

.regua-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.regua-channel {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

/* ========================================
   ALERT BANNER
   ======================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  font-size: 0.8125rem;
}

.alert-success { background: var(--success-bg); border: 1px solid rgba(14,203,129,0.2); color: var(--success-color); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.25);  color: var(--warning-color); }
.alert-error   { background: var(--error-bg);   border: 1px solid rgba(255,107,125,0.25); color: var(--error-color); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(96,165,250,0.2);  color: var(--info-color); }
.alert-primary { background: var(--primary-light); border: 1px solid var(--border-accent); color: var(--primary-color); }

.alert .icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-success .icon { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.alert-warning .icon { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.alert-error .icon   { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }
.alert-info .icon    { filter: brightness(0) saturate(100%) invert(64%) sepia(45%) saturate(1500%) hue-rotate(194deg) brightness(102%) contrast(96%); }
.alert-primary .icon { filter: brightness(0) saturate(100%) invert(90%) sepia(60%) saturate(700%) hue-rotate(2deg) brightness(102%) contrast(102%); }

.alert-text strong { display: block; font-weight: 600; margin-bottom: 2px; }
.alert-text p { margin: 0; opacity: 0.85; }

/* ========================================
   MODAL
   ======================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(8px);
  transition: transform 0.2s ease;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
}

.modal-body { padding: 16px 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 20px;
}

/* ========================================
   SIDEBAR TOGGLE BUTTON
   ======================================== */

.sidebar-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: calc(var(--sidebar-width) - 14px);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 950;
  transition: left var(--transition-slow), var(--transition);
}

.sidebar-toggle-btn:hover { border-color: var(--border-accent); }
body.sidebar-collapsed .sidebar-toggle-btn { left: calc(var(--sidebar-collapsed-width) - 14px); }

.sidebar-toggle-btn svg {
  width: 14px; height: 14px;
  stroke: var(--text-muted);
  transition: transform var(--transition-slow);
}

body.sidebar-collapsed .sidebar-toggle-btn svg { transform: rotate(180deg); }

/* ========================================
   SYNTAX HIGHLIGHT MOCK
   ======================================== */

.code-editor {
  background: #0d1117;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: #c9d1d9;
}

.code-keyword { color: #ff7b72; }
.code-type    { color: #79c0ff; }
.code-string  { color: #a5d6ff; }
.code-method  { color: #d2a8ff; }
.code-comment { color: #8b949e; }
.code-number  { color: #f2cc60; }

/* ========================================
   MISC
   ======================================== */

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.label-section {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {}

.detail-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.detail-value.mono {
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.8125rem;
}

.detail-value.big {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}

/* Count pill (sidebar badge + filter segment counts) */
.sidebar-count,
.count-pill {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sidebar-count { margin-left: auto; }

.toggle-btn.active .sidebar-count,
.toggle-btn.active .count-pill {
  background: rgba(0, 0, 0, 0.2);
  color: #181a20;
}

.tab-btn.active .count-pill {
  background: var(--primary-light);
  color: var(--primary-color);
}

/* ========================================
   FILTER BAR (toolbar above grids/kanbans)
   Ordem canônica: toggle-group → selects → .view-toggle
   ======================================== */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .form-control {
  width: auto;
  font-size: 0.8125rem;
}

.view-toggle {
  display: flex;
  gap: 2px;
  margin-left: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-btn { padding: 5px 10px; font-size: 0.75rem; }
.view-btn.active {
  background: var(--primary-color);
  color: var(--bg-primary);
  border-color: var(--primary-color);
}

.toggle-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.toggle-dot.error   { background: var(--error-color); }
.toggle-dot.warning { background: var(--warning-color); }

/* Approval chips */
.approvers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.approver-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.75rem;
}

.approver-chip.done   { border-color: rgba(14,203,129,0.3); background: var(--success-bg); color: var(--success-color); }
.approver-chip.pending { color: var(--text-muted); }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Amortization table small */
.amort-table { font-size: 0.75rem; }
.amort-table thead th { font-size: 0.625rem; padding: 8px 10px; }
.amort-table tbody td { padding: 8px 10px; }

/* Highlight row */
tr.row-highlight td { background: var(--primary-light); }

/* Log timeline */
.log-timeline { list-style: none; }
.log-entry {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8125rem;
}
.log-entry:last-child { border-bottom: none; }
.log-time { color: var(--text-muted); white-space: nowrap; font-family: 'Monaco', 'Consolas', monospace; font-size: 0.75rem; min-width: 120px; }
.log-msg  { color: var(--text-primary); }
.log-user { color: var(--text-secondary); }

/* Operation card (pipeline) */
.op-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}

.op-card:hover { border-color: var(--border-accent); background: var(--bg-hover); }

.op-card-step {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.op-card-info { flex: 1; min-width: 0; }
.op-card-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.op-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.op-card-value { font-size: 0.9375rem; font-weight: 700; color: var(--text-bright); font-variant-numeric: tabular-nums; text-align: right; }
.op-card-stage { font-size: 0.6875rem; color: var(--text-muted); text-align: right; margin-top: 2px; }

/* Diferencial badge */
.diferencial-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(252,213,53,0.15) 0%, rgba(252,213,53,0.05) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Chart bars (SVG-free static) */
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.mini-bar {
  flex: 1;
  background: var(--primary-light);
  border-radius: 2px 2px 0 0;
  min-width: 8px;
  transition: height 0.4s ease;
}

.mini-bar.active { background: var(--primary-color); }

/* Version history pill */
.version-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.version-pill.current { border-color: var(--border-accent); color: var(--primary-color); }

/* ========================================
   SIDEBAR — OPERATION CONTEXT (flow mini-stepper)
   ======================================== */

.sidebar-op-context {
  margin: 6px 8px 4px;
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  background: var(--primary-light);
  overflow: hidden;
}

.sidebar-op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px 5px;
  border-bottom: 1px solid var(--border-accent);
}

.sidebar-op-id {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: 'Monaco', 'Consolas', monospace;
  letter-spacing: 0.3px;
  text-decoration: none;
  border: none !important;
  background: none !important;
  padding: 0 !important;
}

.sidebar-op-id:hover { color: var(--primary-hover); text-decoration: underline; }

.sidebar-op-tag {
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--warning-color);
}

.sidebar-op-steps {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
}

.sidebar-step {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  text-decoration: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: var(--transition-fast);
  border-left: 2px solid transparent !important;
}

.sidebar-step:hover { background: var(--bg-hover); color: var(--text-secondary); }

.sidebar-step-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--border-color);
}

.sidebar-step-label { flex: 1; }

.sidebar-step-check {
  font-size: 0.5625rem;
  color: var(--success-color);
  font-weight: 700;
}

/* States */
.sidebar-step-done .sidebar-step-dot { background: var(--success-color); }
.sidebar-step-done .sidebar-step-label { color: var(--text-secondary); }

.sidebar-step-current {
  background: rgba(252, 213, 53, 0.06);
  border-left-color: var(--primary-color) !important;
}
.sidebar-step-current .sidebar-step-dot { background: var(--primary-color); }
.sidebar-step-current .sidebar-step-label {
  color: var(--primary-color);
  font-weight: 600;
}

.sidebar-step-pending .sidebar-step-dot { background: var(--border-color); opacity: 0.5; }
.sidebar-step-pending .sidebar-step-label { color: var(--text-muted); opacity: 0.7; }

/* Collapsed: hide op-context block */
body.sidebar-collapsed .sidebar-op-context { display: none; }

/* ======================================== */

/* Sidebar disabled / coming-soon items */
.sidebar-disabled {
  opacity: 0.45;
  cursor: default !important;
  pointer-events: none;
}
.sidebar-soon {
  margin-left: auto;
  font-size: 0.5625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  padding: 1px 4px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Sticky disbursement footer */
.sticky-cta-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-accent);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 50;
  margin: 24px -24px -24px;
}
.sticky-cta-value {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sticky-cta-amount {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

/* ========================================
   BUREAU — standalone (cadastro.html)
   ======================================== */

.bureau-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bureau-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bureau-score {
  font-size: 1.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin-bottom: 6px;
}

/* ========================================
   CCB — table layout (ccb.html)
   ======================================== */

.ccb-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #181a20;
}

.ccb-title {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #181a20;
}

.ccb-subtitle {
  font-size: 0.6875rem;
  color: #8B9DB7;
  margin-top: 2px;
}

.ccb-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.ccb-table td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  color: #1a1a2e;
  vertical-align: top;
}

.ccb-label {
  background: #f8fafc;
  font-weight: 600;
  color: #546A83;
  white-space: nowrap;
  width: 160px;
}

/* ========================================
   CHECKLIST — desembolso.html variant
   ======================================== */

.checklist-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-check.done { background: var(--success-bg); }
.checklist-check.done .icon { filter: brightness(0) saturate(100%) invert(63%) sepia(75%) saturate(480%) hue-rotate(118deg) brightness(98%) contrast(90%); }
.checklist-check.warn { background: var(--warning-bg); }
.checklist-check.warn .icon { filter: brightness(0) saturate(100%) invert(68%) sepia(90%) saturate(800%) hue-rotate(10deg) brightness(103%) contrast(98%); }
.checklist-check.fail { background: var(--error-bg); }
.checklist-check.fail .icon { filter: brightness(0) saturate(100%) invert(63%) sepia(35%) saturate(1800%) hue-rotate(314deg) brightness(102%) contrast(101%); }

.checklist-text { flex: 1; min-width: 0; }

.checklist-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 2px;
}
