:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e2e5ea;
  --text: #1d2129;
  --muted: #6b7280;
  --accent: #2f6feb;
  --danger: #b4442e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--accent); cursor: pointer; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.grow { flex: 1; }

button, .button {
  font: inherit;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.06); }
button.ghost {
  background: var(--panel);
  color: var(--text);
}
button.ghost.danger { color: var(--danger); }

input, textarea {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  width: 100%;
}

/* --- вход --- */

.login {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}
.login .card {
  width: min(360px, 92vw);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  gap: 12px;
}
.login h1 { margin: 0; font-size: 22px; }
.login p { margin: 0; }

/* --- шапка --- */

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.crumbs { flex: 1; font-size: 16px; }
.who { display: flex; align-items: center; gap: 10px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
}
.status { margin-left: 8px; color: var(--muted); }

main { padding: 0 20px 40px; }

/* --- таблица --- */

.files {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.files th, .files td {
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.files th { font-weight: 600; color: var(--muted); font-size: 13px; }
.files tr:last-child td { border-bottom: none; }
.files td.actions { text-align: right; white-space: nowrap; }
.files td.actions button { margin-left: 6px; padding: 4px 9px; font-size: 13px; }

/* --- накладные панели --- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay .panel {
  width: min(900px, 100%);
  max-height: 88vh;
  background: var(--panel);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.overlay header { border-bottom: 1px solid var(--line); }
.overlay footer { padding: 10px 20px; border-top: 1px solid var(--line); font-size: 13px; }
.overlay textarea {
  flex: 1;
  min-height: 50vh;
  border: none;
  border-radius: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 14px;
  resize: none;
}
.list { padding: 8px 20px; overflow: auto; }
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.list-row span { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --panel: #1c2027;
    --line: #2c323c;
    --text: #e6e8ec;
    --muted: #9aa2ae;
    --accent: #4b86f0;
    --danger: #e0705a;
  }
}
