/* NAAC Evidence Viewer — ACU D7 palette (maroon #621708, gold #f6aa1c). */

:root {
  --maroon: #621708;
  --maroon-hi: #7a1d0a;
  --gold: #f6aa1c;
  --text: #1a1a1a;
  --sub: #333;
  --muted: #555;
  --border: #e0e0e0;
  --light: #f5f5f5;
  --danger: #a4231b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: var(--maroon);
  color: #fff;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.01em;
}
.brand-mark { color: var(--gold); }

.search {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
  flex: 1 1 260px;
  max-width: 460px;
}
.search input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.9rem;
}
.search input::placeholder { color: rgba(255, 255, 255, 0.65); }
.search input:focus {
  outline: 2px solid var(--gold);
  background: #fff;
  color: var(--text);
}
.search button {
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 6px;
  background: var(--gold);
  color: var(--maroon);
  font-weight: 800;
  font-size: 0.83rem;
  cursor: pointer;
}

.who {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.who-name { font-weight: 700; }
.pill {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gold);
  color: var(--maroon);
}
.pill-viewer { background: rgba(255, 255, 255, 0.25); color: #fff; }
.logout { color: #fff; text-decoration: underline; opacity: 0.85; }

/* -------------------------------------------------------------------- page */

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }

.flash {
  margin-bottom: 1rem;
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--gold);
  background: rgba(246, 170, 28, 0.15);
  font-size: 0.9rem;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.crumb { color: var(--maroon); text-decoration: none; font-weight: 700; }
.crumb:hover { text-decoration: underline; }
.crumb.here { color: var(--muted); font-weight: 600; }
.sep { color: var(--border); }

.counts { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.empty { color: var(--muted); padding: 2.5rem 0; text-align: center; }
.hint { color: var(--muted); font-size: 0.8rem; }

/* ----------------------------------------------------------------- listing */

.listing {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.listing thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: var(--maroon);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.listing tbody tr { border-bottom: 1px solid var(--border); }
.listing tbody tr:hover { background: var(--light); }
.listing td { padding: 0.55rem 0.75rem; vertical-align: middle; }

.c-size, .c-date { white-space: nowrap; color: var(--muted); font-size: 0.85rem; }
.c-act { white-space: nowrap; text-align: right; }
.c-path { color: var(--muted); font-size: 0.82rem; max-width: 340px; }
.c-path a { color: var(--muted); }

.item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}
a.item:hover .label { color: var(--maroon); text-decoration: underline; }
.item.plain { font-weight: 500; }
.icon { flex: none; font-size: 1.05rem; }

.mini {
  display: inline-block;
  margin-left: 0.3rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: var(--sub);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.mini:hover { border-color: var(--maroon); color: var(--maroon); }
.mini.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ----------------------------------------------------------------- preview */

.preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1rem;
}
.preview-title { margin: 0; font-size: 1.15rem; font-weight: 800; word-break: break-word; }
.preview-actions { display: flex; gap: 0.5rem; }

.btn {
  padding: 0.55rem 1.3rem;
  border-radius: 6px;
  background: var(--maroon);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
}
.btn:hover { background: var(--maroon-hi); }
.btn.ghost { background: #fff; color: var(--maroon); border: 1px solid var(--border); }

.viewer { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--light); }
.pdf { display: block; width: 100%; height: 80vh; border: 0; }
.video { display: block; width: 100%; max-height: 80vh; background: #000; }
.image { display: block; max-width: 100%; margin: 0 auto; }

/* ------------------------------------------------------------------ manage */

.manage {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--light);
}
.manage h2 {
  margin: 0 0 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--maroon);
}
.mgmt-form {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}
.mgmt-label { font-size: 0.82rem; font-weight: 700; min-width: 90px; }
.mgmt-form input[type="text"], .mgmt-form input:not([type]) {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.87rem;
}
.mgmt-form button {
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: 6px;
  background: var(--maroon);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: inherit;
}
.mgmt-form button:hover { background: var(--maroon-hi); }
.mgmt-form .hint { flex-basis: 100%; margin: 0.1rem 0 0; }
.hidden-form { display: none; }

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

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--maroon) 0%, #3d0e05 100%);
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 2.25rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.login-mark { font-size: 1.6rem; color: var(--gold); }
.login-card h1 { margin: 0.4rem 0 0.15rem; font-size: 1.2rem; font-weight: 800; }
.login-sub { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.85rem; }
.login-card label {
  display: block;
  text-align: left;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sub);
}
.login-card input {
  width: 100%;
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
}
.login-card input:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.login-card button {
  width: 100%;
  padding: 0.7rem;
  border: 0;
  border-radius: 6px;
  background: var(--maroon);
  color: #fff;
  font-size: 0.87rem;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
}
.login-card button:hover { background: var(--maroon-hi); }
.login-foot { margin: 1.25rem 0 0; color: var(--muted); font-size: 0.75rem; }
.error {
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: rgba(164, 35, 27, 0.1);
  color: var(--danger);
  font-size: 0.83rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------ footer */

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 1180px;
  margin: 3rem auto 0;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 720px) {
  .c-date, .c-path { display: none; }
  .topbar { gap: 0.75rem; }
  .search { order: 3; max-width: none; margin-left: 0; }
  .who { margin-left: auto; }
}

/* ------------------------------------------------------- audit and trash */

.navlink {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 5px;
}
.navlink:hover { background: rgba(255, 255, 255, 0.15); }

