
  .ai-close { background: #f1f5f9; border: none; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; color: #64748b; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: bold; transition: 0.2s; }
  .ai-close:active { background: #e2e8f0; color: #e74c3c; transform: scale(0.9); }
  .toast-notification { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 100001; display: none; background: #10b981; color: white; padding: 10px 20px; border-radius: 30px; font-weight: 800; font-size: 13px; box-shadow: 0 10px 30px rgba(16,185,129,0.3); animation: popDown 0.3s ease; }
  @keyframes popDown { from { top: -20px; opacity: 0; } to { top: 30px; opacity: 1; } }
  html body #admin-modal { display: none; position: fixed; inset: 0; z-index: 70000 !important; background: rgba(15,23,42,0.6); align-items: center; justify-content: center; padding: 0 !important; }
  #admin-modal *, #fi-list * , #fi-rp * { box-sizing: border-box; font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
  .fi-box { background: #fff; width: 96vw; max-width: 1180px; height: 92vh; border-radius: 18px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.35); }
  .fi-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px 20px; }
  .fi-head h2 { margin: 0; font-size: 18px; font-weight: 800; color: #0f172a; letter-spacing: -0.2px; white-space: nowrap; }
  .fi-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; background: #e4e9f2; color: #1e2a44; font-size: 11.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .fi-head .grow { flex: 1; min-width: 0; }
  .fi-refresh { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 12px 0 10px; border: 1px solid #cbd5e1; border-radius: 16px; background: #fff; color: #1e2a44; font-size: 12px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
  .fi-refresh:hover { background: #f1f5f9; }
  .fi-upd { font-size: 11px; font-weight: 600; color: #94a3b8; white-space: nowrap; flex: 0 0 auto; margin-right: 2px; }   
  .fi-upd.busy::after { content: ' · updating'; color: #cbd5e1; }
  .fi-refresh svg { width: 16px; height: 16px; fill: currentColor; }
  .fi-refresh.spin svg { animation: fiSpin .8s linear infinite; } @keyframes fiSpin { to { transform: rotate(360deg); } }
  html body .fi-x { width: 34px !important; height: 34px !important; min-width: 34px !important; border-radius: 50% !important; background: #e11d48 !important; color: #fff !important; border: none !important; display: inline-flex !important; align-items: center; justify-content: center; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(225,29,72,.35); cursor: pointer; padding: 0 !important; }
  html body .fi-x:hover { background: #be123c !important; }
  .fi-x svg { width: 20px; height: 20px; fill: #fff; }
  .fi-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 2px 20px 10px; border-bottom: 1px solid #eef2f7; }
  .fi-seg { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
  .fi-seg button { height: 26px; padding: 0 11px; border: none; border-radius: 7px; background: transparent; color: #475569; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
  .fi-seg button:hover { color: #0f172a; }
  .fi-seg button.on { background: #1e2a44; color: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.25); }
  .fi-seg button svg { width: 13px; height: 13px; fill: currentColor; }
  .fi-sw { position: relative; flex: 1; min-width: 200px; max-width: 360px; margin-left: auto; }
  .fi-search { width: 100%; height: 30px; border: 1px solid #cbd5e1; border-radius: 15px; padding: 0 12px 0 30px; font-size: 12px; font-weight: 600; background: #f8fafc; outline: none; color: #0f172a; }
  .fi-search:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
  .fi-sw > svg { position: absolute; left: 10px; top: 8px; width: 14px; height: 14px; fill: #94a3b8; pointer-events: none; }
  .fi-sres { display: none; position: absolute; top: 34px; left: 0; right: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 30px rgba(15,23,42,.16); z-index: 20; max-height: 340px; overflow-y: auto; padding: 4px; }
  .fi-sres.show { display: block; }
  .fi-sr { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: none; text-align: left; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 11.5px; color: #334155; }
  .fi-sr:hover, .fi-sr.act { background: #f1f5f9; }
  .fi-sr b { color: #0f172a; font-weight: 800; white-space: nowrap; }
  .fi-sr .m { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-weight: 600; }
  .fi-sr .v { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .fi-snone { padding: 10px; font-size: 12px; color: #94a3b8; font-weight: 600; text-align: center; }
  .fi-body { flex: 1; overflow-y: auto; padding: 12px 20px 18px; background: #fff; position: relative; }
  .fi-msg { text-align: center; color: #64748b; padding: 40px 10px; font-size: 13px; font-weight: 600; }
  .fi-msg.err { color: #b91c1c; }
  .fi-msg button { margin-top: 10px; height: 30px; padding: 0 14px; border: none; border-radius: 15px; background: #1e2a44; color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
  .fi-dim { opacity: .35; pointer-events: none; transition: opacity .15s; }
  .fi-kpis { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
  .fi-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 12px; background: #fff; cursor: pointer; text-align: left; min-width: 0; transition: box-shadow .15s; }
  .fi-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.08); }
  .fi-card .k { font-size: 10px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fi-card .v { font-size: 17px; font-weight: 800; color: #0f172a; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fi-card .s { font-size: 10.5px; font-weight: 600; color: #64748b; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .fi-card.green { background: #ecfdf5; border-color: #a7f3d0; } .fi-card.green .v { color: #047857; }
  .fi-card.blue { background: #eff6ff; border-color: #bfdbfe; } .fi-card.blue .v { color: #1d4ed8; }
  .fi-card.red { background: #fef2f2; border-color: #fecaca; } .fi-card.red .v { color: #b91c1c; }
  .fi-card.purple { background: #faf5ff; border-color: #e9d5ff; } .fi-card.purple .v { color: #6b21a8; }
  .fi-card.amber { background: #fffbeb; border-color: #fde68a; } .fi-card.amber .v { color: #92400e; }
  .fi-card.slate { background: #f8fafc; border-color: #e2e8f0; } .fi-card.slate .v { color: #0f172a; } .fi-card.slate .v.neg { color: #b91c1c; }
  .fi-sub { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 8px 2px 4px; font-size: 11.5px; color: #64748b; font-weight: 600; }
  .fi-sub b { color: #0f172a; font-weight: 800; font-variant-numeric: tabular-nums; }
  .fi-sub .fi-i { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: 9.5px; font-weight: 900; cursor: help; margin-left: 3px; vertical-align: 1px; font-style: normal; }
  .fi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
  .fi-panel { border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; background: #fff; min-width: 0; }
  .fi-panel.wide { grid-column: 1 / -1; padding: 10px 0 4px; }
  .fi-ph { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
  .fi-panel.wide .fi-ph { padding: 0 12px; }
  .fi-ph h3 { margin: 0; font-size: 11px; font-weight: 800; color: #334155; text-transform: uppercase; letter-spacing: .6px; }
  .fi-lg { display: flex; gap: 10px; font-size: 10px; color: #64748b; font-weight: 700; }
  .fi-lg i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
  .fi-row { display: block; width: 100%; border: none; background: none; text-align: left; padding: 5px 6px; border-radius: 8px; cursor: pointer; }
  .fi-row:hover { background: #f8fafc; }
  .fi-row.sub { padding-left: 20px; }
  .fi-rt { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #334155; font-weight: 700; margin-bottom: 4px; }
  .fi-rt .nm { font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .fi-row.sub .fi-rt .nm { font-weight: 700; color: #475569; }
  .fi-rt .n { font-size: 10.5px; color: #94a3b8; font-weight: 700; }
  .fi-rt .grow { flex: 1; }
  .fi-rt .val { font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .fi-rt .pend { font-size: 10.5px; font-weight: 700; color: #94a3b8; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .fi-badge { display: inline-flex; align-items: center; height: 16px; padding: 0 6px; border-radius: 8px; font-size: 9.5px; font-weight: 800; background: #fef2f2; color: #b91c1c; white-space: nowrap; }
  .fi-track { display: flex; height: 8px; border-radius: 4px; background: #f1f5f9; overflow: hidden; }
  .fi-track span { display: block; height: 100%; }
  .fi-empty { text-align: center; color: #94a3b8; font-size: 12px; font-weight: 600; padding: 18px 0; }
  table.fi-t { width: 100%; border-collapse: collapse; font-size: 12px; }
  table.fi-t th { background: #f8fafc; color: #475569; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid #e2e8f0; }
  table.fi-t td { padding: 6px 8px; border-bottom: 1px solid #f1f5f9; color: #334155; font-weight: 600; white-space: nowrap; }
  table.fi-t .r { text-align: right; font-variant-numeric: tabular-nums; }
  table.fi-t th:first-child, table.fi-t td:first-child { padding-left: 12px; }
  table.fi-t th:last-child, table.fi-t td:last-child { padding-right: 12px; }
  table.fi-t tbody tr.click { cursor: pointer; } table.fi-t tbody tr.click:hover td { background: #f5f7ff; }
  table.fi-t td.b { color: #0f172a; font-weight: 800; }
  table.fi-t td.g { color: #047857; font-weight: 800; } table.fi-t td.neg { color: #b91c1c; } table.fi-t td.pu { color: #7c3aed; font-weight: 700; } table.fi-t td.mu { color: #94a3b8; }
  #detail-job-list .fi-wo { all:unset; cursor:pointer; display:inline-flex; align-items:center; gap:5px; font-weight:800; color:#0f172a; white-space:nowrap; }
  #detail-job-list .fi-wo svg { width:13px; height:13px; fill:none; stroke:#2563eb; stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; flex:0 0 auto; }
  #detail-job-list .fi-wo:hover { color:#1d4ed8; text-decoration:underline; text-underline-offset:3px; }
  #detail-job-list .fi-sn { font-size:12px; color:#475569; white-space:nowrap; font-variant-numeric:tabular-nums; }
  #fi-list { display: none; position: fixed; inset: 0; z-index: 80000; background: rgba(15,23,42,0.5); align-items: center; justify-content: center; padding: 12px; }
  .fi-lbox { background: #fff; width: 100%; max-width: 860px; max-height: 86vh; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
  .fi-lhead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 8px 16px; border-bottom: 1px solid #eef2f7; }
  .fi-lhead h3 { margin: 0; font-size: 15px; font-weight: 800; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .fi-lhead .grow { flex: 1; }
  .fi-tog { height: 28px; padding: 0 10px; border: 1px solid #cbd5e1; border-radius: 14px; background: #fff; color: #334155; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .fi-tog.on { background: #e0e7ff; border-color: #a5b4fc; color: #312e81; }
  .fi-lbody { flex: 1; overflow: auto; }
  .fi-lfoot { padding: 7px 16px; border-top: 1px solid #eef2f7; font-size: 11.5px; color: #64748b; font-weight: 700; display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
  .fi-lfoot b { color: #0f172a; }
  .fi-ro { display:inline-flex; align-items:center; height:24px; padding:0 10px; margin-left:8px; border-radius:12px; background:#eef2f7; color:#475569; font-size:11px; font-weight:700; white-space:nowrap; }
  .fi-co { display:inline-flex; align-items:center; height:22px; padding:0 9px; border-radius:6px; font-size:10.5px; font-weight:800; letter-spacing:.04em; white-space:nowrap; }   
  .fi-co.ok { background:#dcfce7; color:#166534; } .fi-co.sv { background:#fef3c7; color:#92400e; } .fi-co.op { background:#f1f5f9; color:#64748b; }
  .fi-settle { height: 26px; padding: 0 12px; border: none; border-radius: 13px; background: #1e2a44; color: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
  .fi-settle:hover { background: #283552; }
  .fi-settle.ghost { background: #e4e9f2; color: #1e2a44; }
  .fi-settle:disabled { opacity: .5; cursor: default; }
  .fi-amt { width: 80px; height: 26px; border: 1px solid #cbd5e1; border-radius: 6px; text-align: right; padding: 0 6px; font-size: 12px; font-weight: 700; margin-right: 4px; }
  .fi-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
  .fi-tag.ok { background: #dcfce7; color: #166534; } .fi-tag.dx { background: #e0f2fe; color: #075985; } .fi-tag.oth { background: #f1f5f9; color: #475569; } .fi-tag.cl { background: #ecfdf5; color: #047857; margin-left: 4px; }
  .fi-tag.war { background: #f3e8ff; color: #6b21a8; } .fi-tag.bill { background: #fee2e2; color: #b91c1c; } .fi-tag.paid { background: #eff6ff; color: #1d4ed8; }
  #fi-rp-bg { position: fixed; inset: 0; z-index: 99990; display: none; } #fi-rp-bg.m { background: rgba(15,23,42,.45); }
  #fi-rp { position: fixed; z-index: 99991; display: none; background: #fff; width: 316px; border-radius: 20px; padding: 14px 12px 12px; box-shadow: 0 10px 40px rgba(0,0,0,.28); }
  #fi-rp .rp-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
  #fi-rp .rp-t { font-weight: 800; font-size: 16px; color: #2c3e50; }
  #fi-rp .rp-n { width: 34px; height: 34px; border: none; background: transparent; border-radius: 50%; color: #3498db; font-size: 24px; cursor: pointer; }
  #fi-rp .rp-n:hover { background: #eff6ff; }
  #fi-rp .rp-hint { text-align: center; font-size: 11.5px; color: #64748b; font-weight: 600; margin-bottom: 8px; } #fi-rp .rp-hint b { color: #2563eb; }
  #fi-rp .rp-g { display: grid; grid-template-columns: repeat(7,1fr); row-gap: 6px; }
  #fi-rp .rp-w { text-align: center; color: #95a5a6; font-size: 11.5px; font-weight: 800; margin-bottom: 2px; }
  #fi-rp .rp-c { display: flex; justify-content: center; position: relative; }
  #fi-rp .rp-c.in { background: #dbeafe; }
  #fi-rp .rp-c.sl { background: linear-gradient(90deg, transparent 50%, #dbeafe 50%); }
  #fi-rp .rp-c.sr { background: linear-gradient(90deg, #dbeafe 50%, transparent 50%); }
  #fi-rp .rp-c.in.w0 { border-radius: 17px 0 0 17px; } #fi-rp .rp-c.in.w6 { border-radius: 0 17px 17px 0; }
  #fi-rp .rp-d { width: 34px; height: 34px; border: none; background: transparent; border-radius: 50%; font-weight: 700; font-size: 13.5px; color: #2c3e50; cursor: pointer; padding: 0; }
  #fi-rp .rp-c.in .rp-d { color: #1e40af; }
  #fi-rp .rp-d:hover { background: #e2e8f0; }
  #fi-rp .rp-d.today { color: #2563eb; box-shadow: inset 0 0 0 2px #3498db; font-weight: 900; }
  #fi-rp .rp-c.s .rp-d { background: #3498db; color: #fff; box-shadow: 0 4px 10px rgba(52,152,219,.4); }
  #fi-rp .rp-f { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 0 4px; font-size: 12px; font-weight: 800; color: #1e2a44; font-variant-numeric: tabular-nums; }
  #fi-rp .rp-f button { border: none; background: none; color: #3498db; font-weight: 800; font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
  @media (max-width: 900px) {
    .fi-kpis { grid-template-columns: repeat(3, minmax(0,1fr)); }
  }
  @media (max-width: 640px) {
    .fi-box { width: 100vw; height: 100vh; height: 100dvh; max-width: 100vw; border-radius: 0; }
    .fi-head { padding: 10px 12px 6px 14px; gap: 8px; }
    .fi-refresh span { display: none; } .fi-refresh { padding: 0 8px; }
    .fi-bar { padding: 2px 14px 8px; }
    .fi-seg { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
    .fi-seg button { padding: 0 6px; font-size: 11.5px; justify-content: center; }
    .fi-sw { max-width: none; min-width: 0; flex: 1 1 100%; }
    .fi-body { padding: 10px 14px 16px; }
    .fi-kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .fi-grid { grid-template-columns: 1fr; }
    .fi-panel.wide { overflow-x: auto; }
    #fi-list { padding: 0; }
    .fi-lbox { max-width: 100vw; max-height: 100vh; max-height: 100dvh; height: 100%; border-radius: 0; }
    #fi-list table.fi-t td:last-child, #fi-list table.fi-t th:last-child { position: sticky; right: 0; background: #fff; box-shadow: -8px 0 8px -8px rgba(15,23,42,.18); }
    #fi-list table.fi-t th:last-child { background: #f8fafc; }
  }
