:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-alt: #eef2f7;
  --text: #18202f;
  --muted: #65728a;
  --line: #d9e0ea;
  --accent: #0f7b82;
  --accent-strong: #095d64;
  --danger: #a63838;
  --warning: #8a6218;
  --success: #247042;
  --shadow: 0 18px 45px rgba(24, 32, 47, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button {
  border: 0;
  font: inherit;
}

.app-root {
  min-height: 100vh;
}

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

.auth-panel > div {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.muted {
  color: var(--muted);
}

.primary-button,
.secondary-button,
.icon-button {
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  padding: 0 18px;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button,
.icon-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 14px;
}

.secondary-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  background: var(--surface-alt);
}

.workspace {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfcfe;
  padding: 22px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.nav-item.active {
  background: #e4f3f3;
  color: var(--accent-strong);
}

.content {
  min-width: 0;
  padding: 20px 24px 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.account {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: #24324a;
  color: #ffffff;
  font-weight: 800;
}

.account strong,
.account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account span {
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.pill.success {
  background: #e8f5ed;
  color: var(--success);
}

.pill.warning {
  background: #fff4d8;
  color: var(--warning);
}

.workspace-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-header,
.file-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 130px 160px 110px 104px;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 0 16px;
}

.table-header {
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.file-row {
  border-bottom: 1px solid var(--line);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-name {
  min-width: 0;
  font-weight: 800;
}

.file-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.error-box {
  border: 1px solid #f0c4c4;
  border-radius: 8px;
  background: #fff5f5;
  color: var(--danger);
  padding: 14px 16px;
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nav-item {
    justify-content: center;
    text-align: center;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-header {
    display: none;
  }

  .file-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
    padding: 14px 16px;
  }
}

@media (max-width: 520px) {
  .auth-panel {
    padding: 16px;
  }

  .auth-panel > div {
    padding: 24px;
  }

  h1 {
    font-size: 36px;
  }
}
