:root {
      --primary:     #5A189A;
      --primary-dk:  #240046;
      --accent:      #f97316;
      --accent-h:    #ea580c;
      --bg:          #f3f0f8;
      --surface:     #ffffff;
      --border:      #e0d4f0;
      --text:        #1f2937;
      --muted:       #6b7280;
      --green:       #16a34a;
      --green-bg:    #dcfce7;
      --amber:       #d97706;
      --amber-bg:    #fef3c7;
      --red:         #dc2626;
      --red-bg:      #fee2e2;
      --shadow:      0 2px 10px rgba(0,0,0,0.07);
      --shadow-lg:   0 6px 24px rgba(36,0,70,0.14);
      --radius:      10px;
    }
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; width: 100%; max-width: 100%; }
    body {
      font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
      background: radial-gradient(circle at top, rgba(249,115,22,0.10), transparent 28%),
                  linear-gradient(180deg, #f6f2fb 0%, #f2f0f5 100%);
      color: var(--text);
      line-height: 1.55;
      min-height: 100vh;
      overflow-x: hidden;
      width: 100%;
      max-width: 100%;
    }

    /* -- Header -- */
    .fin-header {
      background: linear-gradient(135deg, #240046 0%, #5a189a 54%, #8c3fd1 100%);
      color: #fff;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      box-shadow: 0 4px 20px rgba(36,0,70,0.22);
      position: relative;
      z-index: 250;
    }
    .fin-header-brand h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
    .fin-header-brand p  { font-size: 0.75rem; opacity: 0.72; margin-top: 1px; }
    .fin-header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
    .back-btn {
      color: rgba(255,255,255,0.8);
      font-size: 0.78rem; font-weight: 600;
      text-decoration: none;
      border: 1px solid rgba(255,255,255,0.3);
      padding: 5px 13px; border-radius: 6px;
      transition: all 0.15s; white-space: nowrap;
    }
    .back-btn:hover { color: #fff; background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }
    .fin-header #occAuthMini {
      margin-left: auto;
      flex-shrink: 0;
    }

    /* -- Reporting period toolbar -- */
    :root { --fin-tabnav-h: 43px; }
    .report-toolbar {
      background: rgba(255,255,255,0.94);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 8px 18px rgba(36,0,70,0.08);
      position: sticky;
      top: var(--fin-tabnav-h);
      z-index: 210;
      backdrop-filter: blur(10px);
    }
    .report-toolbar-inner {
      width: min(100%, 1320px);
      margin: 0 auto;
      padding: 8px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }
    .report-meta {
      display: flex;
      align-items: baseline;
      gap: 10px;
      min-width: 260px;
    }
    .report-meta span {
      font-size: 0.67rem;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }
    .report-meta strong {
      color: var(--primary-dk);
      font-size: 0.95rem;
      line-height: 1.2;
      white-space: nowrap;
    }
    .fy-segmented {
      display: inline-flex;
      gap: 3px;
      padding: 3px;
      background: #ede9f5;
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .fy-segmented::-webkit-scrollbar { display: none; }
    .fy-dropdown {
      display: none;
      width: 100%;
      max-width: 260px;
      padding: 8px 12px;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      background: #fff;
      color: var(--primary-dk);
      font-family: inherit;
      font-size: 0.88rem;
      font-weight: 800;
    }
    .fy-dropdown:focus {
      outline: 3px solid rgba(249,115,22,0.3);
      border-color: var(--accent);
    }
    .report-toolbar.dropdown-mode .fy-segmented { display: none; }
    .report-toolbar.dropdown-mode .fy-dropdown { display: block; }
    .fy-option {
      border: 0;
      background: transparent;
      color: var(--primary-dk);
      border-radius: 6px;
      cursor: pointer;
      font-family: inherit;
      font-size: 0.82rem;
      font-weight: 800;
      padding: 6px 13px;
      white-space: nowrap;
      transition: all 0.15s;
    }
    .fy-option:hover { background: rgba(90,24,154,0.10); }
    .fy-option.active {
      background: var(--primary);
      color: #fff;
      box-shadow: 0 4px 12px rgba(90,24,154,0.22);
    }
    .fy-option:focus-visible { outline: 3px solid rgba(249,115,22,0.35); }

    /* -- Tab Nav -- */
    .fin-tab-nav {
      background: var(--primary-dk);
      padding: 7px 20px;
      position: sticky;
      top: 0;
      z-index: 220;
      box-shadow: 0 4px 14px rgba(36,0,70,0.18);
    }
    .fin-tab-nav-inner {
      width: min(100%, 1320px);
      margin: 0 auto;
      display: flex;
      justify-content: center;
      gap: 3px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .fin-tab-nav-inner::-webkit-scrollbar { display: none; }
    .mobile-tab-picker {
      display: none;
      width: 100%;
      color: rgba(255,255,255,0.78);
      font-size: 0.68rem;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .mobile-tab-picker select {
      width: 100%;
      margin-top: 4px;
      padding: 9px 12px;
      border: 1px solid rgba(255,255,255,0.24);
      border-radius: 8px;
      background: rgba(255,255,255,0.10);
      color: #fff;
      font-family: inherit;
      font-size: 0.92rem;
      font-weight: 800;
      outline: none;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
    }
    .mobile-tab-picker select:focus {
      border-color: rgba(249,115,22,0.9);
      box-shadow: 0 0 0 3px rgba(249,115,22,0.25);
    }
    .mobile-tab-picker option {
      color: var(--primary-dk);
      background: #fff;
    }
    .tab-btn {
      background: rgba(255,255,255,0.08);
      color: rgba(255,255,255,0.7);
      border: none; padding: 6px 18px;
      border-radius: 6px; font-size: 0.84rem;
      font-weight: 600; cursor: pointer;
      white-space: nowrap; font-family: inherit;
      transition: all 0.15s;
    }
    .tab-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
    .tab-btn.active { background: var(--accent); color: #fff; }

    /* -- Tab Panels -- */
    .tab-panel { display: none; padding: 20px; width: min(100%, 1320px); margin: 0 auto; }
    .tab-panel.active { display: block; }

    /* -- KPI Grid -- */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 175px), 1fr));
      gap: 10px; margin-bottom: 18px;
    }
    .kpi-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 13px 14px;
      box-shadow: var(--shadow);
      min-width: 0;
    }
    .kpi-label { font-size: 0.72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
    .kpi-value { font-size: 1.28rem; font-weight: 700; color: var(--primary-dk); letter-spacing: 0; line-height: 1.1; }
    .kpi-sub   { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
    .kpi-card.pos .kpi-value { color: var(--green); }
    .kpi-card.neg .kpi-value { color: var(--red); }
    .kpi-card.warn .kpi-value { color: var(--amber); }

    /* -- Charts -- */
    .charts-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr));
      gap: 16px; margin-bottom: 18px;
    }
    .chart-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px; box-shadow: var(--shadow);
      min-width: 0;
      overflow: hidden;
    }
    .chart-card h3 {
      font-size: 0.72rem; font-weight: 700;
      color: var(--muted); text-transform: uppercase;
      letter-spacing: 0.05em; margin-bottom: 14px;
      overflow-wrap: anywhere;
    }
    .chart-card-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 14px;
    }
    .chart-card-head h3 { margin-bottom: 0; }
    .chart-controls {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px;
      flex-wrap: wrap;
    }
    .yoy-fy-picks {
      display: inline-flex;
      gap: 3px;
      padding: 3px;
      background: #f3f0f8;
      border: 1px solid var(--border);
      border-radius: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .yoy-fy {
      border: 0;
      background: transparent;
      color: var(--primary-dk);
      border-radius: 6px;
      cursor: pointer;
      font-family: inherit;
      font-size: 0.72rem;
      font-weight: 800;
      padding: 4px 9px;
      white-space: nowrap;
    }
    .yoy-fy.active {
      background: var(--primary);
      color: #fff;
    }
    .yoy-fy-selects {
      display: inline-flex;
      gap: 6px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .yoy-fy-selects select {
      padding: 5px 8px;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      background: #fff;
      color: var(--primary-dk);
      font-family: inherit;
      font-size: 0.74rem;
      font-weight: 800;
    }
    .chart-toggle-group {
      display: inline-flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }
    .chart-toggle {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 700;
      white-space: nowrap;
      cursor: pointer;
    }
    .chart-toggle input {
      width: 15px;
      height: 15px;
      accent-color: var(--primary);
    }
    .chart-card canvas {
      display: block;
      width: 100% !important;
      max-width: 100%;
      height: 310px !important;
      max-height: 310px;
    }
    #chartExpCat {
      height: 310px;
      min-height: 310px;
    }
    .ratio-summary {
      display: grid;
      gap: 12px;
      margin: 4px 0 12px;
      min-width: 0;
    }
    .ratio-hero {
      display: flex;
      align-items: baseline;
      gap: 10px;
      color: var(--primary-dk);
    }
    .ratio-hero span {
      font-size: 2rem;
      line-height: 1;
      font-weight: 800;
    }
    .ratio-hero small {
      color: var(--muted);
      font-weight: 700;
    }
    .ratio-meta {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
      gap: 8px;
    }
    .ratio-meta span,
    .ratio-empty {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #faf8ff;
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 700;
      padding: 8px 10px;
    }
    .ratio-meta strong {
      display: block;
      color: var(--primary-dk);
      font-size: 0.88rem;
      margin-top: 1px;
    }
    .dashboard-admin {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
      gap: 16px;
      margin-top: 18px;
    }
    .import-card {
      border-color: #8b5cf6;
      border-width: 1.5px;
    }
    .data-card {
      border: 1.5px solid #fbbf24;
      background: var(--amber-bg);
    }
    .data-card .card-title { color: #78350f; }

    /* -- Cards -- */
    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px 20px; box-shadow: var(--shadow);
      margin-bottom: 16px;
      min-width: 0;
    }
    .card-title {
      font-size: 0.92rem; font-weight: 700;
      color: var(--primary-dk);
      margin-bottom: 14px;
      display: flex; align-items: center; gap: 8px;
    }

    /* -- Banners -- */
    .banner {
      display: flex; align-items: center; gap: 12px;
      padding: 11px 16px; border-radius: 8px;
      font-size: 0.87rem; font-weight: 600;
      margin-bottom: 16px;
    }
    .banner.ok   { background: var(--green-bg); color: #14532d; border: 1.5px solid #86efac; }
    .banner.warn { background: var(--amber-bg); color: #78350f; border: 1.5px solid #fde68a; }
    .banner.info { background: #ede9f5; color: var(--primary-dk); border: 1.5px solid var(--border); }

    /* -- Pending card -- */
    .pending-card {
      background: var(--surface);
      border: 1.5px solid #fbbf24;
      border-radius: var(--radius);
      padding: 16px 18px; box-shadow: var(--shadow);
      margin-bottom: 16px;
    }
    .pending-card h3 {
      font-size: 0.72rem; font-weight: 700;
      color: #92400e; text-transform: uppercase;
      letter-spacing: 0.05em; margin-bottom: 12px;
    }
    .pending-item {
      display: flex; align-items: flex-start; gap: 10px;
      padding: 8px 0; border-bottom: 1px solid #fef3c7;
      font-size: 0.84rem;
    }
    .pending-item:last-child { border-bottom: none; }
    .pi-icon  { color: var(--amber); flex-shrink: 0; margin-top: 2px; }
    .pi-desc  { flex: 1; min-width: 0; }
    .pi-amt   { font-weight: 700; white-space: nowrap; font-family: monospace; }
    .pi-link  { color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
    .pi-link:hover { text-decoration: underline; }

    /* -- Tables -- */
    .table-wrap { overflow-x: auto; }
    table { width: 100%; border-collapse: collapse; font-size: 0.855rem; }
    th {
      background: var(--primary-dk); color: #fff;
      font-size: 0.72rem; font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.04em;
      padding: 9px 12px; text-align: left; white-space: nowrap;
    }
    th.sortable { cursor: pointer; user-select: none; }
    th.sortable:hover { background: #3a006a; }
    th.r, td.r { text-align: right; }
    td {
      padding: 8px 12px; border-bottom: 1px solid var(--border);
      color: var(--text); vertical-align: middle;
    }
    tr.row-review td    { background: #fffbeb; }
    tr.row-review:hover td { background: #fef9e0; }
    tr.row-ok:hover td  { background: #fafafa; }
    tr.row-ok td        { background: #fff; }
    .table-footer {
      display: flex; justify-content: space-between; align-items: center;
      padding: 9px 14px; background: var(--primary-dk);
      color: #fff; font-weight: 700; font-size: 0.84rem;
      border-radius: 0 0 var(--radius) var(--radius);
    }
    .no-rows { text-align: center; color: var(--muted); padding: 28px 12px; }

    /* -- Badges -- */
    .badge {
      display: inline-flex; align-items: center; gap: 3px;
      padding: 2px 9px; border-radius: 20px;
      font-size: 0.7rem; font-weight: 700; white-space: nowrap;
    }
    .badge-ok     { background: var(--green-bg); color: #15803d; }
    .badge-review { background: var(--amber-bg); color: #b45309; cursor: pointer; }
    .badge-review:hover { background: #fde68a; }

    /* -- Buttons -- */
    .btn {
      display: inline-flex; align-items: center; gap: 5px;
      padding: 7px 15px; border-radius: 7px;
      font-family: inherit; font-size: 0.84rem;
      font-weight: 600; cursor: pointer; border: none;
      transition: all 0.15s; white-space: nowrap;
    }
    .btn-primary { background: var(--primary); color: #fff; }
    .btn-primary:hover { background: var(--primary-dk); }
    .btn-accent  { background: var(--accent); color: #fff; }
    .btn-accent:hover  { background: var(--accent-h); }
    .btn-ghost   { background: transparent; color: var(--primary); border: 1.5px solid var(--border); }
    .btn-ghost:hover   { background: var(--bg); }
    .btn-danger  { background: var(--red-bg); color: #991b1b; border: none; }
    .btn-danger:hover  { background: #fecaca; }
    .btn-sm { padding: 4px 10px; font-size: 0.78rem; }

    /* -- Filter bar -- */
    .filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
    .filter-bar select, .filter-bar input[type="text"] {
      padding: 6px 10px; border: 1.5px solid var(--border);
      border-radius: 7px; font-family: inherit;
      font-size: 0.84rem; background: #fff; color: var(--text);
    }
    .filter-bar select:focus, .filter-bar input:focus {
      outline: 3px solid rgba(249,115,22,0.3);
      border-color: var(--accent);
    }
    .filter-actions { margin-left: auto; display: flex; gap: 8px; }
    .ledger-summary {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 10px;
      margin: 0 0 12px;
    }
    .ledger-stat {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 11px 13px;
      box-shadow: var(--shadow);
    }
    .ledger-stat .label {
      font-size: 0.68rem;
      font-weight: 800;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 4px;
    }
    .ledger-stat .value {
      font-size: 1rem;
      font-weight: 800;
      color: var(--primary-dk);
    }
    .ledger-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      margin-bottom: 12px;
      flex-wrap: wrap;
    }
    .ledger-page-size {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 800;
    }
    .ledger-page-size select {
      padding: 5px 9px;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      background: #fff;
      color: var(--text);
      font-family: inherit;
      font-weight: 700;
    }

    /* -- Add form -- */
    .add-form-wrap {
      background: #f8f4ff;
      border: 1.5px solid var(--border);
      border-radius: var(--radius);
      padding: 16px 18px; margin-bottom: 16px;
      display: none;
    }
    .add-form-wrap.open { display: block; }
    .add-form-wrap h3 { font-size: 0.9rem; font-weight: 700; color: var(--primary-dk); margin-bottom: 12px; }
    .form-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
      gap: 10px; margin-bottom: 12px;
    }
    .form-group { display: flex; flex-direction: column; gap: 4px; }
    .form-group label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
    .form-group input, .form-group select, .form-group textarea {
      padding: 6px 10px;
      border: 1.5px solid var(--border);
      border-radius: 6px; font-family: inherit;
      font-size: 0.84rem; background: #fff; color: var(--text);
    }
    .form-group input:focus, .form-group select:focus {
      outline: 3px solid rgba(249,115,22,0.3);
      border-color: var(--accent);
    }
    .cb-row { flex-direction: row; align-items: center; gap: 8px; padding-top: 18px; }
    .cb-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
    .form-actions { display: flex; gap: 8px; align-items: center; }

    /* -- Tax Summary -- */
    .tax-section { margin-bottom: 6px; }
    .tax-section-hd {
      background: var(--bg); padding: 6px 12px; border-radius: 6px;
      font-size: 0.73rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.05em; color: var(--muted);
      cursor: pointer; display: flex; justify-content: space-between;
      align-items: center; margin-bottom: 2px;
    }
    .tax-section-hd:hover { background: #ede9f5; }
    .tax-section-body { padding: 0 4px; }
    .tax-section-body.collapsed { display: none; }
    .tax-row {
      display: flex; justify-content: space-between; align-items: center;
      padding: 7px 2px; border-bottom: 1px solid var(--border); font-size: 0.88rem;
    }
    .tax-row:last-child { border-bottom: none; }
    .tax-row .tl { color: var(--muted); }
    .tax-row .ta { font-weight: 600; font-family: 'Courier New', monospace; font-size: 0.9rem; }
    .tax-row.sub .tl { padding-left: 16px; font-size: 0.82rem; }
    .tax-row.sub .ta { font-size: 0.82rem; color: var(--muted); font-weight: 400; }
    .tax-divider {
      display: flex; justify-content: space-between; align-items: center;
      padding: 10px 2px; font-weight: 700; font-size: 0.95rem;
      border-top: 2px solid var(--primary); color: var(--primary-dk);
      margin-top: 4px;
    }
    .tax-divider .ta { font-family: 'Courier New', monospace; }
    .c-green { color: var(--green); }
    .c-red   { color: var(--red); }
    .c-amber { color: var(--amber); }

    /* -- Lodge status -- */
    .lodge-status {
      display: flex; align-items: center; gap: 10px;
      padding: 12px 16px; border-radius: 8px;
      font-weight: 600; font-size: 0.9rem; margin-bottom: 16px;
    }
    .lodge-status.ready    { background: var(--green-bg); color: #14532d; border: 1.5px solid #86efac; }
    .lodge-status.not-ready { background: var(--amber-bg); color: #78350f; border: 1.5px solid #fde68a; }

    /* -- Equity cards -- */
    .equity-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
      gap: 14px; margin-bottom: 20px;
    }
    .equity-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
    }
    .eq-name  { font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
    .eq-total { font-size: 1.35rem; font-weight: 700; color: var(--primary-dk); margin-bottom: 8px; }
    .eq-row   { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); padding: 2px 0; }
    .eq-row span:last-child { font-weight: 600; color: var(--text); }
    .capital-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 12px;
      margin-bottom: 16px;
    }
    .capital-toolbar .text-muted {
      font-size: 0.82rem;
      max-width: 680px;
    }
    .capital-summary {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
      gap: 12px;
      margin-bottom: 16px;
    }
    .capital-stat {
      background: rgba(90,24,154,0.04);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
    }
    .capital-stat .label {
      font-size: 0.7rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 6px;
    }
    .capital-stat .value {
      font-size: 1.02rem;
      font-weight: 700;
      color: var(--primary-dk);
    }
    .capital-stat.review {
      background: #fffbeb;
      border-color: #fde68a;
    }
    .capital-stat.review .value {
      color: #b45309;
    }
    .capital-form-grid .form-span-2 {
      grid-column: span 2;
    }
    .capital-form-grid .cb-row {
      align-self: end;
      padding-bottom: 6px;
    }
    .table-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: flex-end;
      flex-wrap: wrap;
    }

    /* -- Drop zone -- */
    .drop-zone {
      border: 2.5px dashed var(--primary); border-radius: 12px;
      padding: clamp(20px, 5vw, 42px) clamp(14px, 4vw, 24px); text-align: center; background: #f8f4ff;
      cursor: pointer; transition: all 0.2s;
    }
    .drop-zone:hover, .drop-zone.drag-over { background: #ede9f5; border-color: var(--accent); }
    .drop-zone .dz-icon { font-size: 2.5rem; margin-bottom: 10px; }
    .drop-zone p { color: var(--muted); font-size: 0.88rem; margin: 4px 0; }

    /* -- Section label -- */
    .section-label {
      font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
      letter-spacing: 0.06em; color: var(--muted);
      margin: 20px 0 10px; display: flex; align-items: center; gap: 10px;
    }
    .section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

    /* -- Misc helpers -- */
    .gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .mono { font-family: 'Courier New', monospace; }
    .text-muted { color: var(--muted); font-size: 0.8rem; }
    .ml-auto { margin-left: auto; }

    /* -- Print -- */
    @media print {
      .fin-header, .fin-tab-nav, .report-toolbar, .filter-bar, .filter-actions,
      .btn, .add-form-wrap, #tab-dashboard, #tab-expenses,
      #tab-revenue, #tab-capital { display: none !important; }
      #tab-tax { display: block !important; }
      body { background: white; }
      .card, .chart-card { box-shadow: none; border: 1px solid #ccc; }
      .lodge-status { border: 1px solid #ccc; }
    }

    /* -- Responsive -- */
    @media (max-width: 920px) {
      .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
      .charts-row { grid-template-columns: 1fr; }
      .dashboard-admin { grid-template-columns: 1fr; }
      .capital-toolbar { flex-direction: column; align-items: stretch; }
      .fin-header { align-items: flex-start; }
      .fin-header-brand { min-width: min(100%, 320px); }
      .fin-header-right { justify-content: flex-start; width: 100%; }
      .fin-header #occAuthMini {
        margin-left: auto;
        flex-shrink: 0;
      }
    }
    @media (max-width: 720px) {
      .dashboard-admin { grid-template-columns: 1fr; }
    }

    @media (max-width: 600px) {
      :root { --fin-tabnav-h: 62px; }
      .kpi-grid { grid-template-columns: 1fr; }
      .tab-panel { padding: 12px; }
      .fin-header { flex-wrap: wrap; }
      .fin-header-brand h1 { font-size: 0.98rem; }
      .fin-header-brand p { font-size: 0.68rem; line-height: 1.25; }
      .back-btn { min-height: 44px; display: inline-flex; align-items: center; }
      .fin-tab-nav { padding: 7px 12px; }
      .fin-tab-nav-inner { display: block; }
      .mobile-tab-picker { display: block; }
      .tab-btn { display: none; }
      .report-toolbar-inner { align-items: stretch; flex-direction: column; padding: 8px 12px; gap: 8px; }
      .report-meta { align-items: flex-start; flex-direction: column; gap: 1px; min-width: 0; }
      .fy-segmented { display: none; }
      .fy-dropdown { display: block; max-width: none; }
      .chart-card-head { align-items: stretch; flex-direction: column; }
      .chart-card { padding: 14px; }
      .chart-toggle-group,
      .chart-controls,
      .yoy-fy-selects {
        justify-content: flex-start;
        width: 100%;
      }
      #chartExpCat {
        height: 260px;
        min-height: 260px;
      }
      .chart-card canvas { max-height: 280px; }
      .chart-card canvas { height: 260px !important; }
      .chart-controls { justify-content: flex-start; }
      .yoy-fy-picks { justify-content: flex-start; }
      .ratio-meta { grid-template-columns: 1fr; }
      .ledger-summary { grid-template-columns: 1fr 1fr; }
      .capital-form-grid .form-span-2 { grid-column: span 1; }
      .table-actions { justify-content: flex-start; }
    }

    @media (max-width: 640px) {
      .filter-bar {
        display: grid;
        grid-template-columns: 1fr;
      }
      .filter-bar select,
      .filter-bar input[type="text"],
      .filter-actions,
      .filter-actions .btn {
        width: 100% !important;
      }
      .filter-actions {
        margin-left: 0;
        display: grid;
        grid-template-columns: 1fr;
      }
      .ledger-summary,
      .capital-summary {
        grid-template-columns: 1fr;
      }
      .ledger-toolbar,
      .table-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
      }
      .ledger-page-size,
      .ledger-page-size select {
        width: 100%;
      }
      #tab-expenses table,
      #tab-revenue table,
      #tab-capital table,
      #tab-review table {
        min-width: 0;
      }
      #tab-expenses thead,
      #tab-revenue thead,
      #tab-capital thead,
      #tab-review thead {
        display: none;
      }
      #tab-expenses tbody,
      #tab-expenses tr,
      #tab-expenses td,
      #tab-revenue tbody,
      #tab-revenue tr,
      #tab-revenue td,
      #tab-capital tbody,
      #tab-capital tr,
      #tab-capital td,
      #tab-review tbody,
      #tab-review tr,
      #tab-review td {
        display: block;
        width: 100%;
      }
      #tab-expenses tr,
      #tab-revenue tr,
      #tab-capital tr,
      #tab-review tr {
        border-bottom: 1px solid var(--border);
        padding: 10px 12px;
      }
      #tab-expenses td,
      #tab-revenue td,
      #tab-capital td,
      #tab-review td {
        border: 0;
        padding: 5px 0;
      }
      #tab-expenses td::before,
      #tab-revenue td::before,
      #tab-capital td::before,
      #tab-review td::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 0.66rem;
        font-weight: 800;
        letter-spacing: 0.06em;
        line-height: 1.2;
        margin-bottom: 2px;
        text-transform: uppercase;
      }
      #tab-expenses td:nth-child(1)::before { content: "Date"; }
      #tab-expenses td:nth-child(2)::before { content: "Description"; }
      #tab-expenses td:nth-child(3)::before { content: "Category"; }
      #tab-expenses td:nth-child(4)::before { content: "Supplier"; }
      #tab-expenses td:nth-child(5)::before { content: "Excl. GST"; }
      #tab-expenses td:nth-child(6)::before { content: "GST"; }
      #tab-expenses td:nth-child(7)::before { content: "Total"; }
      #tab-expenses td:nth-child(8)::before { content: "Status"; }
      #tab-expenses td:nth-child(9)::before { content: "Action"; }
      #tab-revenue td:nth-child(1)::before { content: "Date"; }
      #tab-revenue td:nth-child(2)::before { content: "Participant"; }
      #tab-revenue td:nth-child(3)::before { content: "Category"; }
      #tab-revenue td:nth-child(4)::before { content: "Period"; }
      #tab-revenue td:nth-child(5)::before { content: "Plan Manager"; }
      #tab-revenue td:nth-child(6)::before { content: "Amount"; }
      #tab-revenue td:nth-child(7)::before { content: "Status"; }
      #tab-revenue td:nth-child(8)::before { content: "Date Paid"; }
      #tab-revenue td:nth-child(9)::before { content: "Action"; }
      #tab-capital td:nth-child(1)::before { content: "Date"; }
      #tab-capital td:nth-child(2)::before { content: "Shareholder"; }
      #tab-capital td:nth-child(3)::before { content: "Amount"; }
      #tab-capital td:nth-child(4)::before { content: "Method"; }
      #tab-capital td:nth-child(5)::before { content: "Description"; }
      #tab-capital td:nth-child(6)::before { content: "Status"; }
      #tab-capital td:nth-child(7)::before { content: "Action"; }
      #tab-review td:nth-child(1)::before { content: "Date"; }
      #tab-review td:nth-child(2)::before { content: "Description"; }
      #tab-review td:nth-child(3)::before { content: "Debit"; }
      #tab-review td:nth-child(4)::before { content: "Credit"; }
      #tab-review td:nth-child(5)::before { content: "Type"; }
      #tab-review td:nth-child(6)::before { content: "Category"; }
      #tab-review td:nth-child(7)::before { content: "Status"; }
      #tab-review td:nth-child(8)::before { content: "Action"; }
      td.r,
      th.r {
        text-align: left;
      }
      .status-sel,
      .table-actions .btn,
      .gap .btn {
        width: 100%;
      }
      .dashboard-admin .gap {
        align-items: stretch;
        flex-direction: column;
      }
      .drop-zone .dz-icon { font-size: 1.75rem; }
    }

    /* Very small phones — single column KPI grid */
    @media (max-width: 400px) {
      .kpi-grid { grid-template-columns: 1fr; }
      .ledger-summary { grid-template-columns: 1fr; }
      .tab-panel { padding: 8px; }
    }

    /* iOS Safari zooms on inputs with font-size < 16px — prevent on touch devices */
    @media (hover: none) and (pointer: coarse) {
      input, select, textarea { font-size: max(1rem, 0.9rem) !important; }
      /* Ensure all tappable buttons meet 44px touch target */
      .btn, .tab-btn, .fy-option, .back-btn, .mobile-tab-picker select {
        min-height: 44px;
      }
      .btn-sm { min-height: 38px; }
    }
