:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --text: #1a2433;
  --muted: #667085;
  --line: #e3e8ef;
  --danger: #b42318;
  --ok: #067647;
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.error { color: var(--danger); background: #fef3f2; border: 1px solid #fecdca; padding: 8px 12px; border-radius: 8px; }
.notice { color: var(--ok); background: #ecfdf3; border: 1px solid #abefc6; padding: 10px 14px; border-radius: 8px; }

/* brand mark */
.logo { height: 40px; width: auto; display: block; }
.logo.big { height: 96px; }
img.logo { border-radius: 50%; background: #fff; }
.logo-text {
  width: 32px; border-radius: 8px; background: var(--accent); color: var(--brand);
  display: grid; place-items: center; font-weight: 800; font-size: 18px;
}
.logo-text.big { width: 56px; font-size: 30px; border-radius: 14px; }

/* staff header */
.top {
  background: var(--brand); color: #fff; display: flex; align-items: center; gap: 28px;
  padding: 10px 24px; border-bottom: 3px solid var(--accent);
}
.top a, .top .pill, .top .btn { white-space: nowrap; }
@media (max-width: 960px) { .top { gap: 14px; } .top .pill { display: none; } }
.brandline { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; }
.brandline:hover { text-decoration: none; }
.top nav { display: flex; gap: 4px; }
.top nav a { color: rgba(255, 255, 255, .78); padding: 6px 12px; border-radius: 6px; }
.top nav a.on, .top nav a:hover { color: #fff; background: rgba(255, 255, 255, .14); text-decoration: none; }
.top .right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { color: #fff; font-weight: 600; }
.hint { margin-top: 14px; font-size: 13px; }
.card.left { text-align: left; margin-top: 24px; }
td select { font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 24px; flex: 1; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; }
.crumbs { font-size: 17px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumbs i { color: var(--muted); font-style: normal; }
.crumbs a { font-weight: 500; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
th, td { padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9fafb; }
td.name { white-space: normal; min-width: 220px; }
td.name > * { vertical-align: middle; }
td.name .ico { margin-right: 8px; }
td.name .ico.lock { margin: 0 0 0 6px; }
td.actions { text-align: right; }
td.actions > * { display: inline-block; margin-left: 4px; vertical-align: middle; }
tr.fresh { background: #fffaeb; }
tr.off { opacity: .55; }
.empty { padding: 44px 16px; text-align: center; color: var(--muted); margin: 0; }

.ico { width: 22px; height: 22px; flex: none; }
.ico.folder { fill: var(--accent); }
.ico.file { fill: #c9d3e0; }
.ico.file .fold { fill: #9fb0c6; }
.ico.lock { fill: var(--muted); width: 16px; height: 16px; }

.status { font-size: 12px; padding: 2px 9px; border-radius: 99px; text-transform: capitalize; background: #f2f4f7; color: var(--muted); }
.status.active { background: #ecfdf3; color: var(--ok); }
input.link { width: 230px; font: 12px ui-monospace, Menlo, monospace; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #f9fafb; color: var(--text); }

/* buttons and forms */
.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; padding: 8px 16px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
}
.btn:hover { text-decoration: none; background: #f9fafb; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { filter: brightness(1.15); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--brand); }
.btn.accent:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.top .btn.ghost { color: rgba(255, 255, 255, .85); }
.btn.ghost:hover { background: rgba(0, 0, 0, .06); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 11px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 14px; text-align: left; }
label.btn { margin: 0; font-size: 15px; }
label input:not([type=file]), label select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit;
  border: 1px solid #cfd6e0; border-radius: 8px; background: #fff;
}
label input:focus, label select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

dialog { border: 0; border-radius: 14px; padding: 24px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(15, 23, 42, .3); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }

/* cards: login, errors, public share pages */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px;
  width: calc(100% - 32px); max-width: 720px; margin: 0 auto; box-shadow: 0 8px 28px rgba(15, 23, 42, .07);
}
.card.narrow { max-width: 400px; text-align: center; }
.card.narrow .logo { margin: 0 auto 16px; }
body.center { justify-content: center; }
body.center .card { margin-top: auto; }
.center-text { text-align: center; max-width: 340px; margin: 0 auto; }
.center-text .ico.lock { width: 38px; height: 38px; fill: var(--brand); }

.hero {
  background: var(--brand); color: #fff; border-bottom: 4px solid var(--accent);
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 36px 16px 76px;
}
.hero-name { font-size: 26px; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.hero-tag { opacity: .8; }
body.public .card { margin-top: -44px; flex: none; }
.filecard { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #f9fafb; margin-bottom: 18px; }
.filecard .ico { width: 40px; height: 40px; }
.filecard .muted { margin: 0; }
.fname { font-weight: 700; font-size: 17px; word-break: break-word; }
body.public .crumbs { margin-bottom: 10px; }
body.public table { border: 1px solid var(--line); border-radius: var(--radius); }

.foot { margin-top: auto; padding: 28px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.card h2 { font-size: 16px; margin: 20px 0 4px; }
.card p { margin: 0 0 10px; }
.foot-name { font-weight: 700; color: var(--text); letter-spacing: .04em; }
.foot a { color: inherit; }
.foot .note:first-of-type { margin-top: 10px; }
.foot .dot { margin: 0 8px; }
.foot .note { margin-top: 4px; font-size: 12px; }

@media (max-width: 720px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .wrap { padding: 16px; }
  .pill { display: none; }
  input.link { width: 180px; }
  .card { padding: 22px; }
}

/* lock badge */
.badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 1px 8px; border-radius: 99px;
  font-size: 12px; background: #eef2f7; color: var(--muted); white-space: nowrap; }
.badge .ico.lock { margin: 0; width: 12px; height: 12px; }
dialog select { max-width: 100%; }

/* file viewer */
body.viewer { height: 100vh; }
.vname { flex: 1; min-width: 0; text-align: center; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; background: #2b303b; }
.stage iframe { position: relative; width: 100%; height: 100%; border: 0; background: #fff; }
.stage.office iframe { background: transparent; }
.stage img, .stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.stage .wait { position: absolute; color: #c9d3e0; margin: 0; }
