/* YODEZEEN Uploads. Чистая светлая тема в духе Rows: чернила на бумаге, волосяные линии, без теней. */
:root {
  --paper: #ffffff;
  --mist: #f7f7f5;
  --ash: #ebebe8;
  --rule: #d9d9d6;
  --ink: #1a1a1a;
  --ink-2: #444444;
  --slate: #686868;
  --graphite: #858585;
  --accent: #ffb84d;
  --accent-soft: #fff6d4;
  --ok: #1d7a43;
  --ok-ink: #17643a;
  --ok-bg: #edf7f0;
  --ok-rule: #c4e3cf;
  --off: #9a5b00;
  --err: #b42318;
  --err-bg: #fdecea;
  --link: #1d4ed8;
  --bar: #e6e6e3;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131313;
    --mist: #1a1a1a;
    --ash: #262626;
    --rule: #343434;
    --ink: #ececec;
    --ink-2: #cfcfcf;
    --slate: #a3a3a3;
    --graphite: #8a8a8a;
    --accent: #ffb84d;
    --accent-soft: #3a2f17;
    --ok: #4cc27f;
    --ok-ink: #7ad7a1;
    --ok-bg: #12261a;
    --ok-rule: #23472f;
    --off: #e0a34a;
    --err: #ff8a80;
    --err-bg: #3a1d1b;
    --link: #8fb0ff;
    --bar: #2c2c2c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body {
  font-family: var(--font); font-size: 14px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum";
  overflow-x: hidden;
}
button, input { font: inherit; color: inherit; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--slate); }
.small { font-size: 12px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ---------- шапка ---------- */
.top { border-bottom: 1px solid var(--ash); background: var(--paper); }
.top-in { padding-top: 18px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--ink-2); }
.logo {
  width: 22px; height: 22px; border-radius: 6px; background: var(--ink); color: var(--paper);
  display: inline-grid; place-items: center; font-size: 13px; font-weight: 800;
}
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; }
h1 { margin: 0; font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; }
.sub { margin: 8px 0 0; color: var(--slate); font-size: 13px; max-width: 760px; }
.tag {
  display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 8px;
  font-size: 11.5px; color: var(--slate); line-height: 1.5; white-space: nowrap;
}
.tag.ok { border-color: var(--ok-rule); color: var(--ok-ink); background: var(--ok-bg); }
.tag.off { border-style: dashed; }

/* ---------- сегменты ---------- */
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--paper); }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--ink-2);
  border-left: 1px solid var(--rule); white-space: nowrap;
}
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg-sm button { padding: 4px 10px; font-size: 12.5px; }

/* ---------- сводка ---------- */
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1.3fr)) repeat(3, minmax(0, 1fr)); gap: 10px; margin: 20px 0 8px; }
.tile { border: 1px solid var(--ash); border-radius: var(--r); padding: 12px 14px; background: var(--paper); min-width: 0; display: flex; flex-direction: column; }
.tile .lbl { font-size: 12px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: auto; }
.tile.total .lbl { white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.tile .num { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; }
.tile .num span { font-weight: 500; color: var(--slate); font-size: 14px; letter-spacing: 0; }
.tile.total .num { font-size: 24px; }
.bar { height: 4px; border-radius: 2px; background: var(--bar); margin-top: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 2px; transition: width .25s ease; }
.sumnote { margin: 0 0 14px; }
.netbar {
  margin: 16px 0 0; padding: 9px 12px; border: 1px solid var(--err); border-radius: var(--r);
  background: var(--err-bg); color: var(--err); font-size: 13px; font-weight: 500;
}

/* ---------- панель ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 12px; }
.search { flex: 1 1 260px; max-width: 420px; }
.search input {
  width: 100%; border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; background: var(--paper);
  font-size: 14px;
}
.search input:focus { border-color: var(--ink-2); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
#shown { margin-left: auto; }

/* ---------- список ---------- */
.list { border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--ash); }
.row.head {
  position: sticky; top: 0; z-index: 2; background: var(--paper); border-bottom: 1px solid var(--rule);
  font-size: 12px; color: var(--slate);
}
.row.head > div { padding: 8px 14px; }
.row.head > div:first-child { padding-left: 0; }
.row.head b { color: var(--ink); font-weight: 600; font-size: 12.5px; }
.row.head .hc { border-left: 1px solid var(--ash); }

