:root {
  --bg: #232846; --surface: rgba(255,255,255,.09); --surface-2: rgba(255,255,255,.14);
  --border: rgba(255,255,255,.18); --text: #f3f4fb; --muted: #aeb4d0;
  --accent: #ff5a3c; --accent-2: #ff2e7e; --violet: #7c5cff; --ok: #3ddc97; --bad: #ff6b6b;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; font: 14px/1.5 "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); min-height: 100vh; -webkit-font-smoothing: antialiased; }
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora i { position: absolute; width: 52vmax; height: 52vmax; border-radius: 50%; filter: blur(110px); opacity: .5; animation: drift 24s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { background: var(--violet); top: -20vmax; left: -12vmax; }
.aurora i:nth-child(2) { background: var(--accent-2); bottom: -26vmax; right: -14vmax; animation-delay: -8s; }
.aurora i:nth-child(3) { background: var(--accent); width: 34vmax; height: 34vmax; top: 35%; left: 45%; opacity: .16; animation-delay: -15s; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .aurora i, .panel, .btn { animation: none !important; transition: none !important; } }

header { position: sticky; top: 0; z-index: 40; padding: 16px 28px; background: rgba(35,40,70,.7); backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%); border-bottom: 1px solid var(--border); }
header h1 { margin: 0 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; background: linear-gradient(95deg, #fff 20%, #ffb199 60%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.who { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.who > span { padding: 4px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; }
.ok { color: var(--ok); }
.warn { color: var(--bad); font-weight: 600; }
main { padding: 26px 28px 80px; max-width: 1580px; margin: 0 auto; }

.panel { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 20px; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 10px 40px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.06); animation: rise .6s cubic-bezier(.2,.8,.2,1) both; transition: border-color .25s, transform .25s; }
.panel:hover { border-color: rgba(255,255,255,.16); }
main .panel:nth-child(2) { animation-delay: .05s; }
main .panel:nth-child(3) { animation-delay: .1s; }
main .panel:nth-child(4) { animation-delay: .15s; }
main .panel:nth-child(5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.panel h2 { margin: 0 0 14px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-row input { flex: 1 1 320px; min-width: 220px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px 18px; align-items: end; }
.grid label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.grid label .muted { text-transform: none; letter-spacing: 0; font-size: 11px; opacity: .8; }
.grid label > input, .grid label > select { display: block; width: 100%; margin-top: 6px; }
input, select { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.1); color: var(--text); transition: border-color .2s, box-shadow .2s, background .2s; }
select option { background: #2b3052; color: var(--text); }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,90,60,.2), 0 0 24px rgba(255,90,60,.15); background: rgba(255,255,255,.16); }
input[type=file] { padding: 7px; }
input[type=file]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--text); cursor: pointer; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 18px; font-size: 13px; color: #c9cde0; }
.checks label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.rec-toggle { padding: 5px 12px; border-radius: 999px; background: rgba(124,92,255,.16); border: 1px solid rgba(124,92,255,.45); color: #eef0ff; font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 500; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--text); text-decoration: none; transition: transform .18s, background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.22); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; font-weight: 600; box-shadow: 0 6px 24px rgba(255,60,100,.35); }
.btn.primary:hover { box-shadow: 0 8px 34px rgba(255,60,100,.55); filter: brightness(1.08); }
.btn.primary:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost { background: transparent; }
.template-btn { border-color: rgba(61,220,151,.45); background: rgba(61,220,151,.14); color: #d8ffef; }
.template-btn:hover { background: rgba(61,220,151,.24); border-color: rgba(61,220,151,.7); }

.rec-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }
.rec-actions { margin-top: 10px; }

.grid label .ac { margin-top: 6px; }
.grid label .ac > input { width: 100%; }

.cod-panel { margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); }
.cod-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); }
.cod-options { display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); align-items: center; }
.cod-group { display: flex; flex-direction: column; gap: 6px; }
.cod-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cod-radios { display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 13px; color: var(--text); }
.cod-radios label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cod-radios input[type=radio] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.cod-chip { display: inline-block; padding: 5px 10px; border-radius: 8px; background: rgba(255,90,60,.14); border: 1px solid rgba(255,90,60,.35); font-size: 12.5px; color: #ffd4cb; }

.cell-mode-row { display: flex; gap: 4px; margin-bottom: 5px; }
.mode-btn { font: inherit; font-size: 11px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.mode-btn.active { background: rgba(255,90,60,.2); border-color: rgba(255,90,60,.6); color: #fff; font-weight: 600; }
td input.disabled-input { opacity: .45; cursor: not-allowed; }

.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.table-head h2 { margin: 0; }
.table-wrap { overflow: auto; max-height: 68vh; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.05); }
.table-wrap::-webkit-scrollbar { width: 10px; height: 10px; } .table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.05); text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; background: rgba(48,54,92,.95); backdrop-filter: blur(10px); z-index: 2; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr { transition: background .15s; } tbody tr:hover td { background: rgba(255,255,255,.035); }
tr.needs td { background: rgba(255,90,60,.09); }
tr.done td { background: rgba(61,220,151,.08); }
td input { width: 100%; min-width: 130px; padding: 6px 9px; }
td input.done { border-color: rgba(61,220,151,.5); background: rgba(61,220,151,.1); }
td.num { text-align: right; white-space: nowrap; }
.muted { color: var(--muted); font-size: 12px; }
.hint { margin: 12px 0 0; }
.ttn { font-weight: 600; color: var(--ok); }
.err { color: var(--bad); font-size: 12px; }
.err-strong { color: var(--bad); font-weight: 600; }

#rows.hide-recipient-col .col-recipient { display: none; }
.col-recipient { min-width: 240px; }
.rec-cell-title { font-weight: 600; font-size: 12.5px; color: var(--text); }
.rec-cell-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.rec-cell-select { width: 100%; min-width: 210px; padding: 5px 8px; font-size: 12px; }

.ac { position: relative; }
.ac-list { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px; background: rgba(40,45,78,.98); backdrop-filter: blur(16px); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.6); max-height: 260px; overflow: auto; display: none; }
.ac-list.open { display: block; }
.ac-item { padding: 8px 12px; cursor: pointer; }
.ac-item:hover, .ac-item.active { background: rgba(255,90,60,.16); }
.ac-empty { padding: 8px 12px; color: var(--muted); }
.hidden { display: none !important; }
@media (max-width: 640px) { header, main { padding-left: 14px; padding-right: 14px; } }
