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

    html,
    body {
      margin: 0;
      padding: 0;
      height: 100%;
    }

    body {
      font-family: 'Inter', system-ui, -apple-system, sans-serif;
      -webkit-font-smoothing: antialiased;
      font-size: 14px;
      line-height: 1.5;
      color: #0F1A24;
      background: #FAFBFC;
    }

    h1,
    h2,
    h3,
    h4 {
      font-family: 'Space Grotesk', 'Inter', sans-serif;
      margin: 0;
      font-weight: 600;
      letter-spacing: -0.01em;
    }

    button {
      font-family: inherit;
      cursor: pointer;
      border: none;
      background: none;
      color: inherit;
    }

    input,
    textarea,
    select {
      font-family: inherit;
      color: inherit;
    }

    :focus-visible {
      outline: 3px solid oklch(0.52 0.14 240 / 0.42);
      outline-offset: 2px;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .file-input-hidden {
      display: none;
    }

    #root {
      height: 100vh;
    }

    .boot-loader {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100vh;
      color: white;
      font-family: 'Space Grotesk', sans-serif;
      background: #0A1628;
    }

    .boot-loader-mark {
      display: grid;
      place-items: center;
      width: 48px;
      height: 48px;
      margin-bottom: 20px;
      background: linear-gradient(135deg, oklch(0.58 0.11 180) 0%, oklch(0.52 0.14 240) 50%, oklch(0.48 0.15 290) 100%);
      border-radius: 14px;
      animation: pulse 1.5s ease-in-out infinite;
    }

    .boot-loader-title {
      font-size: 18px;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .boot-loader-subtitle {
      margin-top: 6px;
      color: rgba(255, 255, 255, 0.5);
      font-family: 'Inter', sans-serif;
      font-size: 13px;
    }

    .app-version-cluster {
      position: fixed;
      right: 10px;
      bottom: 8px;
      z-index: 2147483000;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      pointer-events: none;
    }

    .app-install-mini,
    .app-version-badge {
      padding: 3px 7px;
      border-radius: 999px;
      background: rgba(10, 22, 40, 0.52);
      color: rgba(255, 255, 255, 0.58);
      border: 1px solid rgba(255, 255, 255, 0.08);
      font: 500 10px/1.2 'Space Grotesk', sans-serif;
      letter-spacing: 0.02em;
      backdrop-filter: blur(8px);
    }

    .app-install-mini {
      pointer-events: auto;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.74);
      background: rgba(10, 22, 40, 0.66);
      transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
    }

    .app-install-mini:hover {
      color: white;
      transform: translateY(-1px);
    }

    .app-install-mini[hidden] {
      display: none;
    }

    .install-banner {
      position: fixed;
      bottom: 20px;
      left: 50%;
      z-index: 99999;
      display: flex;
      align-items: center;
      gap: 14px;
      width: calc(100% - 32px);
      max-width: 360px;
      padding: 14px 18px;
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      background: #0f1923;
      border: 1px solid #2d3748;
      border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
      transform: translateX(-50%);
      animation: fadeInUp 0.3s ease;
    }

    .install-banner-icon {
      display: grid;
      place-items: center;
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      color: white;
      background: linear-gradient(135deg, #4299e1, #667eea);
      border-radius: 9px;
    }

    .install-banner-copy {
      flex: 1;
      min-width: 0;
    }

    .install-banner-title {
      color: #e2e8f0;
      font-size: 13px;
      font-weight: 600;
    }

    .install-banner-text {
      margin-top: 2px;
      color: #718096;
      font-size: 11px;
    }

    .install-banner-action {
      padding: 7px 14px;
      color: white;
      white-space: nowrap;
      cursor: pointer;
      background: #4299e1;
      border: none;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
    }

    .install-banner-close {
      flex-shrink: 0;
      padding: 0 2px;
      color: #718096;
      cursor: pointer;
      background: none;
      border: none;
      font-size: 18px;
    }

    .feedback-backdrop {
      position: fixed;
      inset: 0;
      z-index: 2147482000;
      display: grid;
      place-items: center;
      padding: 18px;
      background: rgba(15, 26, 36, 0.46);
      backdrop-filter: blur(5px);
      animation: fadeIn 0.15s ease;
    }

    .feedback-dialog {
      width: min(420px, 100%);
      padding: 18px;
      display: grid;
      grid-template-columns: 42px 1fr;
      gap: 14px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 18px;
      box-shadow: var(--shadow-lg);
      animation: slideUp 0.18s ease;
    }

    .feedback-icon {
      width: 42px;
      height: 42px;
      display: grid;
      place-items: center;
      color: var(--blue);
      background: var(--blue-soft);
      border-radius: 14px;
      font-weight: 800;
      font-family: 'Space Grotesk', sans-serif;
    }

    .feedback-icon.danger {
      color: var(--danger);
      background: oklch(0.58 0.18 25 / 0.11);
    }

    .feedback-copy {
      min-width: 0;
    }

    .feedback-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
    }

    .feedback-message {
      margin-top: 5px;
      font-size: 13px;
      line-height: 1.55;
      color: var(--text-muted);
      white-space: pre-line;
    }

    .feedback-actions {
      grid-column: 1 / -1;
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      margin-top: 4px;
    }

    .feedback-btn {
      min-height: 36px;
      padding: 8px 14px;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 650;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
    }

    .feedback-confirm {
      color: white;
      border-color: transparent;
      background: var(--blue);
    }

    .feedback-confirm.danger {
      background: var(--danger);
    }

    /* ── DESIGN TOKENS ── */
    :root {
      --bg: #FFFFFF;
      --surface: #FAFBFC;
      --surface-2: #F4F6F8;
      --border: #E8EBEF;
      --border-strong: #D6DCE3;
      --text: #0F1A24;
      --text-muted: #5C6A78;
      --text-faint: #8A95A1;
      --teal: oklch(0.58 0.11 180);
      --teal-dark: oklch(0.48 0.11 180);
      --teal-soft: oklch(0.96 0.03 180);
      --blue: oklch(0.52 0.14 240);
      --blue-dark: oklch(0.42 0.14 240);
      --blue-soft: oklch(0.96 0.03 240);
      --purple: oklch(0.48 0.15 290);
      --purple-dark: oklch(0.38 0.15 290);
      --purple-soft: oklch(0.96 0.03 290);
      --success: oklch(0.62 0.13 155);
      --warning: oklch(0.72 0.14 75);
      --danger: oklch(0.58 0.18 25);
      --brand-gradient: linear-gradient(135deg, oklch(0.58 0.11 180) 0%, oklch(0.52 0.14 240) 50%, oklch(0.48 0.15 290) 100%);
      --shadow-sm: 0 1px 3px rgba(15, 26, 36, 0.06);
      --shadow-md: 0 4px 12px rgba(15, 26, 36, 0.08), 0 1px 3px rgba(15, 26, 36, 0.04);
      --shadow-lg: 0 16px 40px rgba(15, 26, 36, 0.1), 0 4px 12px rgba(15, 26, 36, 0.05);
      --radius-sm: 6px;
      --radius: 10px;
      --radius-lg: 16px;
    }

    /* ── MODO OSCURO ── */
    html.dark body,
    body.dark {
      --bg: #0f1923;
      --surface: #1a2332;
      --surface-2: #141e2b;
      --border: #2d3748;
      --border-strong: #4a5568;
      --text: #e2e8f0;
      --text-muted: #a0aec0;
      --text-faint: #718096;
      --teal-soft: oklch(0.25 0.06 180);
      --blue-soft: oklch(0.22 0.06 240);
      --purple-soft: oklch(0.22 0.06 290);
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
      --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.2);
      --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    html.dark .sidebar,
    body.dark .sidebar {
      background: #0d1520;
      border-color: #1e2d3d;
    }

    html.dark .topbar,
    body.dark .topbar {
      background: #0d1520;
      border-color: #1e2d3d;
    }

    html.dark .modal,
    body.dark .modal {
      background: #1a2332;
      border: 1px solid #2d3748;
    }

    html.dark .modal-header,
    html.dark .modal-footer,
    body.dark .modal-header,
    .dark .modal-footer {
      background: #141e2b;
    }

    html.dark .login-right,
    body.dark .login-right {
      background: #0d1520;
    }

    html.dark input,
    html.dark textarea,
    html.dark select,
    body.dark input,
    body.dark textarea,
    body.dark select {
      background: #0f1923;
      border-color: #2d3748;
      color: #e2e8f0;
    }

    html.dark .btn-ghost,
    body.dark .btn-ghost {
      border-color: #2d3748;
      color: #a0aec0;
    }

    html.dark .btn-ghost:hover,
    body.dark .btn-ghost:hover {
      background: #1a2332;
    }

    /* ── FUENTE AJUSTABLE ── */
    body.font-sm {
      font-size: 12px;
    }

    body.font-lg {
      font-size: 16px;
    }

    /* ── SCROLLBAR ── */
    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: #D6DCE3;
      border-radius: 8px;
      border: 2px solid var(--surface);
    }

    html.dark ::-webkit-scrollbar-thumb,
    body.dark ::-webkit-scrollbar-thumb {
      background: #4a5568;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #A8B2BD;
    }

    /* ══════════════════════════════
   LOGIN
══════════════════════════════ */
    .login-shell {
      display: grid;
      grid-template-columns: 1fr 500px;
      height: 100vh;
      overflow: hidden;
    }

    @media(max-width:860px) {
      .login-shell {
        grid-template-columns: 1fr;
      }

      .login-left {
        display: none;
      }
    }

    .login-left {
      background: linear-gradient(145deg, #0A1628 0%, #0F2A47 40%, #102040 70%, #0D1B35 100%);
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 48px 52px;
      position: relative;
      overflow: hidden;
    }

    .login-left::before {
      content: '';
      position: absolute;
      inset: 0;
      background: radial-gradient(ellipse 60% 50% at 20% 20%, oklch(0.58 0.11 180 / 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 70%, oklch(0.48 0.15 290 / 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 40% 30% at 60% 30%, oklch(0.52 0.14 240 / 0.12) 0%, transparent 50%);
    }

    .login-left-content {
      position: relative;
      z-index: 1;
    }

    .login-brand {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 64px;
    }

    .login-brand-mark {
      width: 48px;
      height: 48px;
      border-radius: 14px;
      background: var(--brand-gradient);
      display: grid;
      place-items: center;
      box-shadow: 0 8px 24px oklch(0.52 0.14 240 / 0.35);
    }

    .login-brand-name {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: white;
    }

    .login-brand-sub {
      font-size: 11px;
      color: rgba(255, 255, 255, 0.45);
      margin-top: 2px;
      text-transform: uppercase;
      letter-spacing: 0.07em;
    }

    .login-headline h1 {
      font-size: 38px;
      font-weight: 700;
      letter-spacing: -0.03em;
      line-height: 1.15;
      margin-bottom: 16px;
      color: white;
    }

    .login-headline p {
      font-size: 15px;
      color: rgba(255, 255, 255, 0.55);
      line-height: 1.65;
      max-width: 380px;
    }

    .login-features {
      display: flex;
      flex-direction: column;
      gap: 14px;
      margin-top: 48px;
    }

    .login-feature {
      display: flex;
      align-items: center;
      gap: 12px;
      color: rgba(255, 255, 255, 0.75);
      font-size: 13.5px;
    }

    .login-feature-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .deco-circle {
      position: absolute;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.06);
    }

    .login-left-footer {
      position: relative;
      z-index: 1;
      font-size: 11.5px;
      color: rgba(255, 255, 255, 0.28);
    }

    .login-right {
      background: #FAFBFC;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 40px 32px;
      overflow-y: auto;
    }

    .login-card {
      background: white;
      border-radius: 20px;
      box-shadow: var(--shadow-md);
      padding: 44px 40px;
      width: 100%;
      max-width: 400px;
      border: 1px solid var(--border);
    }

    .login-card-logo {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 32px;
    }

    .login-card-logo-mark {
      width: 38px;
      height: 38px;
      border-radius: 10px;
      background: var(--brand-gradient);
      display: grid;
      place-items: center;
    }

    .login-card-title {
      font-size: 22px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 6px;
    }

    .login-card-sub {
      font-size: 13px;
      color: var(--text-muted);
      margin-bottom: 28px;
      line-height: 1.5;
    }

    .ms-btn {
      width: 100%;
      padding: 13px 16px;
      border: 1.5px solid var(--border-strong);
      border-radius: 10px;
      background: white;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      transition: all 0.15s;
      cursor: pointer;
    }

    .ms-btn:hover {
      border-color: #0078D4;
      box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
      transform: translateY(-1px);
    }

    .login-divider {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 20px 0;
      color: var(--text-faint);
      font-size: 12px;
    }

    .login-divider::before,
    .login-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    .demo-btn {
      width: 100%;
      padding: 12px;
      border: 1.5px dashed var(--border-strong);
      border-radius: 10px;
      background: transparent;
      font-size: 13px;
      color: var(--text-muted);
      font-weight: 500;
      transition: all 0.15s;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
    }

    .demo-btn:hover {
      border-color: var(--text-muted);
      color: var(--text);
      background: var(--surface-2);
    }

    .login-footer-note {
      margin-top: 28px;
      text-align: center;
      font-size: 11.5px;
      color: var(--text-faint);
      line-height: 1.6;
    }

    /* MS Modal */
    .ms-modal-backdrop {
      position: fixed;
      inset: 0;
      z-index: 100;
      background: rgba(0, 0, 0, 0.45);
      backdrop-filter: blur(6px);
      display: grid;
      place-items: center;
      animation: fadeIn 0.18s ease;
    }

    .ms-modal {
      background: white;
      border-radius: 4px;
      width: 440px;
      max-width: calc(100vw - 32px);
      box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
      overflow: hidden;
      animation: slideUp 0.22s ease;
    }

    .ms-modal-header {
      padding: 24px 28px 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .ms-modal-body {
      padding: 20px 28px 28px;
    }

    .ms-modal-title {
      font-size: 20px;
      font-weight: 600;
      margin-bottom: 6px;
      color: #1b1b1b;
    }

    .ms-modal-sub {
      font-size: 13px;
      color: #505050;
      margin-bottom: 22px;
    }

    .ms-field {
      border: 1px solid #666;
      padding: 9px 10px;
      font-size: 14px;
      width: 100%;
      outline: none;
      transition: border-color 0.15s;
      font-family: inherit;
    }

    .ms-field:focus {
      border-color: #0078D4;
      border-bottom-width: 2px;
    }

    .ms-field-row {
      margin-bottom: 24px;
    }

    .ms-btn-primary {
      background: #0078D4;
      color: white;
      padding: 10px 20px;
      font-size: 14px;
      font-weight: 600;
      border: none;
      cursor: pointer;
      font-family: inherit;
      transition: background 0.15s;
    }

    .ms-btn-primary:hover {
      background: #106EBE;
    }

    .ms-btn-primary:disabled {
      background: #AECEF0;
      cursor: not-allowed;
    }

    .ms-btn-link {
      color: #0078D4;
      font-size: 13px;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0;
      font-family: inherit;
    }

    .ms-btn-link:hover {
      text-decoration: underline;
    }

    .ms-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 8px;
    }

    .ms-user-pill {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      border: 1px solid var(--border-strong);
      border-radius: 20px;
      font-size: 13px;
      font-weight: 500;
      margin-bottom: 20px;
      cursor: pointer;
      transition: background 0.1s;
    }

    .ms-user-pill:hover {
      background: var(--surface-2);
    }

    .ms-error {
      color: #d32f2f;
      font-size: 12px;
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    /* Demo modal */
    .demo-modal {
      background: white;
      border-radius: 16px;
      width: 660px;
      max-width: calc(100vw - 32px);
      max-height: 82vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      box-shadow: var(--shadow-lg);
      animation: slideUp 0.22s ease;
    }

    .demo-modal-header {
      padding: 24px 28px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .demo-modal-title {
      font-size: 17px;
      font-weight: 700;
    }

    .demo-modal-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 3px;
    }

    .demo-grid {
      padding: 20px 28px;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      overflow-y: auto;
    }

    .demo-user-card {
      padding: 14px 16px;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      cursor: pointer;
      transition: all 0.12s;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .demo-user-card:hover {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px oklch(0.52 0.14 240 / 0.1);
      transform: translateY(-1px);
    }

    .demo-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: white;
      font-weight: 700;
      font-size: 13px;
      flex-shrink: 0;
    }

    .demo-role-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 100px;
      font-size: 10.5px;
      font-weight: 600;
      margin-top: 5px;
    }

    /* ══════════════════════════════
   APP SHELL
══════════════════════════════ */
    .app-shell {
      display: grid;
      grid-template-columns: 252px 1fr;
      height: 100vh;
      overflow: hidden;
    }

    .sidebar {
      background: white;
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      padding: 16px 12px;
      gap: 2px;
      overflow-y: auto;
    }

    .main {
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .topbar {
      height: 64px;
      background: white;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      padding: 0 24px;
      gap: 16px;
      flex-shrink: 0;
    }

    .content {
      flex: 1;
      overflow-y: auto;
      padding: 28px 32px;
    }

    /* Sidebar brand */
    .sb-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 6px 10px 18px 10px;
      margin-bottom: 2px;
    }

    .sb-brand-mark {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      background: var(--brand-gradient);
      display: grid;
      place-items: center;
      box-shadow: 0 4px 10px oklch(0.52 0.14 240 / 0.25);
      flex-shrink: 0;
    }

    .sb-brand-name {
      font-family: 'Space Grotesk', sans-serif;
      font-weight: 700;
      font-size: 15px;
      letter-spacing: -0.02em;
    }

    .sb-brand-sub {
      font-size: 10px;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-top: 1px;
    }

    /* Nav */
    .nav-section {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--text-faint);
      padding: 14px 12px 6px;
    }

    .nav-item {
      display: flex;
      align-items: center;
      gap: 11px;
      padding: 9px 12px;
      border-radius: 8px;
      font-size: 13.5px;
      font-weight: 500;
      color: var(--text-muted);
      transition: all 0.12s;
      width: 100%;
      text-align: left;
      position: relative;
    }

    .nav-item:hover {
      background: var(--surface-2);
      color: var(--text);
    }

    .nav-item.active {
      background: oklch(0.52 0.14 240 / 0.08);
      color: var(--blue-dark);
    }

    .nav-item.active::before {
      content: '';
      position: absolute;
      left: -12px;
      top: 8px;
      bottom: 8px;
      width: 3px;
      border-radius: 0 3px 3px 0;
      background: var(--brand-gradient);
    }

    .nav-item svg {
      width: 18px;
      height: 18px;
      flex-shrink: 0;
      stroke-width: 1.8;
    }

    .nav-badge {
      margin-left: auto;
      background: var(--blue);
      color: white;
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
    }

    .nav-item.active .nav-badge {
      background: var(--blue-dark);
    }

    /* User card */
    .user-card {
      margin-top: auto;
      padding: 10px;
      border-radius: var(--radius);
      display: flex;
      align-items: center;
      gap: 10px;
      background: var(--surface-2);
      border: 1px solid var(--border);
    }

    .ava {
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: white;
      font-weight: 700;
      font-family: 'Space Grotesk', sans-serif;
      flex-shrink: 0;
    }

    .ava-lg {
      width: 40px;
      height: 40px;
      font-size: 14px;
    }

    .ava-md {
      width: 32px;
      height: 32px;
      font-size: 12px;
    }

    .ava-sm {
      width: 26px;
      height: 26px;
      font-size: 10px;
    }

    .user-meta {
      display: flex;
      flex-direction: column;
      line-height: 1.2;
      min-width: 0;
    }

    .user-name {
      font-size: 12.5px;
      font-weight: 600;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .user-role-label {
      font-size: 11px;
      color: var(--text-muted);
    }

    /* Topbar */
    .crumb {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: var(--text-muted);
    }

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

    .search {
      flex: 1;
      max-width: 400px;
      margin-left: 20px;
      display: flex;
      align-items: center;
      gap: 8px;
      background: var(--surface-2);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 7px 12px;
      transition: all 0.15s;
    }

    .search:focus-within {
      background: white;
      border-color: var(--blue);
      box-shadow: 0 0 0 3px oklch(0.52 0.14 240 / 0.1);
    }

    .search input {
      border: none;
      background: transparent;
      outline: none;
      flex: 1;
      font-size: 13px;
    }

    .search svg {
      width: 14px;
      height: 14px;
      color: var(--text-muted);
    }

    .kbd {
      background: white;
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1px 5px;
      font-size: 10px;
      font-family: 'SF Mono', Menlo, monospace;
      color: var(--text-muted);
    }

    .tb-actions {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-left: auto;
    }

    .icon-btn {
      width: 36px;
      height: 36px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      color: var(--text-muted);
      position: relative;
      transition: all 0.12s;
      cursor: pointer;
    }

    .icon-btn:hover {
      background: var(--surface-2);
      color: var(--text);
    }

    .icon-btn svg {
      width: 18px;
      height: 18px;
    }

    .icon-btn .notif-dot {
      position: absolute;
      top: 8px;
      right: 8px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--danger);
      border: 2px solid white;
    }

    /* Notif panel */
    .notif-panel {
      position: absolute;
      top: 52px;
      right: 0;
      width: 380px;
      max-height: 500px;
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: var(--shadow-lg);
      overflow: hidden;
      display: flex;
      flex-direction: column;
      z-index: 40;
    }

    .notif-item {
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      display: flex;
      gap: 10px;
      cursor: pointer;
      transition: background 0.1s;
    }

    .notif-item:hover {
      background: var(--surface);
    }

    .notif-item.unread {
      background: oklch(0.52 0.14 240 / 0.03);
    }

    .notif-icon-wrap {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      display: grid;
      place-items: center;
      flex-shrink: 0;
    }

    /* Page */
    .page-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 20px;
      margin-bottom: 24px;
    }

    .page-title {
      font-size: 24px;
      font-weight: 700;
      letter-spacing: -0.02em;
    }

    .page-sub {
      color: var(--text-muted);
      font-size: 13.5px;
      margin-top: 4px;
    }

    /* Buttons */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      transition: all 0.12s;
      white-space: nowrap;
      cursor: pointer;
    }

    .btn svg {
      width: 15px;
      height: 15px;
    }

    .btn-primary {
      background: var(--brand-gradient);
      color: white;
      box-shadow: 0 2px 6px oklch(0.52 0.14 240 / 0.25);
    }

    .btn-primary:hover {
      box-shadow: 0 4px 14px oklch(0.52 0.14 240 / 0.35);
      transform: translateY(-1px);
    }

    .btn-secondary {
      background: white;
      border: 1px solid var(--border-strong);
      color: var(--text);
    }

    .btn-secondary:hover {
      background: var(--surface-2);
      border-color: var(--text-muted);
    }

    .btn-ghost {
      color: var(--text-muted);
    }

    .btn-ghost:hover {
      background: var(--surface-2);
      color: var(--text);
    }

    .btn-danger {
      background: oklch(0.58 0.18 25 / 0.1);
      color: var(--danger);
      border: 1px solid oklch(0.58 0.18 25 / 0.2);
    }

    .btn-danger:hover {
      background: oklch(0.58 0.18 25 / 0.18);
    }

    .btn-sm {
      padding: 5px 10px;
      font-size: 12px;
    }

    .btn-sm svg {
      width: 13px;
      height: 13px;
    }

    .btn:disabled {
      opacity: 0.5;
      pointer-events: none;
    }

    /* Cards */
    .card {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      padding: 20px;
    }

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

    .card-title {
      font-size: 14px;
      font-weight: 600;
    }

    .card-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    /* Stats */
    .stat-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 24px;
    }

    .stat {
      padding: 18px 20px;
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      position: relative;
      overflow: hidden;
    }

    .stat-label {
      font-size: 12px;
      color: var(--text-muted);
      font-weight: 500;
    }

    .stat-value {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 28px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-top: 6px;
    }

    .stat-delta {
      font-size: 11.5px;
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 4px;
      font-weight: 500;
      color: var(--text-muted);
    }

    .stat-icon {
      position: absolute;
      top: 18px;
      right: 18px;
      width: 34px;
      height: 34px;
      border-radius: 9px;
      display: grid;
      place-items: center;
    }

    .stat-icon svg {
      width: 16px;
      height: 16px;
    }

    /* Badges */
    .badge-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      border-radius: 100px;
      font-size: 11px;
      font-weight: 500;
      white-space: nowrap;
    }

    .badge-pill .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
    }

    .badge-success {
      background: oklch(0.62 0.13 155 / 0.12);
      color: var(--success);
    }

    .badge-success .dot {
      background: var(--success);
    }

    .badge-warning {
      background: oklch(0.72 0.14 75 / 0.15);
      color: oklch(0.52 0.14 75);
    }

    .badge-warning .dot {
      background: oklch(0.62 0.14 75);
    }

    .badge-danger {
      background: oklch(0.58 0.18 25 / 0.12);
      color: var(--danger);
    }

    .badge-danger .dot {
      background: var(--danger);
    }

    .badge-info {
      background: var(--blue-soft);
      color: var(--blue-dark);
    }

    .badge-info .dot {
      background: var(--blue);
    }

    .badge-neutral {
      background: var(--surface-2);
      color: var(--text-muted);
    }

    .badge-neutral .dot {
      background: var(--text-faint);
    }

    .badge-purple {
      background: var(--purple-soft);
      color: var(--purple-dark);
    }

    .badge-purple .dot {
      background: var(--purple);
    }

    /* Tables */
    .table {
      width: 100%;
      border-collapse: collapse;
    }

    .table th {
      text-align: left;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-faint);
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
    }

    .table td {
      padding: 13px 14px;
      font-size: 13px;
      border-bottom: 1px solid var(--border);
    }

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

    .table tr:hover td {
      background: var(--surface);
    }

    .table-wrap {
      background: white;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      overflow-x: auto;
      overflow-y: hidden;
    }

    /* Compact invoice table */
    .invoice-table-wrap {
      overflow-x: hidden;
    }

    .invoice-scope-tabs {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .invoice-scope-tab {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-height: 42px;
      padding: 10px 12px;
      border: 1px solid var(--border);
      border-radius: 12px;
      background: white;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 12.5px;
      font-weight: 700;
      transition: all 0.15s ease;
    }

    .invoice-scope-tab strong {
      display: inline-grid;
      min-width: 28px;
      height: 24px;
      padding: 0 8px;
      place-items: center;
      border-radius: 999px;
      background: var(--surface-2);
      color: var(--text);
      font-family: 'Space Grotesk', sans-serif;
      font-size: 12px;
    }

    .invoice-scope-tab.active {
      border-color: oklch(0.52 0.14 240 / 0.25);
      background: var(--blue-soft);
      color: var(--blue-dark);
      box-shadow: 0 10px 24px oklch(0.52 0.14 240 / 0.08);
    }

    .invoice-scope-tab.active strong {
      background: white;
      color: var(--blue-dark);
    }

    .invoice-table {
      table-layout: fixed;
      min-width: 0 !important;
    }

    .invoice-table th,
    .invoice-table td {
      padding: 10px 12px;
      vertical-align: middle;
    }

    .invoice-col-number {
      width: 11%;
    }

    .invoice-col-detail {
      width: 32%;
    }

    .invoice-col-beneficiary {
      width: 19%;
    }

    .invoice-col-date {
      width: 12%;
    }

    .invoice-col-status {
      width: 11%;
    }

    .invoice-col-actions {
      width: 15%;
    }

    .invoice-table-owner .invoice-col-number {
      width: 14%;
    }

    .invoice-table-owner .invoice-col-detail {
      width: 41%;
    }

    .invoice-table-owner .invoice-col-date,
    .invoice-table-owner .invoice-col-status,
    .invoice-table-owner .invoice-col-actions {
      width: 15%;
    }

    .invoice-number-cell {
      font-family: 'Space Grotesk', sans-serif;
      font-size: 12px;
      font-weight: 700;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    .invoice-pdf-mini {
      margin-top: 6px;
      padding: 2px 6px;
      border: 1px solid oklch(0.58 0.18 25 / 0.22);
      border-radius: 6px;
      background: oklch(0.58 0.18 25 / 0.08);
      color: var(--danger);
      cursor: pointer;
      font-size: 9px;
      font-weight: 800;
      letter-spacing: 0.04em;
    }

    .invoice-main-cell {
      min-width: 0;
      max-width: none;
    }

    .invoice-concept-title {
      display: -webkit-box;
      overflow: hidden;
      font-size: 13px;
      font-weight: 600;
      line-height: 1.3;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .invoice-kind-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      max-width: 100%;
      padding: 2px 7px;
      border: 1px solid oklch(0.52 0.14 240 / 0.20);
      border-radius: 999px;
      background: var(--blue-soft);
      color: var(--blue-dark);
      font-size: 10px;
      font-weight: 700;
      white-space: nowrap;
    }

    .invoice-kind-chip.is-extra {
      border-color: oklch(0.58 0.18 25 / 0.20);
      background: oklch(0.58 0.18 25 / 0.08);
      color: var(--danger);
    }

    .invoice-info-box {
      margin-top: 4px;
      padding: 4px 7px;
      border-radius: 7px;
      font-size: 10.5px;
      line-height: 1.35;
      overflow-wrap: anywhere;
    }

    .invoice-info-box button,
    .invoice-info-box span {
      max-width: 100%;
      overflow-wrap: anywhere;
    }

    .invoice-info-accounting {
      border: 1px solid oklch(0.48 0.15 290 / 0.2);
      background: var(--purple-soft);
      color: var(--purple);
    }

    .invoice-info-paid {
      border: 1px solid oklch(0.62 0.13 155 / 0.25);
      background: oklch(0.62 0.13 155 / 0.08);
    }

    .invoice-info-partial {
      border: 1px solid oklch(0.52 0.14 240 / 0.25);
      background: oklch(0.72 0.14 240 / 0.08);
    }

    .invoice-live-strip {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
      padding: 11px 14px;
      border: 1px solid oklch(0.58 0.11 180 / 0.24);
      border-radius: 10px;
      background: oklch(0.78 0.11 180 / 0.10);
    }

    .invoice-live-strip strong {
      display: block;
      color: var(--text);
      font-size: 13px;
      font-weight: 800;
    }

    .invoice-live-strip span {
      color: var(--text-muted);
      font-size: 11.5px;
      font-weight: 600;
    }

    .invoice-live-kpis {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 6px;
    }

    .invoice-live-kpis span {
      padding: 4px 8px;
      border: 1px solid var(--border);
      border-radius: 999px;
      background: white;
      color: var(--text);
      white-space: nowrap;
    }

    .invoice-live-flow {
      margin-top: 6px;
      padding: 6px 8px;
      border: 1px solid oklch(0.58 0.11 180 / 0.22);
      border-radius: 8px;
      background: oklch(0.78 0.11 180 / 0.08);
    }

    .invoice-live-flow-head {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 6px;
      color: var(--text-muted);
      font-size: 10.5px;
      font-weight: 700;
      line-height: 1.25;
    }

    .invoice-live-steps {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 4px;
    }

    .invoice-live-steps span {
      min-width: 0;
      padding: 3px 4px;
      border-radius: 6px;
      background: white;
      color: var(--text-faint);
      font-size: 9.5px;
      font-weight: 800;
      text-align: center;
      white-space: nowrap;
    }

    .invoice-live-steps span.done {
      background: oklch(0.62 0.13 155 / 0.12);
      color: var(--success);
    }

    .invoice-live-steps span.active {
      outline: 1px solid oklch(0.58 0.11 180 / 0.35);
      background: white;
      color: var(--teal);
    }

    .invoice-beneficiary-meta {
      min-width: 0;
      line-height: 1.25;
    }

    .invoice-beneficiary-name {
      overflow: hidden;
      font-size: 12.5px;
      font-weight: 600;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .invoice-fee-line {
      margin-top: 2px;
      color: var(--success);
      font-family: 'Space Grotesk', sans-serif;
      font-size: 10.5px;
      font-weight: 800;
    }

    .invoice-date-cell {
      color: var(--text-muted);
      font-size: 11.5px;
      line-height: 1.35;
    }

    .invoice-date-cell span {
      display: block;
      margin-top: 2px;
      color: var(--text-faint);
      font-size: 10.5px;
      overflow-wrap: anywhere;
    }

    .invoice-status-cell .badge-pill {
      max-width: 100%;
      padding: 3px 7px;
      font-size: 10.5px;
    }

    .invoice-actions-cell {
      min-width: 0;
    }

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

    .invoice-actions .btn {
      min-height: 0;
      padding: 4px 7px !important;
      font-size: 10.5px !important;
      line-height: 1.1;
      white-space: normal;
    }

    /* Form */
    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .field label {
      font-size: 12px;
      font-weight: 500;
      color: var(--text);
    }

    .field input,
    .field textarea,
    .field select {
      padding: 9px 12px;
      border: 1px solid var(--border-strong);
      border-radius: 8px;
      font-size: 13px;
      background: white;
      outline: none;
      transition: all 0.12s;
    }

    .field input:focus,
    .field textarea:focus,
    .field select:focus {
      border-color: var(--blue);
      box-shadow: 0 0 0 3px oklch(0.52 0.14 240 / 0.1);
    }

    .field .hint {
      font-size: 11px;
      color: var(--text-muted);
    }

    .field textarea {
      resize: vertical;
      min-height: 80px;
    }

    /* Modal */
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 26, 36, 0.4);
      backdrop-filter: blur(4px);
      display: grid;
      place-items: center;
      z-index: 50;
      animation: fadeIn 0.15s ease;
    }

    .modal {
      background: white;
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-lg);
      width: 90%;
      max-width: 560px;
      max-height: 90vh;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      animation: slideUp 0.2s ease;
    }

    .modal-xs { max-width: 460px; }
    .modal-sm { max-width: 480px; }
    .modal-md { max-width: 520px; }
    .modal-base { max-width: 540px; }
    .modal-lg { max-width: 600px; }
    .modal-xl { max-width: 640px; }
    .modal-xxl { max-width: 680px; }

    .modal-header {
      padding: 20px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .modal-body {
      padding: 20px 24px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .modal-footer {
      padding: 14px 24px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      background: var(--surface);
    }

    .modal-title {
      font-size: 17px;
      font-weight: 700;
    }

    .modal-sub {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 3px;
    }

    /* Grids */
    .grid-2 {
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 20px;
    }

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

    .grid-2-eq {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    .grid-4 {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
    }

    /* Toast */
    .toast-wrap {
      position: fixed;
      bottom: 24px;
      right: 24px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 60;
    }

    .toast {
      background: white;
      border: 1px solid var(--border);
      border-left: 3px solid var(--success);
      border-radius: 10px;
      box-shadow: var(--shadow-lg);
      padding: 12px 16px;
      min-width: 280px;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      animation: slideUp 0.25s ease;
    }

    .toast-err {
      border-left-color: var(--danger);
    }

    .toast-title {
      font-weight: 600;
      font-size: 13px;
    }

    .toast-body {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 2px;
    }

    /* Progress */
    .progress {
      width: 100%;
      height: 6px;
      background: var(--surface-2);
      border-radius: 100px;
      overflow: hidden;
    }

    .progress-fill {
      height: 100%;
      border-radius: 100px;
      background: var(--brand-gradient);
      transition: width 0.4s;
    }

    /* Divider */
    .divider {
      height: 1px;
      background: var(--border);
      margin: 14px 0;
    }

    /* Filters / tabs */
    .filter-tabs {
      display: flex;
      align-items: center;
      gap: 3px;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      overflow-x: auto;
    }

    .filter-tab {
      padding: 6px 12px;
      font-size: 12.5px;
      font-weight: 500;
      border-radius: 6px;
      color: var(--text-muted);
      transition: all 0.1s;
      cursor: pointer;
      background: none;
      border: none;
      white-space: nowrap;
    }

    .filter-tab.active {
      background: var(--surface-2);
      color: var(--text);
    }

    .filter-tab-count {
      margin-left: 5px;
      color: var(--text-faint);
      font-size: 11px;
    }

    div:hover>.notif-actions {
      opacity: 1 !important;
      transition: opacity 0.15s;
    }

    /* ══════════════════════════════
       RESPONSIVE LAYER
       Conserva el layout desktop y suaviza la experiencia tablet/móvil.
    ══════════════════════════════ */
    @media (max-width: 1180px) {
      .app-shell {
        grid-template-columns: 220px 1fr;
      }

      .content {
        padding: 22px 24px;
      }

      .stat-grid,
      .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .grid-2 {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 860px) {

      html,
      body,
      #root {
        min-height: 100%;
        height: auto;
      }

      .app-shell {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        overflow: visible;
      }

      .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 10px 12px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        scrollbar-width: none;
      }

      .sidebar::-webkit-scrollbar {
        display: none;
      }

      .sb-brand {
        position: sticky;
        left: 0;
        z-index: 2;
        flex-shrink: 0;
        padding: 0 10px 0 0;
        margin: 0;
        background: inherit;
      }

      .sb-brand-sub,
      .nav-section,
      .user-card {
        display: none;
      }

      .nav-item {
        flex: 0 0 auto;
        width: auto;
        min-height: 38px;
        padding: 8px 11px;
        border: 1px solid transparent;
        white-space: nowrap;
      }

      .nav-item.active {
        border-color: oklch(0.52 0.14 240 / 0.18);
      }

      .main {
        min-height: 0;
        overflow: visible;
      }

      .topbar {
        position: sticky;
        top: 59px;
        z-index: 35;
        height: auto;
        min-height: 58px;
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
      }

      .crumb {
        min-width: 0;
        flex: 1 1 180px;
      }

      .search {
        order: 3;
        flex: 1 0 100%;
        max-width: none;
        height: 38px;
      }

      .tb-actions {
        margin-left: auto;
      }

      .notif-panel {
        position: fixed;
        top: 116px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 140px);
      }

      .content {
        overflow: visible;
        padding: 18px 14px 88px;
      }

      .page-header {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
      }

      .page-header>div:last-child {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .page-title {
        font-size: 25px;
      }

      .stat-grid,
      .grid-2,
      .grid-2-eq,
      .grid-3,
      .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .card {
        padding: 16px;
      }

      .card-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
      }

      .table-wrap {
        margin-inline: -2px;
        border-radius: 12px;
        -webkit-overflow-scrolling: touch;
      }

      .table {
        min-width: 720px;
      }

      .table th,
      .table td {
        padding: 11px 12px;
      }

      .invoice-table-wrap {
        overflow-x: hidden;
      }

      .invoice-table {
        min-width: 0 !important;
      }

      .invoice-scope-tabs {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .invoice-scope-tab {
        min-height: 38px;
        padding: 9px 11px;
      }

      .invoice-live-strip {
        align-items: stretch;
        flex-direction: column;
      }

      .invoice-live-kpis {
        justify-content: flex-start;
      }

      .invoice-table colgroup,
      .invoice-table thead {
        display: none;
      }

      .invoice-table,
      .invoice-table tbody,
      .invoice-table tr,
      .invoice-table td {
        display: block;
        width: 100%;
      }

      .invoice-table tr {
        padding: 12px;
        border-bottom: 1px solid var(--border);
      }

      .invoice-table td {
        padding: 5px 0;
        border-bottom: 0;
      }

      .invoice-number-cell {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .invoice-main-cell {
        margin-top: 4px;
      }

      .invoice-status-cell {
        margin-top: 4px;
      }

      .invoice-actions {
        margin-top: 4px;
      }

      .filter-tabs {
        padding: 10px 12px;
        scrollbar-width: none;
      }

      .filter-tabs::-webkit-scrollbar {
        display: none;
      }

      .modal-backdrop {
        align-items: flex-end !important;
        padding: 0;
        place-items: end center;
      }

      .modal {
        width: 100%;
        max-width: none !important;
        max-height: min(92vh, 760px);
        border-radius: 18px 18px 0 0;
      }

      .modal-header,
      .modal-body,
      .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
      }

      .modal-footer {
        position: sticky;
        bottom: 0;
        flex-wrap: wrap;
      }

      .modal-footer .btn {
        flex: 1 1 140px;
        justify-content: center;
      }

      .demo-modal {
        width: 100%;
        max-width: none;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
      }

      .demo-grid {
        grid-template-columns: 1fr;
        padding: 16px;
      }

      .toast-wrap {
        right: 12px;
        bottom: 48px;
        left: 12px;
      }

      .toast {
        width: 100%;
        min-width: 0;
      }

      .install-banner {
        bottom: 14px;
        gap: 10px;
        padding: 12px 14px;
      }
    }

    @media (max-width: 560px) {
      body {
        font-size: 13px;
      }

      .sb-brand-name {
        display: none;
      }

      .nav-item {
        gap: 7px;
        padding: 8px 10px;
        font-size: 12.5px;
      }

      .nav-item svg {
        width: 16px;
        height: 16px;
      }

      .topbar {
        top: 57px;
      }

      .page-title {
        font-size: 22px;
      }

      .page-sub,
      .card-sub {
        font-size: 11.5px;
      }

      .btn {
        min-height: 36px;
      }

      .btn-sm {
        min-height: 30px;
      }

      .stat {
        padding: 15px 16px;
      }

      .stat-value {
        font-size: 24px;
      }

      .modal {
        max-height: 94vh;
      }

      .field input,
      .field textarea,
      .field select {
        min-height: 38px;
        font-size: 13px;
      }

      .notif-panel {
        top: 112px;
      }

      .app-version-cluster {
        right: 8px;
        bottom: 6px;
        transform: scale(0.94);
        transform-origin: bottom right;
      }
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(12px);
      }

      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
    }

    /* Stub view */
    .stub-view {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      min-height: 340px;
      gap: 14px;
      text-align: center;
      color: var(--text-muted);
    }

    .stub-icon {
      width: 56px;
      height: 56px;
      border-radius: 16px;
      background: var(--surface-2);
      display: grid;
      place-items: center;
    }

    .stub-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
      font-family: 'Space Grotesk', sans-serif;
    }

    .stub-sub {
      font-size: 13.5px;
      max-width: 320px;
      line-height: 1.6;
    }

    @keyframes fadeIn {
      from {
        opacity: 0
      }

      to {
        opacity: 1
      }
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateY(16px)
      }

      to {
        opacity: 1;
        transform: translateY(0)
      }
    }

    @keyframes spin {
      to {
        transform: rotate(360deg)
      }
    }

    @keyframes pulse {

      0%,
      100% {
        opacity: 1
      }

      50% {
        opacity: 0.5
      }
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
    }
