:root {
    /* Purple scale */
    --p50: #F5F3FF;
    --p100: #EDE9FE;
    --p200: #DDD6FE;
    --p300: #C4B5FD;
    --p400: #A78BFA;
    --p500: #8B5CF6;
    --p600: #7C3AED;
    --p700: #6D28D9;
    --p800: #5B21B6;
    --p900: #4C1D95;

    /* Surfaces */
    --white: #FFFFFF;
    --snow: #FAFAFD;
    --lav: #F5F3FF;

    /* Text */
    --tx: #1A1A2E;
    --tx2: #3D3D56;
    --tx3: #6B6B80;
    --txm: #9D9DB0;

    /* Borders */
    --bdr: #E8E5F0;
    --bdr-h: #D4CFE5;

    /* Shadows (purple-tinted) */
    --sh-xs: 0 1px 2px rgba(109, 40, 217, 0.05);
    --sh-sm: 0 1px 3px rgba(109, 40, 217, 0.08), 0 1px 2px rgba(109, 40, 217, 0.04);
    --sh-md: 0 4px 6px -1px rgba(109, 40, 217, 0.08), 0 2px 4px rgba(109, 40, 217, 0.04);
    --sh-lg: 0 10px 15px -3px rgba(109, 40, 217, 0.08), 0 4px 6px rgba(109, 40, 217, 0.03);

    /* Typography */
    --f: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Radii */
    --r: 14px;
    --rl: 20px;
    --rxl: 28px;

    /* Layout */
    --demo-header-height: 68px;
    --app-sidebar-width: 232px;

    /* Focus */
    --focus-ring: 0 0 0 4px rgba(124, 58, 237, 0.15);
  }

  /* ── DEMO HEADER (portfolio nav) ── */
  .demo-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-bottom: 1px solid var(--bdr);
    padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  }

  .demo-header-inner {
    max-width: 1160px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
  }

  .demo-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .demo-logo-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    text-decoration: none;
    color: var(--tx);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -.03em;
  }

  .demo-logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  }

  .demo-header-sep {
    width: 1px;
    height: 24px;
    background: var(--bdr);
    margin: 0 4px;
  }

  .demo-header-label {
    font-size: 13px;
    color: var(--txm);
    font-weight: 500;
  }

  .demo-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .demo-badge {
    padding: 5px 14px;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.07);
    color: var(--p600);
    font-size: 12px;
    font-weight: 600;
  }

  .demo-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--p600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    transition: background 0.15s;
  }

  .demo-back-link:hover {
    background: rgba(124, 58, 237, 0.07);
  }

  @media (max-width: 720px) {
    .demo-header-label,
    .demo-badge {
      display: none;
    }
  }

  * {
    box-sizing: border-box;
  }

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

