/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --surface2:  #222535;
  --border:    #2e3148;
  --primary:   #4f6ef7;
  --primary-h: #3a56d4;
  --text:      #e8eaf0;
  --text-muted:#8b90a8;
  --error:     #f05a5a;
  --success:   #34d399;
  --radius:    10px;
  --shadow:    0 4px 24px rgba(0,0,0,.4);
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
}

/* ── Screens ──────────────────────────────────────────────── */
.screen { min-height: 100vh; }
.hidden { display: none !important; }

/* ── Login ────────────────────────────────────────────────── */
#screen-login {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
}

.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-card .subtitle {
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

/* ── Form ─────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: .95rem;
  outline: none;
  transition: border-color .15s;
}
.field input:focus { border-color: var(--primary); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-h); }
.btn-primary:disabled { opacity: .45; cursor: default; }
.btn-ghost    { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-sm       { padding: 5px 12px; font-size: .82rem; }
.full         { width: 100%; justify-content: center; }

/* ── Feedback ─────────────────────────────────────────────── */
.error   { color: var(--error); font-size: .85rem; margin-bottom: 12px; }
.hint    { color: var(--text-muted); font-size: .83rem; margin-top: 4px; }
code     { background: var(--surface2); padding: 1px 6px; border-radius: 4px; font-size: .85rem; }

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: .9rem;
  margin-bottom: 16px;
}
.alert-error { background: rgba(240,90,90,.12); border: 1px solid rgba(240,90,90,.3); color: var(--error); }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-weight: 700; font-size: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.label-user { font-size: .88rem; color: var(--text-muted); }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.badge-admin  { background: rgba(79,110,247,.2); color: var(--primary); }
.badge-member { background: rgba(52,211,153,.15); color: var(--success); }
.badge-neutral{ background: var(--surface2); color: var(--text-muted); }

/* ── Main container ───────────────────────────────────────── */
.container {
  max-width: 860px;
  margin: 32px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Upload section ───────────────────────────────────────── */
.upload-section h2 { font-size: 1.05rem; margin-bottom: 4px; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 36px 20px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primary);
  background: rgba(79,110,247,.05);
  color: var(--text);
}
.drop-zone svg { color: var(--text-muted); }
.drop-zone p { font-size: .9rem; }
.link { color: var(--primary); cursor: pointer; text-decoration: underline; }

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface2);
  border-radius: 6px;
  font-size: .88rem;
}

/* ── Preview section ──────────────────────────────────────── */
.preview-section h2 { font-size: 1.05rem; }

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; }
thead tr { background: var(--surface2); }
th { padding: 10px 16px; text-align: left; font-weight: 600; color: var(--text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td { padding: 9px 16px; border-top: 1px solid var(--border); }
tbody tr:hover { background: rgba(255,255,255,.02); }

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.submit-status { font-size: .88rem; }
.submit-status.ok    { color: var(--success); }
.submit-status.fail  { color: var(--error); }
.submit-status.loading { color: var(--text-muted); }
