:root {
  --black: #050505;
  --ink: #12100a;
  --gold: #f2b632;
  --gold-soft: #ffe083;
  --gold-deep: #9c6305;
  --paper: #fffaf0;
  --muted: #948a73;
  --danger: #ffb0a8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; color: #fff8db; background: #050505; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); background: #050505; }
.brand-panel { display: grid; min-height: 100vh; place-items: center; padding: clamp(22px, 4vw, 44px); background: linear-gradient(160deg, rgba(242,182,50,0.18), transparent 34%), #050505; }
.brand-logo-stage { width: min(100%, 330px); display: grid; justify-items: center; gap: 16px; }
.brand-logo { width: min(100%, 320px); height: min(66vh, 520px); object-fit: contain; filter: drop-shadow(0 24px 52px rgba(0,0,0,0.48)); }
.brand-tagline { margin: 0; color: #ff2a16; font-family: "Segoe Script", "Brush Script MT", cursive; font-size: clamp(1rem, 1.8vw, 1.32rem); font-style: italic; font-weight: 700; text-align: center; line-height: 1.25; }
.main-panel { min-width: 0; min-height: 100vh; padding: clamp(18px, 4vw, 42px); background: radial-gradient(circle at 50% 32%, rgba(242,182,50,0.12), transparent 30%), #050505; }
.login-view { min-height: calc(100vh - 84px); display: grid; place-items: center; }
.login-card { width: min(100%, 440px); display: grid; gap: 18px; padding: clamp(24px, 5vw, 42px); border: 1px solid rgba(255,224,131,0.32); background: linear-gradient(180deg, rgba(242,182,50,0.08), rgba(255,255,255,0.02)), #111111; box-shadow: 0 28px 90px rgba(0,0,0,0.42); }
.section-kicker { margin: 0 0 4px; color: var(--gold); font-size: 0.78rem; font-weight: 900; letter-spacing: 0.06em; }
h1, h2 { margin: 0; letter-spacing: 0; }
.login-card h1 { color: #fff8db; font-size: clamp(2rem, 5vw, 3.05rem); line-height: 1; }
.login-card label { display: grid; gap: 8px; color: #e7d59d; font-size: 0.9rem; font-weight: 800; }
input { width: 100%; min-height: 46px; padding: 0 14px; color: #fff8db; border: 1px solid rgba(255,224,131,0.28); background: #050505; outline: none; }
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242,182,50,0.20); }
.primary-button, .small-button { min-height: 42px; border: 0; font-weight: 900; }
.primary-button { color: #111; background: linear-gradient(135deg, #ffe083, #dfa028); }
.small-button { padding: 0 16px; color: #111; background: #fffaf0; border: 1px solid rgba(255,224,131,0.32); }
.form-error { min-height: 20px; margin: 0; color: var(--danger); font-weight: 800; }
.workspace-open .app-shell { grid-template-columns: 1fr; }
.workspace-open .brand-panel { display: none; }
.workspace-view { width: min(100%, 980px); display: grid; gap: 22px; margin: 0 auto; }
.topbar, .panel-heading, .partner-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar { padding-bottom: 18px; border-bottom: 1px solid rgba(242,182,50,0.18); }
.topbar h1 { color: #fff8db; font-size: clamp(1.7rem, 4vw, 2.7rem); }
.admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat-box, .upload-panel, .records-panel, .rate-chip, .partner-actions, .warning-panel { border: 1px solid rgba(255,224,131,0.22); background: #111111; box-shadow: 0 18px 46px rgba(0,0,0,0.24); }
.stat-box { display: grid; gap: 8px; min-height: 118px; align-content: center; padding: 18px; }
.stat-box span, .status-line, .partner-meta, .file-box small { color: #c7b98c; font-size: 0.88rem; font-weight: 750; }
.stat-box strong { color: #fff8db; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.rate-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rate-chip { padding: 14px 16px; }
.rate-chip span { display: block; color: var(--gold); font-weight: 900; }
.rate-chip strong { display: block; margin-top: 4px; color: #fff8db; font-size: 1.25rem; }
.warning-panel { padding: 18px; border-color: rgba(255,42,22,0.55); background: linear-gradient(180deg, rgba(255,42,22,0.10), rgba(242,182,50,0.05)), #111111; }
.warning-panel h2 { color: #fff8db; font-size: 1.2rem; }
.warning-list { display: grid; gap: 10px; margin-top: 14px; }
.warning-item { display: grid; gap: 4px; padding: 12px; border: 1px solid rgba(255,224,131,0.18); background: #050505; }
.warning-item strong { color: #ffdf87; overflow-wrap: anywhere; }
.warning-item span { color: #ffb0a8; font-size: 0.88rem; font-weight: 800; overflow-wrap: anywhere; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-panel, .records-panel { padding: 18px; }
.upload-panel h2, .records-panel h2 { color: #fff8db; font-size: 1.2rem; }
.text-link { color: var(--gold-soft); font-size: 0.88rem; font-weight: 850; text-decoration: none; }
.file-box { display: grid; gap: 7px; margin-top: 16px; padding: 18px; color: #fff8db; border: 1px dashed rgba(255,224,131,0.32); background: #050505; }
.file-box input { min-height: auto; padding: 0; border: 0; color: #fff8db; }
.status-line { min-height: 20px; margin: 12px 0 0; }
.search-input { width: min(100%, 280px); background: #050505; }
.partner-list { display: grid; gap: 10px; margin-top: 16px; }
.partner-row { display: grid; grid-template-columns: minmax(160px, 1.2fr) repeat(3, minmax(120px, 0.8fr)) minmax(132px, auto); gap: 12px; align-items: center; padding: 14px; border: 1px solid rgba(255,224,131,0.16); background: #080808; }
.partner-name { margin: 0 0 5px; color: #fff8db; font-weight: 900; }
.partner-meta { margin: 0; }
.partner-cell { display: grid; gap: 4px; color: #fff8db; font-weight: 900; }
.partner-cell span { color: #c7b98c; font-size: 0.8rem; }
.partner-reset-cell { justify-items: end; }
.reset-password-button { min-height: 38px; padding: 0 12px; white-space: nowrap; }
#resetPasswordStatus strong { color: var(--gold-soft); }
.partner-actions { padding: 14px; }
.report-stage { display: grid; justify-items: center; padding-bottom: 34px; }
.trade-card { width: min(100%, 520px); color: #f8f8f8; border: 1px solid rgba(255,224,131,0.24); background: linear-gradient(180deg, rgba(242,182,50,0.10), transparent 24%), #050505; box-shadow: 0 26px 70px rgba(0,0,0,0.34); }
.card-inner { padding: clamp(18px, 4vw, 28px); }
.card-brand { text-align: center; padding-bottom: 14px; }
.trade-logo-img { display: block; width: 158px; height: 94px; margin: 0 auto 10px; object-fit: contain; filter: drop-shadow(0 0 10px rgba(255,224,131,0.18)); }
.card-brand p { margin: 0; color: #ff2a16; font-family: "Segoe Script", "Brush Script MT", cursive; font-weight: 800; font-style: italic; }
.card-brand h2 { margin: 4px 0; color: #ffcf4e; font-size: clamp(1.35rem, 4vw, 2rem); line-height: 1; text-decoration: underline; }
.card-date { color: #f3f3f3; font-size: clamp(1.2rem, 3.6vw, 1.65rem); font-weight: 900; }
.card-section-title { margin: 12px 0 8px; color: #ffffff; font-size: 1.05rem; font-weight: 950; text-decoration: underline; }
.info-grid, .bank-grid { display: grid; grid-template-columns: 144px minmax(0, 1fr); gap: 6px 12px; font-size: 1rem; font-weight: 800; }
.info-grid span:nth-child(even), .bank-grid span:nth-child(even) { overflow-wrap: anywhere; }
.summary-table { width: 100%; border-collapse: collapse; margin-top: 8px; color: #111; background: #fff; font-weight: 900; }
.summary-table th, .summary-table td { padding: 8px 10px; border: 1px solid #cfcfcf; }
.summary-table th { text-align: center; background: #f3f3f3; }
.summary-table td:nth-child(2) { width: 52px; text-align: center; }
.summary-table td:last-child { text-align: right; }
.disclaimer { margin-top: 18px; padding: 16px; color: #a53b00; text-align: center; font-size: 0.9rem; font-weight: 850; line-height: 1.45; border-radius: 18px; background: linear-gradient(180deg, #ffe083, #ffd15b); }
.empty-state { padding: 22px; color: #c7b98c; text-align: center; border: 1px dashed rgba(255,224,131,0.22); background: #080808; }
@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: auto; padding: 22px; }
  .brand-logo { width: min(78%, 280px); height: 240px; }
  .admin-grid, .rate-row, .upload-grid, .partner-row { grid-template-columns: 1fr; }
  .partner-reset-cell { justify-items: stretch; }
}
@media (max-width: 640px) {
  .main-panel { padding: 16px; }
  .topbar, .panel-heading, .partner-actions { align-items: stretch; flex-direction: column; }
  .search-input { width: 100%; }
  .info-grid, .bank-grid { grid-template-columns: 112px minmax(0, 1fr); font-size: 0.9rem; }
  .summary-table th, .summary-table td { padding: 7px 6px; font-size: 0.88rem; }
  .trade-logo-img { width: 138px; height: 82px; }
}
@media print {
  body { background: #fff; }
  .brand-panel, .topbar, .partner-actions { display: none !important; }
  .app-shell, .main-panel, .workspace-view, .report-stage { display: block; min-height: auto; padding: 0; }
  .trade-card { width: 100%; box-shadow: none; }
}

.topbar-actions { display: flex; gap: 10px; align-items: center; }
.password-panel { padding: 18px; border: 1px solid rgba(255,224,131,0.22); background: #111111; box-shadow: 0 18px 46px rgba(0,0,0,0.24); }
.password-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(160px, 0.8fr) auto; gap: 12px; align-items: end; }
.password-form label { display: grid; gap: 7px; color: #e7d59d; font-size: 0.88rem; font-weight: 800; }
.password-form h2 { color: #fff8db; font-size: 1.2rem; }
.password-form .status-line { grid-column: 1 / -1; }
@media (max-width: 920px) {
  .password-form { grid-template-columns: 1fr; }
  .topbar-actions { align-items: stretch; flex-direction: column; }
}

.download-panel { padding: 18px; border: 1px solid rgba(255,224,131,0.22); background: #111111; box-shadow: 0 18px 46px rgba(0,0,0,0.24); }
.download-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.download-list .text-link { display: grid; min-height: 42px; align-items: center; padding: 10px 12px; border: 1px solid rgba(255,224,131,0.22); background: #050505; text-align: center; }
@media (max-width: 920px) { .download-list { grid-template-columns: 1fr; } }