.chain {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.87rem;
}
.chain.ok { background: rgba(31, 122, 60, 0.1); border-left: 4px solid #1f7a3c; }
.chain.bad { background: rgba(164, 35, 27, 0.12); border-left: 4px solid var(--danger); color: #7a1a14; }

.note {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--light);
  border-left: 4px solid var(--gold);
  font-size: 0.85rem;
  color: var(--sub);
}
.note code { font-size: 0.85em; background: #fff; padding: 0.1rem 0.35rem; border-radius: 4px; }

.filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--light);
  border-radius: 6px;
}
.filters label { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.filters input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.85rem;
}
.filters button {
  padding: 0.42rem 1rem;
  border: 0;
  border-radius: 5px;
  background: var(--maroon);
  color: #fff;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: inherit;
}

.audit { font-size: 0.82rem; }
.c-when { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-ip { white-space: nowrap; color: var(--muted); font-size: 0.78rem; }
.c-detail { color: var(--sub); word-break: break-word; }
.kv { display: inline-block; margin-right: 0.7rem; }
.kv em { color: var(--muted); font-style: normal; font-weight: 700; }

.ev {
  display: inline-block;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: var(--light);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}
.ev-bad { background: rgba(164, 35, 27, 0.12); border-color: rgba(164, 35, 27, 0.3); color: var(--danger); }
.ev-write { background: rgba(246, 170, 28, 0.2); border-color: rgba(246, 170, 28, 0.5); color: #7a4b00; }

.inline { display: inline; }

/* --------------------------------------------------- OTP login + branding */

.otp-input {
  text-align: center;
  font-size: 1.6rem !important;
  font-weight: 800;
  letter-spacing: 0.5em;
  text-indent: 0.5em;   /* re-centres text that letter-spacing pushes left */
  font-variant-numeric: tabular-nums;
}

.notice-box {
  margin-bottom: 1rem;
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  background: rgba(246, 170, 28, 0.18);
  color: #6b4700;
  font-size: 0.83rem;
  font-weight: 600;
}

.restart-form { margin: 0; }
.linkish {
  width: auto !important;
  background: none !important;
  border: 0;
  padding: 0 !important;
  color: var(--muted) !important;
  font-size: 0.78rem !important;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.linkish:hover { color: var(--maroon) !important; }

.login-brand {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
}

.foot-brand { color: var(--muted); font-size: 0.78rem; }
.foot-brand a { color: var(--maroon); font-weight: 700; text-decoration: none; }
.foot-brand a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ user admin */

.pill-superadmin { background: #111; color: var(--gold); }
.pill-admin { background: var(--gold); color: var(--maroon); }
.pill-editor { background: rgba(246, 170, 28, 0.35); color: #6b4700; }

.mgmt-form select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.87rem;
  font-family: inherit;
  background: #fff;
}
.mgmt-form input[type="email"] {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.87rem;
}
.scope-row { align-items: flex-start; }
.chk {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.chk:hover { border-color: var(--maroon); }

/* ---------------------------------------------------------- copy-link */

.mini.copied, .btn.copied {
  border-color: #1f7a3c !important;
  color: #1f7a3c !important;
  background: rgba(31, 122, 60, 0.1) !important;
}
.copy-hint { margin: 0.75rem 0 0; }
.copy-url {
  background: var(--light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  word-break: break-all;
}

/* --------------------------------------------------------------- sorting */

.sort { color: #fff; text-decoration: none; display: inline-block; }
.sort:hover { text-decoration: underline; }
.sort.sorted { color: var(--gold); }

/* ------------------------------------------------------------- dashboard */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.9rem;
  margin: 0.5rem 0 1.75rem;
}
.stat {
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--light);
}
.stat-num { font-size: 1.5rem; font-weight: 800; color: var(--maroon); line-height: 1.1; }
.stat-lbl {
  margin-top: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.section-h {
  margin: 2rem 0 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--maroon);
  overflow: hidden;
}
.bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar-fill { height: 100%; background: var(--gold); }

.u-link { color: var(--maroon); text-decoration: none; font-weight: 600; }
.u-link:hover { text-decoration: underline; }

/* --------------------------------------------------------- move / copy */

.mvcp-panel {
  position: sticky;
  bottom: 0;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #fff;
  border: 2px solid var(--maroon);
  border-radius: 8px;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.12);
}
.mvcp-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.mvcp-title { font-weight: 700; font-size: 0.87rem; }
.mvcp-form input[name="dest"] {
  flex: 1 1 260px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.87rem;
}
.mvcp-form button[type="submit"] {
  padding: 0.45rem 1.1rem; border: 0; border-radius: 6px;
  background: var(--maroon); color: #fff; font-weight: 800; font-size: 0.8rem;
  cursor: pointer; font-family: inherit;
}

/* ------------------------------------------------- monitoring (view only) */

.pill-monitor { background: #1f5c7a; color: #fff; }
.view-only-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  color: #7a1d0a;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.captcha-wrap { margin: 0 0 1rem; display: flex; justify-content: center; }

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

.qr-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
}
.qr-box {
  background: #fff; border-radius: 10px; padding: 1.5rem;
  max-width: 340px; width: 100%; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.qr-name { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.9rem; word-break: break-word; }
.qr-svg { width: 240px; height: 240px; margin: 0 auto; }
.qr-svg svg { width: 100%; height: 100%; display: block; }
.qr-url {
  margin: 0.9rem 0 1rem; font-size: 0.72rem; color: var(--muted);
  word-break: break-all; background: var(--light); padding: 0.4rem 0.6rem; border-radius: 5px;
}