body {
    margin: 0;
    background: var(--snow);
    color: var(--tx);
    font-family: var(--f);
  }

  body.has-budget-modal {
    overflow: hidden;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  button,
  input,
  select,
  textarea {
    font: inherit;
  }

  button {
    cursor: pointer;
  }

  [hidden] {
    display: none !important;
  }

  .text-accent {
    color: var(--p600);
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.7rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--r);
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.2s ease;
  }

  .btn:hover {
    transform: translateY(-1px);
  }

  .btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
  }

  .btn-primary {
    background: var(--p600);
    color: #fff;
  }

  .btn-primary:hover {
    background: var(--p700);
  }

  .btn-secondary {
    background: var(--white);
    border-color: var(--bdr);
    color: var(--tx2);
  }

  .btn-secondary:hover {
    background: var(--snow);
  }

  .btn-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
  }

  .btn-danger:hover {
    background: #fee2e2;
  }

  .btn-ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.92);
  }

  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .btn-light {
    background: #fff;
    color: var(--tx);
  }

  .btn-light:hover {
    opacity: 0.92;
  }

  .btn-dark-outline {
    background: transparent;
    border-color: var(--tx2);
    color: #fff;
  }

  .btn-dark-outline:hover {
    background: var(--tx);
  }

  .btn-small {
    min-height: 2.5rem;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
  }

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
  }

  .badge-accent {
    border: 1px solid var(--p200);
    background: var(--p50);
    color: var(--p600);
  }

  .badge-success {
    background: #dcfce7;
    color: #15803d;
  }

  .badge-draft {
    background: var(--lav);
    color: var(--tx2);
  }

  .badge-orange {
    background: var(--p50);
    color: var(--p700);
  }

  .badge-emerald {
    background: #d1fae5;
    color: #047857;
  }

  .pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    min-height: 1.75rem;
    padding: 0 0.5rem;
    border-radius: 0.5rem;
    background: var(--lav);
    color: var(--tx2);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.8rem;
    background: var(--p600);
    box-shadow: var(--sh-xs);
  }

  .logo-word {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
  }

  .logo-word span {
    color: var(--p600);
  }

  .landing-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--p900);
    color: #fff;
  }

  .landing-box {
    max-width: 42rem;
    text-align: center;
  }

  .landing-badge {
    display: inline-block;
    margin-bottom: 1rem;
    border: 1px solid var(--p400);
    border-radius: 999px;
    padding: 0.35rem 1rem;
    font-size: 0.9rem;
    color: var(--p200);
  }

  .landing-box h1 {
    margin: 0 0 1rem;
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    line-height: 1.1;
    font-weight: 700;
  }

  .landing-box p {
    margin: 0;
    color: var(--p300);
    font-size: 1.1rem;
    line-height: 1.6;
  }

  .landing-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
  }

  .auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--snow);
  }

  .auth-simple-card {
    width: 100%;
    max-width: 28rem;
    border: 1px solid var(--bdr);
    border-radius: var(--rxl);
    background: var(--white);
    padding: 2rem;
    box-shadow: var(--sh-sm);
  }

  .auth-simple-card h1 {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--tx);
  }

  .auth-simple-card p {
    margin: 0.5rem 0 0;
    color: var(--tx2);
    line-height: 1.5;
  }

  .auth-brand-inline {
    font-weight: 700;
    color: var(--tx);
  }

  .auth-form {
    margin-top: 1.5rem;
    display: grid;
    gap: 1rem;
  }

  .auth-form input {
    width: 100%;
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 0.9rem 1rem;
    outline: none;
    transition: 0.2s ease;
  }

  .auth-form input:focus {
    border-color: var(--p600);
    box-shadow: var(--focus-ring);
  }

  .auth-submit {
    width: 100%;
  }

  .auth-footer {
    margin-top: 1.5rem;
    font-size: 0.95rem;
  }

  .text-link {
    color: var(--p600);
    font-weight: 500;
  }

  .public-shell {
    width: min(72rem, calc(100% - 2rem));
    margin: 2rem auto;
  }

  .public-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .public-nav-actions {
    display: flex;
    gap: 0.75rem;
  }

  .app-shell {
    min-height: calc(100vh - var(--demo-header-height));
    display: flex;
    background: var(--snow);
  }

  .app-sidebar {
    position: fixed;
    inset: var(--demo-header-height) auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--app-sidebar-width);
    background: linear-gradient(to bottom, var(--p700), var(--p500));
  }

  .app-sidebar-top {
    display: flex;
    align-items: center;
    height: 92px;
    padding: 0 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: var(--white);
  }

  .sidebar-nav {
    flex: 1;
    padding: 0.7rem 0.75rem;
    gap: 0.2rem;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.86rem;
    font-weight: 500;
    height: 50px;
  }

  .nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
  }

  .nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: var(--sh-xs);
  }

  .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    font-size: 0.85rem;
  }

  .sidebar-footer {
    padding: 0.55rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .app-main {
    flex: 1;
    margin-left: var(--app-sidebar-width);
    min-width: 0;
  }

  .app-content {
    min-height: calc(100vh - var(--demo-header-height));
    padding: 2rem;
  }

  .app-surface {
    min-height: calc(100vh - var(--demo-header-height) - 4rem);
    border: 1px solid var(--bdr);
    border-radius: var(--rxl);
    background: var(--white);
    padding: 2rem;
    box-shadow: var(--sh-sm);
  }

  .page-card,
  .metric-card {
    border: 1px solid var(--bdr);
    border-radius: var(--rxl);
    background: var(--white);
    padding: 1.5rem;
    box-shadow: var(--sh-sm);
  }

  .page-title-block {
    margin-bottom: 1.5rem;
  }

  .page-title-block h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
  }

  .page-title-block p {
    margin: 0.5rem 0 0;
    color: var(--tx2);
  }

  .page-hero {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .page-hero-dashboard {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .page-hero-copy h1,
  .intro-title {
    margin: 1rem 0 0;
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
  }

  .page-hero-copy p,
  .intro-copy {
    margin: 0.75rem 0 0;
    max-width: 42rem;
    color: var(--tx2);
    line-height: 1.6;
  }

  .page-hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .metric-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 2rem;
  }

  .metric-card p {
    margin: 0;
    color: var(--tx3);
    font-size: 0.9rem;
  }

  .metric-card strong {
    display: block;
    margin-top: 0.75rem;
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.03em;
  }

  .metric-card small {
    display: block;
    margin-top: 0.5rem;
    color: var(--tx3);
    font-size: 0.8rem;
  }

  .card-tone-blue {
    background: #eef5ff;
    border-color: #cfe0ff;
  }

  .card-tone-orange {
    background: var(--p50);
    border-color: var(--p200);
  }

  .card-tone-green {
    background: #eefaf2;
    border-color: #cfead8;
  }

  .card-tone-yellow {
    background: #fff9e9;
    border-color: #f5e2a8;
  }

  .dashboard-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }

  .panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
  }

  .panel-head h2,
  .section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
  }

  .panel-head p,
  .section-copy {
    margin: 0.35rem 0 0;
    color: var(--tx3);
    font-size: 0.9rem;
  }

  .bar-chart {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    min-height: 320px;
    align-items: end;
  }

  .bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .bar-meter {
    display: flex;
    align-items: flex-end;
    width: 100%;
    height: 240px;
    border-radius: 1rem;
    background: var(--snow);
    padding: 0 0.35rem 0.35rem;
  }

  .bar-fill {
    width: 100%;
    border-radius: 0.625rem 0.625rem 0 0;
    background: var(--p600);
  }

  .bar strong {
    display: block;
    width: 100%;
    text-align: center;
    color: var(--tx3);
    font-size: 0.75rem;
    font-weight: 500;
  }

  .bar strong small {
    display: block;
    margin-top: 0.3rem;
    color: var(--tx);
    font-size: 0.75rem;
    font-weight: 600;
  }

  .status-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
  }

  .donut {
    position: relative;
    width: 180px;
    height: 180px;
    border-radius: 999px;
  }

  .donut::after {
    content: "";
    position: absolute;
    inset: 36px;
    border-radius: 999px;
    background: var(--white);
  }

  .donut-value {
    position: absolute;
    inset: 0;
  }

  .status-legend {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .status-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--tx2);
    font-size: 0.9rem;
  }

  .status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
  }

  .recent-list {
    display: grid;
    gap: 0.75rem;
  }

  .recent-item {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--snow);
    transition: 0.2s ease;
  }

  .recent-item:hover {
    transform: translateY(-2px);
    border-color: var(--p300);
    background: var(--white);
  }

  .recent-item strong {
    display: block;
    color: var(--tx);
  }

  .recent-item small {
    display: block;
    margin-top: 0.35rem;
    color: var(--tx3);
  }

  .recent-item > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .recent-item .badge {
    width: fit-content;
  }

  @media (min-width: 768px) {
    .recent-item {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
    }

    .recent-item > div:last-child {
      align-items: flex-end;
    }
  }

  .empty-inline-state {
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--snow);
    padding: 2rem;
    text-align: center;
  }

  .empty-inline-state p {
    margin: 0 0 1rem;
    color: var(--tx2);
  }

  .toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .toolbar-left,
  .toolbar-right,
  .actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
  }

  .field {
    width: 100%;
  }

  .budget-toolbar-left {
    flex: 1 1 0;
    flex-wrap: nowrap;
  }

  .budget-search-field {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  .budget-filter-field {
    flex: 0 0 220px;
    width: 220px;
  }

  .field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--tx2);
    font-size: 0.9rem;
    font-weight: 500;
  }

  .field input,
  .field select,
  .field textarea {
    width: 100%;
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    background: var(--white);
    padding: 0.9rem 1rem;
    color: var(--tx);
    outline: none;
    transition: 0.2s ease;
  }

  .field input:focus,
  .field select:focus,
  .field textarea:focus {
    border-color: var(--p600);
    box-shadow: var(--focus-ring);
  }

  .field textarea {
    min-height: 6rem;
    resize: vertical;
  }

  .field-search {
    position: relative;
  }

  .field-search::before {
    content: "\2315";
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--txm);
    font-size: 1rem;
  }

  .field-search input {
    padding-left: 2.7rem;
  }

  .table-wrap {
    overflow: auto;
    border: 1px solid var(--bdr);
    border-radius: 1rem;
  }

  table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
  }

  thead {
    background: var(--snow);
  }

  th,
  td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--bdr);
    vertical-align: middle;
  }

  th {
    color: var(--tx3);
    font-size: 0.875rem;
    font-weight: 500;
  }

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

  .budget-title strong {
    display: block;
  }

  .budget-title small {
    display: block;
    margin-top: 0.25rem;
    color: var(--tx3);
  }

  .budget-status-cell {
    width: 150px;
  }

  .budget-actions-cell {
    width: 132px;
    text-align: right;
  }

  .table-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 2rem;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
  }

  .table-status-draft {
    background: var(--lav);
    color: var(--tx2);
  }

  .table-status-finalized {
    background: var(--p100);
    color: var(--p600);
  }

  .table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
  }

  .icon-btn {
    width: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
  }

  .table-icon-btn {
    height: 3rem;
    width: 3rem;
    min-width: 3rem;
    border-radius: 1rem;
    border-color: var(--bdr);
    color: var(--tx3);
    background: var(--white);
  }

  .table-icon-btn:hover {
    background: var(--snow);
    color: var(--tx2);
  }

  .table-meta {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--tx3);
    font-size: 0.9rem;
  }

  .pagination-mock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .detail-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }

  .stack {
    display: grid;
    gap: 1.5rem;
  }

  .detail-list {
    display: grid;
    gap: 0.75rem;
    font-size: 0.95rem;
  }

  .detail-list p,
  .detail-copy {
    margin: 0;
    line-height: 1.6;
    color: var(--tx2);
  }

  .detail-copy {
    color: var(--tx3);
  }

  .item-list {
    display: grid;
    gap: 1rem;
  }

  .budget-item {
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--snow);
    padding: 1rem;
  }

  .budget-item-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }

  .budget-item p {
    margin: 0.5rem 0 0;
    color: var(--tx3);
    line-height: 1.5;
  }

  .item-meta {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--tx2);
    font-size: 0.9rem;
  }

  .summary-card {
    position: sticky;
    top: calc(var(--demo-header-height) + 1.5rem);
    align-self: start;
  }

  .summary-block {
    display: grid;
    gap: 0.25rem;
  }

  .summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
  }

  .summary-total {
    padding-top: 0.85rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--bdr);
    font-size: 1rem;
    font-weight: 600;
  }

  .mini-card {
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--snow);
    padding: 1rem;
  }

  .mini-card strong {
    display: block;
    margin-top: 0.35rem;
  }

  .form-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
  }

  .sticky-column {
    position: sticky;
    top: calc(var(--demo-header-height) + 1.5rem);
    align-self: start;
  }

  .item-form-list {
    display: grid;
    gap: 1rem;
  }

  .item-form-card {
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--snow);
    padding: 1rem;
  }

  .budget-modal-layer {
    position: fixed;
    inset: var(--demo-header-height) 0 0 var(--app-sidebar-width);
    z-index: 160;
  }

  .budget-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .budget-modal-shell {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    padding: 1.5rem;
  }

  .budget-modal-panel {
    position: relative;
    width: min(1100px, 100%);
    max-height: calc(100% - 1rem);
    overflow: auto;
    padding: 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 2rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #fbfbfd 100%);
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
  }

  .budget-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--bdr);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--tx2);
    box-shadow: var(--sh-sm);
  }

  .budget-modal-close:hover {
    background: var(--white);
  }

  .budget-modal-content .intro-card {
    padding-right: 4.5rem;
  }

  .budget-modal-panel .sticky-column {
    top: 1.5rem;
  }

  .budget-form-modal {
    padding-bottom: 0.25rem;
  }

  .item-total-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bdr);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
  }

  .helper {
    margin: 0.35rem 0 0;
    color: var(--tx3);
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .color-row input[type="color"] {
    width: 4rem;
    min-width: 4rem;
    height: 3rem;
    padding: 0.25rem;
  }

  .profile-actions {
    display: flex;
    justify-content: flex-end;
  }

  .empty-state {
    border: 1px dashed var(--bdr-h);
    border-radius: 1rem;
    background: var(--snow);
    padding: 2rem;
    text-align: center;
    color: var(--tx2);
  }

  .toast-stack {
    position: fixed;
    top: calc(var(--demo-header-height) + 1rem);
    right: 1rem;
    z-index: 100;
    display: grid;
    gap: 0.75rem;
    width: min(22rem, calc(100% - 2rem));
  }

  .toast {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid var(--bdr);
    border-radius: 1rem;
    background: var(--white);
    box-shadow: var(--sh-sm);
    animation: toast-in 0.2s ease;
  }

  .toast::before {
    content: "";
    display: block;
    width: 0.75rem;
    height: 0.75rem;
    margin-top: 0.3rem;
    border-radius: 999px;
    background: var(--p600);
    flex: 0 0 auto;
  }

  .toast.success::before {
    background: #16a34a;
  }

  .toast.error::before {
    background: #dc2626;
  }

  .toast strong {
    display: block;
    margin-bottom: 0.2rem;
  }

  .toast p {
    margin: 0;
    color: var(--tx3);
    line-height: 1.5;
    font-size: 0.9rem;
  }

  @keyframes toast-in {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @media (max-width: 1100px) {
    .metric-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .detail-grid,
    .form-grid {
      grid-template-columns: 1fr;
    }

    .summary-card,
    .sticky-column {
      position: static;
    }
  }

  @media (max-width: 960px) {
    .app-shell {
      display: block;
    }

    .app-sidebar {
      position: static;
      width: 100%;
    }

    .app-main {
      margin-left: 0;
    }

    .budget-modal-layer {
      left: 0;
    }

    .app-content {
      padding-top: 1.5rem;
    }
  }

  @media (max-width: 720px) {
    .landing-box h1 {
      font-size: 2.2rem;
    }

    .page-hero-dashboard,
    .toolbar,
    .toolbar-left,
    .toolbar-right,
    .actions-row,
    .panel-head,
    .table-meta,
    .public-nav {
      flex-direction: column;
      align-items: stretch;
    }

    .metric-grid,
    .field-grid {
      grid-template-columns: 1fr;
    }

    .app-content,
    .app-surface {
      padding-left: 1rem;
      padding-right: 1rem;
    }

    .app-surface {
      padding-top: 1.25rem;
      padding-bottom: 1.25rem;
    }

    .budget-modal-shell {
      padding: 0.75rem;
    }

    .budget-modal-panel {
      padding: 0.85rem;
      border-radius: 1.5rem;
    }

    .budget-modal-content .intro-card {
      padding-right: 3.75rem;
    }

    .budget-modal-close {
      top: 0.75rem;
      right: 0.75rem;
    }

    .auth-simple-card,
    .page-card,
    .metric-card {
      padding: 1.25rem;
    }

    .budget-toolbar-left {
      flex-direction: row;
      align-items: center;
      flex-wrap: nowrap;
    }

    .budget-filter-field {
      flex-basis: 220px;
    }
  }
