:root {
  --bg: #eff4fb;
  --surface: #ffffff;
  --surface-alt: #f6f9ff;
  --text: #182230;
  --muted: #66758a;
  --line: #d9e3f3;
  --primary: #1d63ed;
  --primary-deep: #154cb7;
  --success: #157f5f;
  --danger: #c53b36;
  --warning: #ad6a00;
  --shadow: 0 18px 50px rgba(29, 71, 132, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 99, 237, 0.12), transparent 28%),
    linear-gradient(180deg, #f5f8fe 0%, #edf3fb 100%);
}

a {
  color: var(--primary);
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.split-layout {
  width: min(1200px, 100%);
  display: grid;
  grid-template-columns: 1fr 0.82fr;
  gap: 24px;
  align-items: stretch;
}

.promo-panel,
.login-panel {
  min-width: 0;
}

.promo-panel,
.auth-card,
.panel,
.stat-card,
.file-list li,
.table-wrap,
.empty-state,
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.promo-panel {
  border-radius: 32px;
  overflow: hidden;
}

.promo-image {
  height: 250px;
  overflow: hidden;
}

.promo-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.promo-copy {
  padding: 26px 28px 28px;
}

.promo-copy h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.15vw, 2.45rem);
  line-height: 1.04;
  max-width: none;
  white-space: nowrap;
}

.promo-copy p {
  margin: 14px 0 0;
  max-width: 40ch;
  line-height: 1.65;
  color: var(--muted);
}

.feature-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.feature-list li {
  position: relative;
  padding-left: 22px;
  font-weight: 600;
  color: #243247;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.login-panel {
  display: grid;
}

.auth-card-compact {
  border-radius: 32px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-compact .button {
  width: 100%;
}

.action-link-full {
  width: 100%;
  margin-top: 12px;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.panel,
.stat-card,
.file-list li,
.table-wrap,
.empty-state,
.note {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-radius: 24px;
}

.user-only {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1d63ed, #63a4ff);
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}

.brand-copy strong {
  display: block;
  font-size: 1.05rem;
}

.brand-copy span {
  display: block;
  color: var(--muted);
  font-size: 0.94rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  background: #edf4ff;
  color: var(--primary);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  padding: 30px 0 18px;
}

.hero-copy h1,
.auth-card h2,
.panel h2,
.panel h3 {
  margin: 0;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
  max-width: 11ch;
}

.hero-copy p {
  margin: 16px 0 0;
  max-width: 56ch;
  line-height: 1.7;
  color: var(--muted);
}

.auth-card {
  border-radius: 28px;
  padding: 26px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-grid,
.dashboard-grid,
.dashboard-stack {
  display: grid;
  gap: 20px;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.dashboard-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 22px;
}

.dashboard-stack {
  grid-template-columns: 1fr;
  margin-top: 22px;
}

.panel {
  border-radius: 28px;
  padding: 24px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.panel-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.stat-card {
  border-radius: 22px;
  padding: 18px;
}

.stat-card strong {
  display: block;
  font-size: 1.6rem;
}

.stat-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.field input,
.field button,
.action-link {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  font: inherit;
}

.field input {
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.field input:focus {
  outline: 2px solid rgba(29, 99, 237, 0.2);
  border-color: var(--primary);
}

.upload-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-alt);
}

.upload-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.upload-picker-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f4fe3 0%, #3a7fff 100%);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.upload-picker-text {
  color: var(--muted);
  font-size: 0.96rem;
}

.upload-status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 0.95rem;
  color: var(--muted);
}

.upload-status-loading {
  color: var(--primary);
}

.upload-status-success {
  color: var(--success);
}

.upload-status-error {
  color: var(--danger);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #145cff 0%, #4789ff 100%);
  color: #fff;
  box-shadow: 0 16px 30px rgba(20, 92, 255, 0.24);
}

.button-primary:hover {
  background: linear-gradient(135deg, #0f4fe3 0%, #3a7fff 100%);
  box-shadow: 0 18px 34px rgba(20, 92, 255, 0.3);
}

.button-primary:focus {
  outline: 3px solid rgba(20, 92, 255, 0.18);
  outline-offset: 2px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button-secondary {
  background: #edf4ff;
  color: var(--primary);
}

.button-danger {
  background: linear-gradient(135deg, #fff1f0 0%, #ffe2e0 100%);
  color: var(--danger);
  box-shadow: inset 0 0 0 1px rgba(197, 59, 54, 0.08);
}

.action-link {
  width: auto;
  padding: 12px 16px;
  background: linear-gradient(135deg, #edf4ff 0%, #dce9ff 100%);
  color: #134aa9;
  min-height: 42px;
  box-shadow: inset 0 0 0 1px rgba(29, 99, 237, 0.08);
}

.message {
  padding: 14px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  line-height: 1.5;
}

.message-success {
  background: #e9f8f2;
  color: var(--success);
}

.message-error {
  background: #fff0ef;
  color: var(--danger);
}

.message-warning {
  background: #fff7e8;
  color: var(--warning);
}

.file-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form {
  margin: 0;
}

.button-small {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.95rem;
}

.file-meta strong,
.file-meta span {
  display: block;
}

.file-meta span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state,
.note {
  border-radius: 20px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 22px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f8fbff;
}

tr:last-child td {
  border-bottom: none;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

@media (max-width: 980px) {
  .split-layout,
  .hero,
  .auth-grid,
  .dashboard-grid,
  .dashboard-stack,
  .stats {
    grid-template-columns: 1fr;
  }

  .promo-copy h1 {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .auth-page {
    padding: 14px;
  }

  .promo-image {
    height: 220px;
  }

  .promo-copy,
  .auth-card-compact {
    padding: 22px;
  }

  .page {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .topbar-actions,
  .panel-header,
  .file-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .upload-picker,
  .file-actions {
    width: 100%;
  }

  .upload-picker {
    align-items: stretch;
    flex-direction: column;
  }
}
