/* ==========================================================================
   Catalogue Portal - design system
   Static mockup stylesheet. No build step, no CDN, works offline.
   ========================================================================== */

:root {
  --bg:          #f4f6f9;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --ink:         #0f172a;
  --ink-2:       #334155;
  --muted:       #64748b;
  --faint:       #94a3b8;
  --line:        #e3e8ef;
  --line-2:      #cbd5e1;

  --brand:       #2563eb;
  --brand-dark:  #1d4ed8;
  --brand-soft:  #eff4ff;

  --pdf:         #dc2626;
  --pdf-soft:    #fef2f2;
  --img:         #059669;
  --img-soft:    #ecfdf5;
  --video:       #7c3aed;
  --video-soft:  #f5f3ff;

  --warn:        #d97706;
  --warn-soft:   #fffbeb;
  --danger:      #dc2626;
  --danger-soft: #fef2f2;
  --ok:          #059669;
  --ok-soft:     #ecfdf5;

  --sidebar:     #0f172a;
  --sidebar-2:   #1e293b;
  --sidebar-ink: #cbd5e1;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;

  --sh-1: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --sh-2: 0 4px 12px rgba(15,23,42,.08);
  --sh-3: 0 12px 32px rgba(15,23,42,.14);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

p { margin: 0 0 10px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny  { font-size: 11.5px; }
.mono  { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

/* ---------- app shell ---------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 244px;
  flex: 0 0 244px;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex: 0 0 32px;
}
.brand-text { line-height: 1.25; }
.brand-text strong { color: #fff; font-size: 14px; display: block; font-weight: 650; }
.brand-text span { font-size: 11px; color: #64748b; }

.nav { padding: 14px 10px; flex: 1; overflow-y: auto; }
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #64748b;
  padding: 12px 10px 6px;
  font-weight: 650;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  color: var(--sidebar-ink);
  font-size: 13.5px;
  margin-bottom: 2px;
  text-decoration: none;
  transition: background .12s, color .12s;
}
.nav a:hover { background: var(--sidebar-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; font-weight: 550; }
.nav a .ico { flex: 0 0 16px; opacity: .85; }
.nav a.active .ico { opacity: 1; }
.nav a .count {
  margin-left: auto;
  font-size: 11px;
  background: rgba(255,255,255,.1);
  padding: 1px 7px;
  border-radius: 20px;
}

.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.side-user { display: flex; align-items: center; gap: 10px; }
.side-user .avatar { flex: 0 0 32px; }
.side-user-meta { min-width: 0; line-height: 1.3; }
.side-user-meta strong { color: #fff; font-size: 12.5px; display: block; font-weight: 600; }
.side-user-meta span { font-size: 11px; color: #64748b; display: block; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }

.content { padding: 22px; flex: 1; }
.content.narrow { max-width: 980px; }

.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ---------- buttons ------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 550;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, box-shadow .12s;
  text-decoration: none;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:active { transform: translateY(.5px); }

.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }

.btn-quiet { background: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line-2); }
.icon-btn.danger:hover { color: var(--danger); border-color: #fca5a5; background: var(--danger-soft); }

/* ---------- cards / panels ---------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 18px; }
.card-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 0 0 var(--r) var(--r);
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.split { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.split.solo { grid-template-columns: minmax(0, 1fr); }

/* ---------- stats -------------------------------------------------------- */

.stat { padding: 16px 18px; }
.stat .label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
}
.stat .value { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin-top: 4px; }
.stat .foot { font-size: 12px; color: var(--faint); margin-top: 2px; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- tables ------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 650;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table td strong { font-weight: 600; }

/* ---------- badges / chips ---------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 21px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-pdf   { background: var(--pdf-soft);   color: var(--pdf); }
.badge-image { background: var(--img-soft);   color: var(--img); }
.badge-video { background: var(--video-soft); color: var(--video); }
.badge-ok    { background: var(--ok-soft);    color: var(--ok); }
.badge-off   { background: #f1f5f9;           color: var(--muted); }
.badge-warn  { background: var(--warn-soft);  color: var(--warn); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 20px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12.5px;
  font-weight: 550;
  border: 1px solid #dbe6ff;
}
.chip .x {
  width: 18px; height: 18px;
  display: grid; place-items: center;
  border-radius: 50%;
  cursor: pointer;
  color: #7c9cf5;
}
.chip .x:hover { background: #dbe6ff; color: var(--brand-dark); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #e2e8f0;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  flex: 0 0 auto;
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.avatar.b1 { background: #dbeafe; color: #1d4ed8; }
.avatar.b2 { background: #dcfce7; color: #15803d; }
.avatar.b3 { background: #fae8ff; color: #a21caf; }
.avatar.b4 { background: #ffedd5; color: #c2410c; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .meta { line-height: 1.3; min-width: 0; }
.user-cell .meta strong { display: block; font-size: 13.5px; }
.user-cell .meta span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- forms -------------------------------------------------------- */

.field { margin-bottom: 16px; }
.field > label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.req { color: var(--danger); }

.input, .select, textarea.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.13);
}
.input::placeholder { color: var(--faint); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.search {
  position: relative;
  display: inline-block;
}
.search .input { padding-left: 34px; width: 260px; }
.search svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
}
.switch .track {
  width: 38px; height: 21px;
  border-radius: 20px;
  background: var(--brand);
  position: relative;
  transition: background .15s;
  flex: 0 0 38px;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2.5px; left: 19.5px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch.off .track { background: var(--line-2); }
.switch.off .track::after { left: 2.5px; }

.check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  background: var(--surface);
  cursor: pointer;
  flex: 0 0 16px;
}
.check.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- steps -------------------------------------------------------- */

.steps { display: flex; align-items: center; gap: 0; margin-bottom: 22px; }
.step { display: flex; align-items: center; gap: 9px; }
.step .n {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 650;
  background: var(--line);
  color: var(--muted);
  flex: 0 0 26px;
}
.step .t { font-size: 13px; color: var(--muted); font-weight: 550; }
.step.done .n { background: var(--ok); color: #fff; }
.step.done .t { color: var(--ink-2); }
.step.now .n { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.step.now .t { color: var(--ink); font-weight: 650; }
.step-line { flex: 1; height: 1.5px; background: var(--line); margin: 0 12px; min-width: 20px; }
.step-line.done { background: var(--ok); }

/* ---------- dropzone / upload ------------------------------------------- */

.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 34px 20px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--brand); background: var(--brand-soft); }
.dropzone .zicon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin: 0 auto 12px;
  color: var(--brand);
}
.dropzone strong { display: block; font-size: 14.5px; margin-bottom: 3px; }

.upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.upload-row:last-child { border-bottom: 0; }
.upload-row .ftype {
  width: 38px; height: 38px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  flex: 0 0 38px;
}
.ftype.pdf   { background: var(--pdf-soft);   color: var(--pdf); }
.ftype.image { background: var(--img-soft);   color: var(--img); }
.ftype.video { background: var(--video-soft); color: var(--video); }
.upload-row .fmeta { flex: 1; min-width: 0; }
.upload-row .fmeta strong { display: block; font-size: 13.5px; font-weight: 600; }
.upload-row .fmeta span { font-size: 12px; color: var(--muted); }

.bar { height: 5px; background: var(--line); border-radius: 20px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 20px; }
.bar.done i { background: var(--ok); }

/* ---------- tabs --------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.tabs a {
  padding: 10px 15px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs a .n {
  font-size: 11px;
  background: var(--line);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 650;
}
.tabs a.active .n { background: var(--brand-soft); color: var(--brand); }

/* ---------- file cards --------------------------------------------------- */

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 16px; }

.fcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.fcard:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--line-2); }

.thumb {
  height: 132px;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.thumb.pdf   { background: linear-gradient(150deg, #fff1f2, #fee2e2); }
.thumb.image { background: linear-gradient(150deg, #ecfdf5, #d1fae5); }
.thumb.video { background: linear-gradient(150deg, #f5f3ff, #ede9fe); }
.thumb .glyph { opacity: .5; }
.thumb .badge { position: absolute; top: 9px; left: 9px; }
.thumb .len {
  position: absolute; bottom: 9px; right: 9px;
  background: rgba(15,23,42,.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.thumb .play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: var(--sh-2);
  display: grid; place-items: center;
  color: var(--video);
}
.fcard-body { padding: 12px 13px; }
.fcard-body .name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fcard-body .meta { font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fcard-foot {
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.fcard-foot .assigned { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.fcard-foot .sp { margin-left: auto; display: flex; gap: 5px; }

/* ---------- project cards ----------------------------------------------- */

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--sh-1);
  transition: box-shadow .15s, transform .15s, border-color .15s;
  display: block;
  color: inherit;
}
.pcard:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.pcard .ptop { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.pcard .picon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
  flex: 0 0 42px;
}
.pcard h3 { font-size: 15px; line-height: 1.35; }
.pcard .client { font-size: 12.5px; color: var(--muted); }
.pcard .pcounts { display: flex; gap: 14px; padding-top: 13px; border-top: 1px solid var(--line); }
.pcard .pc { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.pcard .pc b { color: var(--ink); font-weight: 650; font-size: 13px; }

/* ---------- empty state -------------------------------------------------- */

.empty { padding: 56px 24px; text-align: center; }
.empty .eicon {
  width: 60px; height: 60px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  margin: 0 auto 14px;
  color: var(--faint);
}
.empty h3 { margin-bottom: 5px; }
.empty p { color: var(--muted); max-width: 380px; margin: 0 auto; }

/* ---------- notices ------------------------------------------------------ */

.notice {
  display: flex;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid;
  margin-bottom: 18px;
}
.notice .nico { flex: 0 0 18px; margin-top: 1px; }
.notice-info  { background: var(--brand-soft); border-color: #d6e4ff; color: #1e40af; }
.notice-warn  { background: var(--warn-soft);  border-color: #fde68a; color: #92400e; }
.notice-ok    { background: var(--ok-soft);    border-color: #a7f3d0; color: #065f46; }
.notice b { font-weight: 650; }

/* ---------- modal -------------------------------------------------------- */

.modal-wrap {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.modal-head { padding: 18px 20px 0; }
.modal-body { padding: 12px 20px 18px; }
.modal-foot {
  padding: 14px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.modal .warn-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  display: grid; place-items: center;
  margin-bottom: 13px;
}

/* ---------- login -------------------------------------------------------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-art {
  background: linear-gradient(150deg, #1e3a8a, #0f172a 60%);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-art::after {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,.35), transparent 68%);
  right: -130px; bottom: -130px;
}
.auth-art .brand-text strong { font-size: 15px; }
.auth-art h2 { color: #fff; font-size: 27px; line-height: 1.3; max-width: 400px; }
.auth-art p { color: #94a3b8; max-width: 380px; margin-top: 12px; font-size: 14px; }
.auth-art .pts { position: relative; z-index: 1; }
.auth-pt { display: flex; gap: 11px; align-items: flex-start; margin-top: 16px; font-size: 13.5px; color: #cbd5e1; }
.auth-pt .d {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(59,130,246,.22);
  color: #93c5fd;
  display: grid; place-items: center;
  flex: 0 0 20px;
  margin-top: 1px;
}
.auth-form {
  display: grid;
  place-items: center;
  padding: 40px 24px;
  background: var(--surface);
}
.auth-box { width: 100%; max-width: 358px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .lead { color: var(--muted); margin-bottom: 26px; font-size: 13.5px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12.5px; color: var(--faint); }

/* ---------- employee portal --------------------------------------------- */

.portal-top {
  height: 60px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.portal-top .brand { padding: 0; border: 0; }
.portal-top .brand-text strong { color: var(--ink); }
.portal-nav { display: flex; gap: 4px; margin-left: 22px; }
.portal-nav a {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  text-decoration: none;
}
.portal-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.portal-nav a.active { background: var(--brand-soft); color: var(--brand-dark); }
.portal-wrap { max-width: 1140px; margin: 0 auto; padding: 26px 24px 60px; }

/* ---------- viewer ------------------------------------------------------- */

.viewer-shell {
  min-height: 100vh;
  background: #0f172a;
  display: flex;
  flex-direction: column;
}
.viewer-bar {
  height: 56px;
  background: #1e293b;
  border-bottom: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  color: #e2e8f0;
  flex: 0 0 56px;
}
.viewer-bar .vtitle { font-size: 14px; font-weight: 600; color: #fff; }
.viewer-bar .vsub { font-size: 12px; color: #94a3b8; }
.viewer-bar .spacer { flex: 1; }
.vbtn {
  height: 32px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: #334155;
  border: 1px solid #475569;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 550;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}
.vbtn:hover { background: #475569; color: #fff; text-decoration: none; }
.vbtn.icon { width: 32px; padding: 0; justify-content: center; }
.vpage {
  font-size: 12.5px;
  color: #cbd5e1;
  background: #334155;
  border: 1px solid #475569;
  border-radius: var(--r-sm);
  height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 8px;
}
.vpage input {
  width: 34px;
  height: 22px;
  background: #0f172a;
  border: 1px solid #475569;
  border-radius: 4px;
  color: #fff;
  text-align: center;
  font-size: 12px;
  font-family: inherit;
}

.viewer-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 26px;
  overflow: auto;
  position: relative;
}

.doc-page {
  width: 620px;
  max-width: 100%;
  aspect-ratio: 1 / 1.414;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  padding: 52px 56px;
}
.doc-line { height: 9px; background: #e2e8f0; border-radius: 3px; margin-bottom: 11px; }
.doc-line.t { height: 17px; width: 62%; background: #cbd5e1; margin-bottom: 22px; }
.doc-line.s { width: 82%; }
.doc-line.m { width: 94%; }
.doc-block { height: 108px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; margin: 20px 0; }

.watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 5;
}
.watermark span {
  font-size: 15px;
  font-weight: 650;
  color: rgba(15,23,42,.11);
  transform: rotate(-28deg);
  white-space: nowrap;
  letter-spacing: .06em;
  line-height: 3.4;
  text-align: center;
}

.video-frame {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r);
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 44px rgba(0,0,0,.5);
  display: grid;
  place-items: center;
}
.video-frame .vplay {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  border: 1.5px solid rgba(255,255,255,.35);
  display: grid; place-items: center;
  color: #fff;
  backdrop-filter: blur(4px);
}
.video-ctrl {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 16px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.82));
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.video-ctrl .track { flex: 1; height: 4px; background: rgba(255,255,255,.28); border-radius: 20px; }
.video-ctrl .track i { display: block; height: 100%; width: 34%; background: var(--brand); border-radius: 20px; position: relative; }
.video-ctrl .track i::after {
  content: "";
  position: absolute; right: -5px; top: -3px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
}
.video-ctrl .t { font-size: 12px; color: #e2e8f0; font-variant-numeric: tabular-nums; }

.img-stage {
  max-width: 820px;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(140deg, #cbd5e1, #94a3b8);
  border-radius: var(--r);
  box-shadow: 0 12px 44px rgba(0,0,0,.45);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.75);
}

.viewer-foot {
  height: 46px;
  background: #1e293b;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  color: #64748b;
  font-size: 12px;
  flex: 0 0 46px;
}
.lock-note { display: flex; align-items: center; gap: 7px; color: #94a3b8; }

/* ---------- misc --------------------------------------------------------- */

.divider { height: 1px; background: var(--line); margin: 18px 0; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 550; text-align: right; }

.pager { display: flex; align-items: center; gap: 6px; }
.pager a, .pager span {
  min-width: 30px; height: 30px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  display: inline-grid;
  place-items: center;
  font-size: 12.5px;
  text-decoration: none;
}
.pager a:hover { background: var(--surface-2); text-decoration: none; }
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .sidebar { display: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

/* no-download hardening (mirrors the production rules) */
.noselect { user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
@media print { .viewer-shell { display: none !important; } }
