/* AiRotor Data - light, quiet, and out of the way.
   The content here is people's field data; the interface should be the least
   interesting thing on screen. */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fbfcfd;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;

  --text: #16202c;
  --muted: #667085;
  --faint: #98a2b3;

  --accent: #0f6fd1;
  --accent-hover: #0c5cae;
  --accent-soft: #eaf2fd;

  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

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

button, input, select { font: inherit; color: inherit; }

/* --- buttons ------------------------------------------------------------ */
button {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 7px 13px;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s;
}
button:hover:not(:disabled) { background: var(--surface-2); border-color: var(--faint); }
button:active:not(:disabled) { box-shadow: none; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }

button.link {
  background: none;
  border: none;
  box-shadow: none;
  color: var(--accent);
  padding: 3px 6px;
  font-size: 13px;
}
button.link:hover:not(:disabled) { background: var(--accent-soft); }
button.link.danger { color: var(--bad); }
button.link.danger:hover:not(:disabled) { background: var(--bad-soft); }

/* --- inputs ------------------------------------------------------------- */
input, select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 11px;
  width: 100%;
  box-shadow: var(--shadow-sm);
}
input::placeholder { color: var(--faint); }
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
select { cursor: pointer; }

/* --- layout helpers ----------------------------------------------------- */
.hidden { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { flex-wrap: wrap; }

/* --- sign in ------------------------------------------------------------ */
#login {
  max-width: 380px;
  margin: 12vh auto;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
#login h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
#login .sub { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
#login label { display: block; margin-bottom: 16px; font-size: 13px; font-weight: 500; }
#login input { margin-top: 6px; font-weight: 400; }
#login button { width: 100%; padding: 10px; }

.notice {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid #fecdca;
}

/* --- shell -------------------------------------------------------------- */
header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
header .brand { font-weight: 600; font-size: 15px; letter-spacing: -.2px; }
header .brand span { color: var(--accent); }
header select { width: auto; min-width: 190px; }

.usage {
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.usage b { color: var(--text); font-weight: 600; }

#shell { display: grid; grid-template-columns: 280px 1fr; height: calc(100vh - 56px); }

aside {
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow-y: auto;
  padding: 14px 12px;
}
aside h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--faint);
  margin: 4px 6px 10px;
  font-weight: 600;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
  user-select: none;
}
.tree-item:hover { background: var(--surface-2); }
.tree-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.tree-item .dot { width: 6px; height: 6px; border-radius: 2px; background: var(--faint); flex: none; }
.tree-item.active .dot { background: var(--accent); }
.tree-item .size { margin-left: auto; font-size: 11.5px; color: var(--faint); }
.tree-item.active .size { color: var(--accent); }

main { overflow-y: auto; padding: 22px 26px 80px; }

.crumb { font-size: 20px; font-weight: 600; letter-spacing: -.3px; }
.crumb .parent { font-weight: 400; color: var(--faint); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 16px 0 20px; }
.tabs button {
  background: none;
  border: none;
  box-shadow: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--muted);
  padding: 9px 14px;
  margin-bottom: -1px;
}
.tabs button:hover { background: none; color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

/* --- drop zone ---------------------------------------------------------- */
#drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 20px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
#drop strong { color: var(--text); font-size: 14.5px; }
#drop .hint { font-size: 12.5px; color: var(--faint); margin-top: 4px; }
#drop.over { border-color: var(--accent); background: var(--accent-soft); }

/* --- tables ------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.card > .muted { font-size: 13px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--faint);
  font-weight: 600;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

.pill {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: var(--surface-2);
  font-weight: 500;
}
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: #abefc6; }
.pill.busy { color: var(--accent); background: var(--accent-soft); border-color: #b2ddff; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: #fecdca; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: #fedf89; }

/* --- stats -------------------------------------------------------------- */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  flex: 1 1 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 22px; font-weight: 600; letter-spacing: -.4px; }
.stat .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--faint);
  margin-top: 3px;
  font-weight: 600;
}

/* --- states ------------------------------------------------------------- */
.empty {
  color: var(--muted);
  padding: 44px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.loading { color: var(--faint); padding: 34px; text-align: center; font-size: 13px; }
.loading::after {
  content: "";
  display: inline-block;
  width: 13px; height: 13px;
  margin-left: 8px;
  vertical-align: -2px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- upload tray -------------------------------------------------------- */
#tray {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 390px;
  max-height: 46vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#tray header {
  background: var(--surface-2);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  height: 42px;
  font-size: 13px;
  font-weight: 500;
}
#tray .items { overflow-y: auto; padding: 4px 0 8px; }
.up-item { padding: 8px 14px; font-size: 12.5px; }
.up-item .name { color: var(--text); }
.up-item .pct { color: var(--faint); font-size: 11.5px; margin-left: 10px; }
.bar { height: 4px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; border-radius: 3px; transition: width .25s ease; }
.bar.done > div { background: var(--ok); }
.bar.bad > div { background: var(--bad); }

/* --- toast -------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 18px;
  font-size: 13.5px;
  z-index: 60;
  box-shadow: var(--shadow-lg);
  max-width: min(560px, 90vw);
}
#toast.bad { background: var(--bad); }

/* --- search ------------------------------------------------------------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar input { max-width: 280px; }
.count { font-size: 13px; color: var(--muted); }

@media (max-width: 860px) {
  #shell { grid-template-columns: 1fr; height: auto; }
  aside { border-right: none; border-bottom: 1px solid var(--line); max-height: 210px; }
  main { padding: 18px 16px 80px; }
  #tray { left: 12px; right: 12px; width: auto; }
  header { padding: 0 14px; gap: 10px; }
  header select { min-width: 130px; }
  .usage { display: none; }
}
