:root {
  --bg: #07111f;
  --bg-2: #0d1a2e;
  --surface: #ffffff;
  --surface-alt: #f5f8fc;
  --surface-dark: #0b1627;
  --text: #102033;
  --text-strong: #09111d;
  --text-soft: #4e6076;
  --line: rgba(12, 29, 55, 0.12);
  --line-strong: rgba(23, 53, 94, 0.18);
  --primary: #0b84ff;
  --primary-strong: #0060d6;
  --accent: #1cd3ff;
  --danger: #dc2626;
  --success: #16a34a;
  --shadow-md: 0 18px 50px rgba(8, 20, 38, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
  cursor: pointer;
}

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

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.secondary {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: #fff;
}

button.secondary:hover {
  background: var(--surface-alt);
}

button.danger {
  background: var(--danger);
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
}

.shell-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px max(16px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #fff 0, #fff min(360px, 42vw), #2f343d min(360px, 42vw), #2f343d 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand img {
  width: auto;
  height: 42px;
}

.session-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.92rem;
  font-weight: 700;
}

.session-actions button {
  color: var(--text);
  background: #fff;
}

.app-shell {
  width: min(calc(100% - 32px), 1240px);
  margin: 32px auto 56px;
}

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 180px);
}

.login-panel h1 {
  margin: 8px 0 12px;
  color: var(--text-strong);
  font-size: clamp(2.4rem, 5vw, 5rem);
  line-height: 1;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.login-form,
.toolbar,
.panel,
.upload-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.login-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.dashboard {
  display: grid;
  gap: 18px;
}

.dashboard-header {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  justify-content: space-between;
}

.dashboard-header h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.quota {
  min-width: min(100%, 320px);
}

.quota-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6f4;
}

.quota-bar span {
  display: block;
  height: 100%;
  width: var(--quota-width, 0%);
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.toolbar input[type="file"] {
  width: min(100%, 360px);
  padding-top: 8px;
}

.path-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.file-table th,
.file-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.file-table th {
  color: var(--text-soft);
  background: var(--surface-alt);
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.file-table tr:last-child td {
  border-bottom: 0;
}

.name-cell {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: var(--text-strong);
  font-weight: 800;
}

.name-cell button {
  min-height: 0;
  padding: 0;
  color: var(--text-strong);
  background: transparent;
  text-align: left;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 34px;
}

.upload-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe6f4;
}

.progress-track span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: var(--success);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 18px;
}

.admin-files-panel {
  grid-column: 1 / -1;
}

.panel {
  padding: 18px;
}

.panel-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2 {
  margin: 0 0 14px;
}

.panel-title-row h2 {
  margin: 0;
}

.admin-file-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.admin-file-quota {
  width: min(100%, 360px);
}

.stack {
  display: grid;
  gap: 12px;
}

.customer-list,
.trash-list {
  display: grid;
  gap: 10px;
}

.list-item {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.list-item strong {
  color: var(--text-strong);
}

.status-line {
  min-height: 24px;
  color: var(--text-soft);
  font-weight: 700;
}

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

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

@media (max-width: 820px) {
  .shell-header {
    background: #fff;
  }

  .session-actions {
    color: var(--text);
  }

  .login-panel,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .file-table,
  .file-table tbody,
  .file-table tr,
  .file-table td {
    display: block;
    width: 100%;
  }

  .file-table thead {
    display: none;
  }

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

  .row-actions {
    justify-content: flex-start;
  }
}