.pi { padding: 14px 16px 14px 0; min-width: 0; }
.pi-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.code { font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.folder { font-weight: 500; overflow-wrap: anywhere; margin-top: 2px; }
.odoo {
  font-size: 12px; color: var(--graphite); margin-top: 3px; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.note { font-size: 12px; color: var(--off); margin-top: 4px; overflow-wrap: anywhere; }

.cell { padding: 12px 14px; border-left: 1px solid var(--ash); min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cell.done { background: var(--ok-bg); }
.cl { display: none; font-weight: 600; font-size: 13px; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; min-height: 24px; width: max-content; }
.chk input { width: 18px; height: 18px; margin: 0; accent-color: var(--ok); cursor: pointer; flex: none; }
.chk input:disabled { cursor: progress; }
.cell.done .chk span { color: var(--ok-ink); font-weight: 600; }
.cell.busy .chk span::after { content: " ..."; color: var(--graphite); font-weight: 400; }
.dest { min-width: 0; }
.dest a { font-weight: 500; text-decoration: none; display: inline-block; padding: 2px 0; }
.dest a:hover { text-decoration: underline; }
.path { display: block; font-size: 11.5px; color: var(--graphite); overflow-wrap: anywhere; margin-top: 1px; }
.dest.none { font-size: 12.5px; color: var(--slate); font-style: italic; }
.cnote { font-size: 11.5px; color: var(--graphite); overflow-wrap: anywhere; line-height: 1.35; }
.meta { font-size: 11.5px; color: var(--graphite); overflow-wrap: anywhere; }
.meta.off { color: var(--off); }

.empty { padding: 28px 0; color: var(--slate); text-align: center; }
.grouphead {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px;
  margin-top: 28px; padding: 10px 0 8px; border-bottom: 1px solid var(--rule); font-size: 12.5px;
}
.grouphead b { font-size: 14px; font-weight: 600; }
.row.nf .folder { color: var(--ink-2); }

/* ---------- журнал ---------- */
.logbox { margin: 24px 0 8px; border: 1px solid var(--ash); border-radius: var(--r); }
.logbox summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 13px; }
.log { border-top: 1px solid var(--ash); max-height: 420px; overflow: auto; }
.lg { display: grid; grid-template-columns: 110px 80px 70px 120px 70px minmax(0, 1fr); gap: 8px; padding: 6px 14px; border-bottom: 1px solid var(--ash); font-size: 12.5px; }
.lg:last-child { border-bottom: 0; }
.lg > span { min-width: 0; overflow-wrap: anywhere; }
.lg .on { color: var(--ok-ink); }
.lg .offc { color: var(--off); }

.foot { margin: 20px 0 32px; }

/* ---------- кнопки, тост ---------- */
.btn { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 6px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule); font-weight: 500; }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 20;
  background: var(--ink); color: var(--paper); padding: 9px 14px; border-radius: 8px; font-size: 13px;
  max-width: calc(100vw - 32px);
}
.toast.bad { background: var(--err); color: #fff; }

.gate { max-width: 600px; margin: 48px auto; text-align: center; }
.gate h2 { font-size: 20px; margin: 0 0 8px; }
.gate p { color: var(--slate); margin: 0; }
.gate[data-kind="old"], .gate[data-kind="server"], .gate[data-kind="noproj"], .gate[data-kind="net"], .gate[data-kind="key"] {
  border: 1px solid var(--err); border-radius: 12px; background: var(--err-bg); padding: 22px 24px;
}
.gate[data-kind] h2 { color: var(--err); }
.gate[data-kind="nokey"] { border: 0; background: none; }
.gate[data-kind="nokey"] h2 { color: var(--ink); }
.gate[data-kind] p { color: var(--ink-2); }
.gate .gate-extra { margin-top: 10px; font-weight: 600; color: var(--err); }
.gate #gateCode { margin-top: 10px; color: var(--slate); }
.gate .btn { margin-top: 16px; }

/* ---------- узкие экраны: карточки ---------- */
@media (max-width: 960px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 24px; }
  .summary { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 16px 0 8px; }
  .tile.total { grid-column: span 3; }
  .tile.cat { grid-column: span 2; }
  .tile { padding: 10px 12px; }
  .tile .num { font-size: 17px; }
  .tile .num span { font-size: 12.5px; }
  .tile.total .num { font-size: 20px; }
  .gate { margin: 28px auto; }
  .search { flex-basis: 100%; max-width: none; }
  .seg { max-width: 100%; }
  #shown { margin-left: 0; }
  .list { border-top: 0; }
  .row.head { display: none; }
  .row { display: block; border: 1px solid var(--ash); border-radius: var(--r); margin-bottom: 10px; overflow: hidden; }
  .pi { padding: 12px 14px; }
  .cell {
    border-left: 0; border-top: 1px solid var(--ash); padding: 10px 14px;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cl chk" "dest dest" "cnote cnote" "meta meta";
    gap: 4px 10px; align-items: center;
  }
  .cl { display: block; grid-area: cl; }
  .chk { grid-area: chk; min-height: 32px; }
  .dest { grid-area: dest; }
  .dest a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 8px 0 0; }
  .cnote { grid-area: cnote; }
  .meta { grid-area: meta; }
  .meta:empty { display: none; }
  .lg { grid-template-columns: auto 1fr auto; }
}
@media (max-width: 420px) {
  .seg button { padding: 6px 9px; font-size: 12.5px; }
  .tile .lbl { font-size: 11.5px; }
}
