/* Shared Monek design system — header/bands/footer + card form components.
   Used by the authenticated pages (login, register, app, admin). The public
   upload form (index.html) keeps its own inline copy. */

:root {
  --black: #0a0a0b;
  --teal: #0d6677;
  --teal-dark: #0a525f;
  --teal-tint: #e7f1f3;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e3e6e8;
  --line-strong: #d2d6d9;
  --page: #f5f6f7;
  --card: #ffffff;
  --success: #15803d;
  --success-bg: #ecfdf3;
  --success-line: #abefc6;
  --error: #b42318;
  --error-bg: #fef3f2;
  --error-line: #fda29b;
  --amber: #b45309;
  --amber-bg: #fffaeb;
  --amber-line: #fedf89;
  --radius: 12px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; text-decoration: none; }
.logo__img { height: 30px; width: auto; display: block; }

/* ---------- Header ---------- */
header.site { background: var(--black); padding: 18px 24px; }
.site__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site__nav { display: flex; align-items: center; gap: 18px; }
.site__nav a { color: rgba(255,255,255,0.82); text-decoration: none; font-size: 14px; font-weight: 600; }
.site__nav a:hover { color: #fff; }

/* ---------- Angled band motif ---------- */
.bands { position: relative; height: 46px; overflow: hidden; background: var(--page); }
.bands--top { background: var(--black); }
.bands__band { position: absolute; left: -10%; width: 120%; height: 16px; transform: skewY(-2deg); transform-origin: left; }
.bands--top .bands__band-1 { top: 6px; background: #2a2c2f; }
.bands--top .bands__band-2 { top: 24px; background: #1a1b1d; }
.bands--bottom .bands__band-1 { top: 8px; background: #dfe2e4; }
.bands--bottom .bands__band-2 { top: 26px; background: #ebedee; }

/* ---------- Layout ---------- */
main { flex: 1 0 auto; width: 100%; }
.wrap { max-width: 720px; margin: 0 auto; padding: 8px 24px 64px; }
.wrap--narrow { max-width: 460px; }
.wrap--wide { max-width: 960px; }
.intro { margin: 28px 0 22px; }
.intro h1 { font-size: 28px; line-height: 1.18; font-weight: 750; letter-spacing: -0.01em; margin: 0 0 8px; }
.intro p { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 56ch; }

/* ---------- Card ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 30px;
  box-shadow: 0 1px 2px rgba(16,24,40,0.04), 0 8px 28px rgba(16,24,40,0.05);
}
.card + .card { margin-top: 20px; }

/* ---------- Fields ---------- */
.field { margin-bottom: 20px; }
.field:last-of-type { margin-bottom: 0; }
label.lab { display: block; font-size: 13.5px; font-weight: 650; color: var(--ink); margin-bottom: 7px; }
.req { color: var(--teal); margin-left: 2px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%; font-family: var(--font); font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder, textarea::placeholder { color: #9aa1a9; }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13,102,119,0.16); }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }

/* ---------- Buttons ---------- */
.btn-primary {
  width: 100%; appearance: none; border: none; font-family: var(--font);
  font-size: 15.5px; font-weight: 700; color: #fff; background: var(--teal);
  border-radius: 11px; padding: 14px 20px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s ease, transform .05s ease;
}
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .7; cursor: progress; }
.btn-ghost {
  appearance: none; font-family: var(--font); font-size: 13.5px; font-weight: 600;
  color: var(--teal); background: #fff; border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 9px 14px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-tint); }
.btn-danger { color: var(--error); }
.btn-danger:hover { border-color: var(--error-line); background: var(--error-bg); }

/* Case-list action buttons: red = needs a response, green = responded (view). */
.btn-act {
  appearance: none; border: none; font-family: var(--font); font-size: 13.5px;
  font-weight: 700; color: #fff; border-radius: 8px; padding: 9px 16px;
  cursor: pointer; white-space: nowrap; transition: background .15s ease;
}
.btn-act--urgent { background: var(--error); }
.btn-act--urgent:hover { background: #9a1c13; }
.btn-act--ok { background: var(--success); }
.btn-act--ok:hover { background: #116a32; }

.spinner {
  width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none;
}
.is-busy .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Links / helpers ---------- */
.link { color: var(--teal); text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.formfoot { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }

/* ---------- Alerts ---------- */
.alert {
  display: none; align-items: flex-start; gap: 11px; border-radius: var(--radius);
  padding: 13px 15px; font-size: 14px; margin-bottom: 18px; border: 1px solid;
}
.alert.show { display: flex; }
.alert--success { background: var(--success-bg); border-color: var(--success-line); color: #14532d; }
.alert--error { background: var(--error-bg); border-color: var(--error-line); color: #7a271a; }
.alert--info { background: var(--amber-bg); border-color: var(--amber-line); color: #7a4d0a; }
.alert b { display: block; font-weight: 700; margin-bottom: 1px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.badge--pending { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
.badge--approved { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-line); }
.badge--rejected { background: var(--error-bg); color: var(--error); border: 1px solid var(--error-line); }

.mid-chip { display: inline-block; font-size: 13px; font-weight: 600; color: var(--teal);
  background: var(--teal-tint); border-radius: 7px; padding: 4px 10px; margin: 2px 4px 2px 0; }

/* ---------- Table (admin) ---------- */
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.utable td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.utable tr:last-child td { border-bottom: none; }
.utable tr.row-click { cursor: pointer; }
.utable tr.row-click:hover td { background: #f2f7f8; }
.muted { color: var(--muted); }

/* ---------- Footer ---------- */
footer.site { background: var(--black); color: rgba(255,255,255,0.72); padding: 40px 24px 28px; flex-shrink: 0; }
.foot__inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot__brand p { margin: 14px 0 0; font-size: 13px; color: rgba(255,255,255,0.5); max-width: 34ch; }
.foot h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.5); margin: 4px 0 14px; font-weight: 700; }
.foot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.foot a { color: rgba(255,255,255,0.82); text-decoration: none; font-size: 14px; }
.foot a:hover { color: #fff; }
.foot__contact span { display: block; font-size: 14px; color: rgba(255,255,255,0.82); }
.foot__contact span + span { margin-top: 10px; }
.foot__copy { max-width: 1100px; margin: 30px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 12.5px; color: rgba(255,255,255,0.45); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 640px) {
  .card { padding: 22px 18px; border-radius: 14px; }
  .intro h1 { font-size: 24px; }
  .wrap { padding: 4px 16px 48px; }
  .foot__inner { grid-template-columns: 1fr; gap: 28px; }
  .bands, .bands--top, .bands--bottom { height: 38px; }
}

/* ---------- Dropzone + file list (case evidence upload) ---------- */
.dropzone {
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  background: #fbfcfc; padding: 26px 22px; text-align: center;
  transition: border-color .15s ease, background .15s ease; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--teal); background: var(--teal-tint); }
.dropzone__title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.dropzone__sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.filelist { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.filelist:empty { margin: 0; }
.fileitem {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--line);
  background: #fff; border-radius: 10px; padding: 9px 12px;
}
.fileitem__name { font-size: 14px; font-weight: 600; color: var(--ink); flex: 1 1 auto;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fileitem__size { font-size: 12px; color: var(--muted); }
.fileitem__rm {
  appearance: none; border: none; background: transparent; color: var(--muted);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.fileitem__rm:hover { background: var(--error-bg); color: var(--error); }

/* Submission history on a case */
.sub-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.sub-item__head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.sub-item__ctx { font-size: 14px; white-space: pre-wrap; margin: 4px 0 8px; }
.sub-item a { color: var(--teal); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-right: 14px; }
.sub-item a:hover { text-decoration: underline; }

/* ---------- Modal (Help guide etc.) ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,10,11,0.55);
  display: none; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; z-index: 50;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; max-width: 860px; width: 100%;
  max-height: 92vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(16,24,40,0.25);
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { margin: 0; font-size: 18px; }
.modal__close {
  appearance: none; border: none; background: transparent; font-size: 22px;
  line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 9px; border-radius: 6px;
}
.modal__close:hover { background: var(--page); color: var(--ink); }
.modal__body { padding: 20px 22px 26px; overflow-y: auto; font-size: 14px; }
.modal__body h3 { font-size: 15.5px; margin: 24px 0 8px; }
.modal__body h3:first-child { margin-top: 0; }
.modal__body h4 { font-size: 13.5px; margin: 16px 0 6px; }
.modal__body p { margin: 0 0 10px; }
.gtable { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 4px; }
.gtable th { background: var(--teal); color: #fff; text-align: left; padding: 7px 10px; font-size: 12px; }
.gtable td { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.gtable ul { margin: 0; padding-left: 18px; }
.gtable li { margin: 3px 0; }

/* ---------- Dashboard shell (admin / logged-in app chrome) ----------
   Top bar + dark left sidebar + content pane, in the style of an analytics
   dashboard. Pages opt in with <body class="dash">. */
body.dash { background: var(--page); }
.dash__top {
  background: var(--black); padding: 0 20px; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.dash__top .logo__img { height: 26px; }
.dash__top-right { display: flex; align-items: center; gap: 16px; }
.dash__user { color: rgba(255,255,255,0.6); font-size: 13px; }
.dash__top a.signout { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 13.5px; font-weight: 600; }
.dash__top a.signout:hover { color: #fff; }

.dash__body { flex: 1 0 auto; display: flex; align-items: stretch; min-height: 0; }
.dash__side {
  flex: 0 0 215px; background: #21262b; padding: 14px 0 24px;
  display: flex; flex-direction: column;
}
.side__group {
  color: rgba(255,255,255,0.45); font-size: 11px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 16px 18px 8px; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 8px;
}
.side__group:first-child { border-top: none; margin-top: 0; }
.side__item {
  display: block; color: rgba(255,255,255,0.78); text-decoration: none;
  font-size: 13.5px; font-weight: 600; padding: 11px 18px;
  border-left: 3px solid transparent; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.side__item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.side__item.active { background: var(--teal); color: #fff; border-left-color: #9ad2dd; }

.dash__main { flex: 1 1 auto; min-width: 0; padding: 22px 26px 48px; }
.crumb {
  font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.crumb b { color: var(--ink); }
.dash__main .card { border-radius: 12px; }

@media (max-width: 760px) {
  .dash__body { flex-direction: column; }
  .dash__side { flex: none; flex-direction: row; overflow-x: auto; padding: 0; }
  .side__group { display: none; }
  .side__item { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
  .side__item.active { border-bottom-color: #9ad2dd; }
  .dash__main { padding: 18px 16px 40px; }
}
