/*
 * La Nube, on the web.
 *
 * The same palette as the app and the icon: yellow is reserved for FOLDERS and
 * for the one primary action on a screen. Using it for buttons, badges and
 * highlights as well would stop a folder being the thing the eye lands on,
 * which in a file browser is the whole job of the colour.
 */
:root {
  --yellow: #f2b705;
  --yellow-deep: #c8940a;
  --yellow-soft: #fdf0c9;
  --brown: #241b10;
  --brown-mid: #5a4a35;
  --ink: #000;
  --paper: #faf7f1;
  --surface: #fff;
  --line: #e7dfcf;
  --muted: #6b5f4e;
  --danger: #8e2a1b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brown);
  border-radius: 8px;
  padding: 8px 14px;
}
button:hover { border-color: var(--brown-mid); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.primary {
  background: var(--yellow);
  border-color: var(--yellow-deep);
  color: var(--brown);
  font-weight: 600;
}
button.danger { color: var(--danger); }
button.link {
  border: 0; background: none; padding: 4px 6px; color: var(--muted);
}

input[type="text"], input[type="password"] {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
input:focus { outline: 2px solid var(--yellow); outline-offset: -1px; }

label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }

/* ── chrome ───────────────────────────────────────────────────────────────── */

header {
  background: var(--brown);
  color: var(--yellow);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
}
header h1 { font-size: 18px; margin: 0; font-weight: 600; }
header .spacer { flex: 1; }
header button {
  background: transparent;
  border-color: var(--brown-mid);
  color: var(--yellow);
}
header button:hover { border-color: var(--yellow); }

.crumbs {
  background: var(--brown);
  color: var(--yellow-soft);
  padding: 0 20px 10px;
  font-size: 13.5px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 53px;
  z-index: 4;
}
.crumbs a { color: var(--yellow-soft); cursor: pointer; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs a.here { color: var(--yellow); font-weight: 600; }
.crumbs span { color: var(--brown-mid); }

/*
 * The offline bar. Deliberately a bar and not a toast: someone looking at a
 * listing that is a day old has to be able to see why at any moment, not for
 * three seconds after it happened.
 */
.banner {
  background: var(--yellow);
  color: var(--brown);
  padding: 10px 20px;
  font-size: 13.5px;
}
.banner strong { display: block; }

main { max-width: 900px; margin: 0 auto; padding: 20px; }

/* ── the listing ──────────────────────────────────────────────────────────── */

.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row:hover { background: #fffdf6; }
.row .name { flex: 1; min-width: 0; }
.row .name b {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.row.folder .name b { font-weight: 600; }
.row .sub { font-size: 12.5px; color: var(--muted); }
.row .actions { display: flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.row:hover .actions, .row:focus-within .actions { opacity: 1; }

/* The one visual rule: folders are yellow, files are not. */
.glyph { width: 30px; height: 30px; flex: none; }
.glyph.folder { fill: var(--yellow); }
.glyph.file { fill: var(--brown-mid); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.empty h2 { color: var(--ink); font-size: 18px; margin: 16px 0 6px; }

/* ── panels ───────────────────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 18px;
}
.card h2 { font-size: 15px; margin: 0 0 10px; }

.storage {
  background: var(--brown);
  color: #fff;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
}
.storage .label { color: var(--yellow); font-size: 13px; font-weight: 600; }
.storage .figure { font-size: 28px; font-weight: 600; margin-top: 8px; }
.storage .figure span { font-size: 15px; color: var(--yellow-soft); font-weight: 400; }
.storage .foot { color: var(--yellow-soft); font-size: 12.5px; margin-top: 10px; }

.meter { height: 8px; border-radius: 4px; background: var(--brown-mid); margin-top: 12px; }
.meter > i { display: block; height: 100%; border-radius: 4px; background: var(--yellow); }
.meter.full > i { background: var(--danger); }

.warn {
  background: var(--yellow-soft);
  color: var(--brown);
  border-radius: 10px;
  padding: 14px;
  font-size: 13.5px;
}

.notice { color: var(--danger); font-size: 13.5px; margin-top: 10px; }
.muted { color: var(--muted); font-size: 13.5px; }

.gate { max-width: 460px; margin: 40px auto; }

/* ── transfer ─────────────────────────────────────────────────────────────── */

.transfer {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 13.5px;
}
.transfer .meter { background: var(--line); margin-top: 8px; }

/* ── dialogs ──────────────────────────────────────────────────────────────── */

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  max-width: 420px;
  width: calc(100% - 40px);
  color: var(--ink);
  background: var(--surface);
}
dialog::backdrop { background: rgba(36, 27, 16, .45); }
dialog h2 { margin: 0 0 10px; font-size: 17px; }
dialog .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
dialog .list { max-height: 300px; overflow: auto; margin-top: 10px; }
dialog .list .row { padding: 8px 4px; cursor: pointer; }
dialog .list .row.blocked { opacity: .45; cursor: not-allowed; }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

@media (max-width: 560px) {
  main { padding: 14px; }
  .row .actions { opacity: 1; }
}
