:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #111;
  --panel-2: #151515;
  --panel-3: #1d1c19;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f1ea;
  --soft: #b8b2a6;
  --muted: #777168;
  --accent: #c5a15f;
  --accent-2: #e9dcc2;
  --danger: #de6b6b;
  --ok: #8abf8f;
  --radius: 8px;
  --sidebar: 284px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 28px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  color: var(--accent-2);
  background: #15130f;
  font-weight: 750;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.login-form label {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #0c0c0c;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.form-note {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  border-right: 1px solid var(--line);
  background: #0b0b0b;
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 22px;
}

.sidebar-brand h1 {
  font-size: 18px;
}

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

.nav-item,
.ghost,
.primary,
.secondary,
.icon-button,
.sort-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 38px;
  padding: 0 12px;
  background: transparent;
  color: var(--soft);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  text-align: left;
}

.nav-item:hover,
.nav-item.is-active,
.ghost:hover,
.secondary:hover,
.icon-button:hover,
.sort-button:hover {
  background: var(--panel-2);
  color: var(--text);
  border-color: var(--line);
}

.nav-icon {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.side-section {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.section-title {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.metric-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.metric-list dt {
  color: var(--muted);
  font-size: 13px;
}

.metric-list dd {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segmented button.is-active {
  background: var(--panel-3);
  color: var(--accent-2);
}

.logout {
  align-self: end;
  border-color: var(--line);
}

.workspace {
  min-width: 0;
  padding: 26px;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.topbar h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-box {
  width: min(360px, 42vw);
}

.primary {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #111;
  font-weight: 700;
}

.primary:hover {
  background: #fff8ea;
  border-color: #fff8ea;
}

.secondary {
  border-color: var(--line);
  color: var(--text);
}

.full {
  width: 100%;
}

.pathbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.crumb,
.crumbs button {
  border: 0;
  background: transparent;
  color: var(--soft);
  min-height: 32px;
  padding: 0 8px;
  border-radius: 6px;
}

.crumb:hover,
.crumbs button:hover {
  color: var(--text);
  background: var(--panel-2);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.status-row {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.status-row strong {
  color: var(--text);
}

.content-surface {
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
}

.list-head,
.file-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 110px 260px;
  align-items: center;
  gap: 12px;
}

.list-head {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sort-button {
  min-height: 30px;
  padding: 0;
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
}

.file-list {
  min-height: 120px;
}

.file-row {
  min-height: 64px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.file-row:hover {
  background: #171717;
}

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

.file-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.file-main:hover {
  background: transparent;
}

.file-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
}

.file-name {
  min-width: 0;
  margin: 0 0 4px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-path {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-date,
.file-size {
  color: var(--soft);
  font-size: 13px;
}

.file-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--soft);
  font-size: 12px;
  white-space: nowrap;
}

.icon-button.danger:hover {
  color: #fff;
  border-color: rgba(222, 107, 107, 0.36);
  background: rgba(222, 107, 107, 0.12);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 260px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
}

.dialog {
  width: min(460px, 100%);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--panel);
  padding: 20px;
}

.dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.copy-field {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.copy-field input {
  flex: 1;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    grid-template-rows: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .side-section,
  .logout {
    display: none;
  }

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

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .list-head,
  .file-row {
    grid-template-columns: minmax(180px, 1fr) 220px;
  }

  .hide-mobile,
  .file-date,
  .file-size {
    display: none;
  }
}

@media (max-width: 560px) {
  .workspace {
    padding: 18px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .file-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 14px;
  }

  .file-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
