/* Wild Eyes File Sharing Portal — brand face follows Sentinel Atlas and the
   Batch File EXIF Editor: black band, lynx logo, "Wild Eyes" wordmark in
   Celtica Bold in the logo yellow #f9bd0d, platform name in Cambria Bold
   Italic in the same yellow. Interior keeps the ERP Daylight panels. */
@font-face { font-family: "Celtica"; src: url("/celtica-bold.woff") format("woff");
             font-weight: 700; font-display: swap; }
:root {
  --pine: #1f3d2b;
  --pine-2: #2a5a40;
  --sage: #e9efe5;
  --sage-2: #d8e2d0;
  --ink: #22302a;
  --muted: #68766d;
  --line: #d9dfd5;
  --danger: #a33b2e;
  --bg: #f4f6f1;
  --brand-yellow: #f9bd0d;
  --brand-black: #101312;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
       background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
h1, h2, h3 { color: var(--pine); margin: 0 0 .5rem; }
button, input, select { font: inherit; }

/* ---------- buttons ---------- */
.btn { background: #fff; border: 1px solid var(--line); color: var(--ink);
       padding: .45rem .9rem; border-radius: 8px; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--pine-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--pine-2); }
.btn.danger { color: var(--danger); border-color: #e3c4bf; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.btn.wide { width: 100%; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: #000; }
.auth-col { width: min(400px, 94vw); padding: 1.5rem 0; }
.auth-brand { text-align: center; }
.auth-brand img { width: 240px; max-width: 70vw; }
.auth-portal-name { font-family: Cambria, Georgia, serif; font-weight: 700; font-style: italic;
                    color: var(--brand-yellow); font-size: 27px; letter-spacing: .5px;
                    margin: .2rem 0 1.1rem; }
.auth-card { background: #fff; border-radius: 14px;
             padding: 1.6rem 2rem 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.auth-card .btn.primary { background: #000; border-color: #000; color: var(--brand-yellow);
                          font-weight: 700; }
.auth-card .btn.primary:hover:not(:disabled) { background: #222; }
.auth-card label { display: block; margin: .8rem 0; font-size: .9rem; color: var(--muted); }
.auth-card input { width: 100%; margin-top: .3rem; padding: .55rem .7rem;
                   border: 1px solid var(--line); border-radius: 8px; }
.auth-error { color: var(--danger); min-height: 1.2em; font-size: .9rem; }
.auth-note { color: var(--muted); font-size: .85rem; line-height: 1.45; }
/* ---------- layout ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center;
          background: var(--brand-black); color: #fff; padding: .45rem 1rem; }
.topbar-brand { display: flex; align-items: baseline; gap: .7rem; }
.topbar-mark { height: 42px; align-self: center; }
.wordmark { font-family: "Celtica", Georgia, serif; font-weight: 700;
            color: var(--brand-yellow); font-size: 24px; letter-spacing: .5px; }
.brand-sub { font-family: Cambria, Georgia, serif; font-weight: 700; font-style: italic;
             color: var(--brand-yellow); font-size: 27px; letter-spacing: .5px; }
.topbar-right { display: flex; gap: .8rem; align-items: center; color: #c9cfc9; }
.topbar-right .btn.ghost { color: #fff; border: 1px solid #3a423c; }
@media (max-width: 640px) {
  .wordmark { font-size: 19px; }
  .brand-sub { font-size: 21px; }
  .topbar-mark { height: 34px; }
  .topbar-right span { display: none; }
}
.layout { display: flex; min-height: calc(100vh - 57px); }
.sidebar { width: 230px; background: var(--sage); border-right: 1px solid var(--line);
           padding: 1rem .7rem; flex: none; }
.sidebar h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
              color: var(--muted); margin: 1rem .4rem .4rem; }
.nav-item { display: block; width: 100%; text-align: left; background: transparent;
            border: 0; border-radius: 8px; padding: .5rem .6rem; cursor: pointer; }
.nav-item:hover { background: var(--sage-2); }
.nav-item.active { background: #fff; font-weight: 600; color: var(--pine);
                   box-shadow: inset 3px 0 0 var(--pine); }
.nav-item .lvl { float: right; color: var(--muted); font-size: .78rem; }
.main { flex: 1; padding: 1.2rem 1.4rem; min-width: 0; }

/* ---------- explorer ---------- */
.area-title { display: flex; gap: .7rem; align-items: center; }
.badge { background: var(--sage); border: 1px solid var(--line); border-radius: 99px;
         padding: .1rem .6rem; font-size: .8rem; color: var(--pine); }
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }
.crumbs { margin: .4rem 0 .8rem; color: var(--muted); }
.statusline { margin: -.5rem 0 .6rem; color: var(--muted); font-size: .88rem; }
.crumbs a { color: var(--pine-2); cursor: pointer; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
table.files { width: 100%; border-collapse: collapse; background: #fff;
              border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.files th, table.files td { text-align: left; padding: .5rem .7rem;
              border-bottom: 1px solid var(--line); font-size: .93rem; }
table.files th { background: var(--sage); color: var(--pine); font-weight: 600; }
table.files th.sortable { cursor: pointer; user-select: none; }
table.files th.sortable:hover { text-decoration: underline; }
table.files tr:last-child td { border-bottom: 0; }
table.files td.size, table.files th.size { text-align: right; width: 110px; }
table.files td.mod, table.files th.mod { width: 180px; color: var(--muted); }
table.files th.cb, table.files td.cb { width: 34px; }
table.files tr.folder td.name { font-weight: 600; color: var(--pine); cursor: pointer; }
table.files tr.selected { background: #f0f4ec; }
#dropzone { position: relative; border-radius: 10px; }
#dropzone.dragging { outline: 2px dashed var(--pine-2); outline-offset: 4px; }
.drop-hint { position: absolute; inset: 0; display: grid; place-items: center;
             background: rgba(233,239,229,.92); color: var(--pine); font-weight: 600;
             border-radius: 10px; pointer-events: none; }
.empty { color: var(--muted); padding: 1rem .2rem; }
.note { color: var(--muted); line-height: 1.5; max-width: 70ch; }

/* ---------- cards ---------- */
.cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.cards.col { flex-direction: column; max-width: 520px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.card p { font-size: 1.5rem; margin: .2rem 0 0; color: var(--pine); }
.card label { display: block; margin: .6rem 0; font-size: .9rem; color: var(--muted); }
.card input, .card select { width: 100%; margin-top: .3rem; padding: .5rem .6rem;
             border: 1px solid var(--line); border-radius: 8px; }
.card .note { font-size: .85rem; }

/* ---------- transfers dock ---------- */
.transfers { position: fixed; right: 14px; bottom: 14px; width: min(520px, 94vw);
             background: #fff; border: 1px solid var(--line); border-radius: 12px;
             box-shadow: 0 12px 34px rgba(31,61,43,.18); z-index: 40; }
.transfers-head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem .8rem;
                  border-bottom: 1px solid var(--line); }
.transfers-head .spacer { flex: 1; order: 2; }
.transfers-head strong { order: 1; }
.transfers-head .btn { order: 3; }
#transfers-summary { color: var(--muted); font-size: .88rem; order: 4; flex: 1 1 100%; }
.txseg { white-space: nowrap; }
#transfers-list { max-height: 260px; overflow-y: auto; overflow-x: hidden; padding: .4rem .8rem .7rem; }
.tx-file { padding: .35rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.tx-file:last-child { border-bottom: 0; }
.tx-file .row { display: flex; justify-content: space-between; gap: .6rem; min-width: 0; }
.tx-file .fname { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-file .fstat { color: var(--muted); flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#del-progress { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--muted); }
#del-progress.hidden { display: none; }
.del-bar { display: inline-block; width: 130px; height: 8px; background: var(--sage); border-radius: 99px; overflow: hidden; }
#del-bar-fill { display: block; height: 100%; width: 0; background: var(--danger, #b3261e); border-radius: 99px; transition: width .2s ease; }
.tx-file .bar { height: 6px; background: var(--sage); border-radius: 99px; margin-top: .3rem; }
.tx-file .bar > div { height: 100%; background: var(--pine-2); border-radius: 99px; width: 0; }
.tx-file.failed .fstat { color: var(--danger); }
.tx-file.skipped .fstat { color: var(--muted); }
.transfers-show { position: fixed; right: 14px; bottom: 14px; z-index: 40; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(31,61,43,.35);
              display: grid; place-items: center; z-index: 50;
              overflow-y: auto; padding: 1rem 0; }
.modal { position: relative; background: #fff; border-radius: 14px; padding: 1.4rem;
         width: min(480px, 94vw); max-height: calc(100vh - 3rem); overflow-y: auto; }
.modal-x { position: absolute; top: .5rem; right: .7rem; border: none; background: none;
           font-size: 1.35rem; line-height: 1; color: var(--muted); cursor: pointer;
           padding: .25rem .45rem; border-radius: 8px; }
.modal-x:hover { color: var(--ink); background: var(--panel); }
.share-badge { background: var(--sage); border-color: var(--pine-2); color: var(--pine);
               white-space: nowrap; }

/* ---------- media viewer ---------- */
.viewer { position: fixed; inset: 0; background: rgba(10,18,13,.94); z-index: 60;
          display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; color: #e8ede9; }
.viewer-head .spacer { flex: 1; }
#viewer-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-stage { flex: 1; display: flex; flex-direction: column; align-items: center;
                justify-content: center; min-height: 0; padding: 0 1rem; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-stage video { max-width: 100%; max-height: 100%; }
.viewer-nav { display: flex; justify-content: space-between; padding: .7rem 1rem; }
.viewer .note { color: #b9c6bb; }
td.viewable { cursor: pointer; }
td.viewable:hover { text-decoration: underline; }
.share-row { display: flex; justify-content: space-between; align-items: center;
             padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.modal label { display: block; margin: .7rem 0; font-size: .9rem; color: var(--muted); }
.modal input, .modal select { width: 100%; margin-top: .3rem; padding: .5rem .6rem;
             border: 1px solid var(--line); border-radius: 8px; }
.modal .actions { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
         background: #14231a; color: #e8ede9; padding: .65rem 1.1rem;
         border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.35);
         z-index: 80; font-size: .92rem; max-width: 90vw; text-align: center; }
.mv-folders { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0; min-height: 2rem; }
.modal .spacer { flex: 1; }
