@import url("https://fonts.googleapis.com/css2?family=Fraunces:wght@600;700&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --bg: #0d0f12;
  --surface: #14171b;
  --surface-2: #1a1e24;
  --surface-3: #21262e;
  --border: #2c313a;
  --border-soft: #2c313a80;
  --text: #f2efe6;
  --text-muted: #9a968c;
  --accent: #f4c430;
  --accent-hover: #e0b32a;
  --accent-ink: #14120a;
  --coral: #ea5a37;
  --teal: #57ab9f;
  --error-bg: #2a1712;
  --error-border: #4a2318;
  --error-text: #ff9270;
  --success-bg: #12241c;
  --success-border: #1f4534;
  --success-text: #6fcf9e;

  --display: "Fraunces", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

button {
  font-family: inherit;
  cursor: pointer;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  color: var(--accent);
  white-space: nowrap;
}

.quota {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
}

.quota-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 3px;
  transition: width 0.3s ease, background 0.3s ease;
}

.quota-fill.warn {
  background: var(--accent);
}

.quota-fill.danger {
  background: var(--coral);
}

.quota-text {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.user button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
}

.user button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

main {
  flex: 1;
  padding: 24px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

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

.breadcrumb {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb .crumb {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.breadcrumb .crumb:hover {
  background: var(--surface-2);
  color: var(--text);
}

.breadcrumb .crumb.current {
  color: var(--text);
  font-weight: 500;
  cursor: default;
}

.breadcrumb .crumb.current:hover {
  background: none;
}

.breadcrumb .sep {
  color: var(--border);
}

.actions {
  display: flex;
  gap: 10px;
}

.actions button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
}

.actions button:hover {
  border-color: var(--accent);
}

.actions button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

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

.drop-zone {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  min-height: 320px;
  position: relative;
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--surface-2);
}

.drop-zone.dragover::after {
  content: "Отпустите, чтобы загрузить";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0f12cc;
  color: var(--accent);
  font-weight: 600;
  font-size: 15px;
  border-radius: 12px;
  pointer-events: none;
}

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

.file-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.file-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}

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

.file-row:hover {
  background: var(--surface-2);
}

.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.file-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.file-name.is-folder {
  font-weight: 500;
}

.file-meta {
  color: var(--text-muted);
  white-space: nowrap;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.file-row:hover .row-actions {
  opacity: 1;
}

.row-actions button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
}

.row-actions button:hover {
  background: var(--surface-3);
  color: var(--text);
}

.row-actions button.danger:hover {
  color: var(--coral);
}

.empty-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.state-box {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
}

.state-box.error {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  color: var(--error-text);
}

.upload-toasts {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  width: 280px;
}

.upload-toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

.upload-toast .name {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--text);
}

.upload-toast .name .pct {
  color: var(--text-muted);
}

.upload-toast .bar {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.upload-toast .bar-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.15s ease;
}

.upload-toast.error .bar-fill {
  background: var(--coral);
}

.upload-toast.error .name {
  color: var(--error-text);
}

.upload-toast.done .bar-fill {
  background: var(--success-text);
}
