:root {
  --bg: #0f172a;
  --card: #0b1020;
  --accent: #38bdf8;
  --text: #232323;
  --muted: #3e4b5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: url('/files/bg.jpg') no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  font-size: 14px;
}

body.no-hero {
  background: #f3f4f6;
  background-size: auto;
}

body.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

body.page-top {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 10px;
}

.page-pad { padding: 8px; padding-top: 28px; }

a { color: inherit; }

h1 { margin: 0 0 10px; font-size: 28px; letter-spacing: -0.3px; }
h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -0.2px; }
h3 { margin: 18px 0 10px; font-size: 18px; }
p { margin: 0 0 12px; line-height: 1.6; color: var(--muted); }

.muted { color: var(--muted); }

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.wrap-wide { max-width: 1100px; }
.wrap-narrow { max-width: 720px; }

.card {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  background-color: #fff;
  padding: 28px 26px 32px;
  margin-bottom: 18px;
  width: 100%;
}

.card-narrow { max-width: 460px; }
.card-medium { max-width: 720px; }
.card-wide { max-width: 1100px; }

.cardline {
display: flex;
justify-content: space-between;
padding-top: 15px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin: 12px 0 6px;
  color: #1f2933;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d6d8e1;
  border-radius: 12px;
  background: #fafbff;
  font-size: 15px;
}

textarea { min-height: 120px; font-family: inherit; }

input[type="file"] { margin-top: 4px; }

form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }

.form-row { margin: 10px 0; }
.form-row label { margin-top: 8px; }
.actions { margin-top: 12px; }

.btn,
.cta,
.ctax {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  padding: 18px 24px;
  border-radius: 24px;
  border: 2px solid #2196f3;
  background: #e1e1e11a;
  color: #0b1020;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 2px rgba(14, 164, 233, 0.153);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, color 150ms ease;
  cursor: pointer;
  width: fit-content;
}

.btn:hover,
.cta:hover,
.ctax:hover {
  transform: translateY(0);
  box-shadow: 0 4px 4px rgba(14, 164, 233, 0.079);
  background-color: #cee9ff2c;
  border-color: #2195f3e1;
  color: #232323ce;
}

.btn-secondary {
  border-color: #d6d8e1;
  background: #f8fafc;
  color: #111827;
}

.btn-secondary:hover {
  background: #eef2ff;
}

.ctax {
  background-color: #007ad0;
  color: #ffffff;
  justify-content: center;
}

.ctax:hover {
  background-color: #006bb8ff;
  color: #ffffffce;
}

.icon,
.iconx {
  width: 18px;
  height: 18px;
  margin-right: -5px;
  fill: #0077ff;
}

.iconx { fill: #ffffff; }

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.section-title h3 { margin: 10px 0 15px; }

.msg {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f8ff;
  margin-bottom: 10px;
  border: 1px solid #e4e6ef;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.msg .meta {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 600;
}

.msg .body {
  font-size: 15px;
  color: #1f2933;
  white-space: pre-wrap;
}

.attachments { margin-top: 6px; font-size: 13px; }
.attachments a { margin-right: 8px; }

.char-counter { font-size: 12px; margin-top: 4px; color: var(--muted); }

.meta-heading {
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-size: 12px;
  color: #6b7280;
  font-weight: 800;
  margin-bottom: 6px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 8px;
}


.meta-cell {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f9fbff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

/* Inbox / case header (dark by default). Light version is saved below. */
.case-hero {
  background: linear-gradient(135deg, #0f172a 0%, #10253f 50%, #0b1325 100%);
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 60px rgba(5,12,28,0.45);
  position: relative;
  overflow: hidden;
}

.case-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(56,189,248,0.15), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(14,165,233,0.12), transparent 40%);
  pointer-events: none;
}

.case-hero__top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.case-hero__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.12);
}

.case-hero__title {
  margin: 10px 0 6px;
  font-size: 26px;
  color: #f8fafc;
  letter-spacing: -0.3px;
}

.case-hero__lead {
  margin: 0;
  color: #cbd5e1;
  font-size: 14px;
}

.case-hero__status {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  min-width: 240px;
}

.case-hero .pill {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.16);
}

.case-hero .status-new { background: rgba(34,211,238,0.18); color: #e0f2fe; border-color: rgba(34,211,238,0.3); }
.case-hero .status-acknowledged { background: rgba(252,211,77,0.18); color: #fef9c3; border-color: rgba(252,211,77,0.3); }
.case-hero .status-in_review,
.case-hero .status-investigating { background: rgba(74,222,128,0.18); color: #bbf7d0; border-color: rgba(74,222,128,0.3); }
.case-hero .status-closed { background: rgba(226,232,240,0.18); color: #e2e8f0; border-color: rgba(226,232,240,0.24); }

.pill-strong {
  background: #22d3ee;
  color: #0b1020;
  border: none;
  box-shadow: 0 10px 30px rgba(34,211,238,0.3);
}

.case-hero__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  width: 100%;
}

.case-hero__meta-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.case-hero__meta-value {
  font-size: 15px;
  color: #f8fafc;
  line-height: 1.5;
}

.case-hero__grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}

.case-hero__grid > div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.case-hero__grid .case-hero__meta-value {
  color: #e2e8f0;
}

/* Saved light version (not used by default). Add `case-hero--light` to enable. */
.case-hero.case-hero--light {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.case-hero.case-hero--light::after { display: none; }

.case-hero.case-hero--light .case-hero__chip {
  background: #f1f5ff;
  color: #0b4674;
  border-color: #c8dff7;
}

.case-hero.case-hero--light .case-hero__title { color: #0f172a; }
.case-hero.case-hero--light .case-hero__lead { color: var(--muted); }
.case-hero.case-hero--light .case-hero__meta-label { color: #6b7280; }
.case-hero.case-hero--light .case-hero__meta-value { color: #0f172a; }

.case-hero.case-hero--light .pill {
  background: #e8f4ff;
  color: #0b4674;
  border-color: #c8dff7;
}

.case-hero.case-hero--light .status-new { background: #e0f2fe; color: #0b4674; border-color: #c8dff7; }
.case-hero.case-hero--light .status-acknowledged { background: #fef9c3; color: #92400e; border-color: #fde68a; }
.case-hero.case-hero--light .status-in_review,
.case-hero.case-hero--light .status-investigating { background: #ecfdf3; color: #14532d; border-color: #bbf7d0; }
.case-hero.case-hero--light .status-closed { background: #f3f4f6; color: #374151; border-color: #e5e7eb; }

.case-hero.case-hero--light .case-hero__grid > div {
  background: #f9fbff;
  border-color: #e5e7eb;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.case-hero.case-hero--light .case-hero__grid .case-hero__meta-value { color: #1f2933; }

/* Inbox messages card (dark by default). Light version is saved below. */
.inbox-thread {
  background: linear-gradient(135deg, #0f172a 0%, #10253f 50%, #0b1325 100%);
  background-color: #0b1325;
  color: #e5e7eb;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 60px rgba(5,12,28,0.45);
}

.inbox-thread h3 { color: #f8fafc; }
.inbox-thread .muted { color: #cbd5e1; }
.inbox-thread label { color: #e2e8f0; }

.inbox-thread textarea,
.inbox-thread input,
.inbox-thread select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: #f8fafc;
}

.inbox-thread textarea::placeholder { color: rgba(226,232,240,0.75); }

.inbox-thread .btn {
  color: #e5e7eb;
  background: rgba(255,255,255,0.06);
  border-color: rgba(56,189,248,0.65);
}

.inbox-thread .btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(56,189,248,0.85);
  color: #f8fafc;
}

.inbox-thread .msg {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.inbox-thread .msg .meta { color: #cbd5e1; }
.inbox-thread .msg .body { color: #f8fafc; }
.inbox-thread .attachments { color: #cbd5e1; }
.inbox-thread .attachments a { color: #38bdf8; }

/* Saved light version (not used by default). Add `inbox-thread--light` to enable. */
.inbox-thread.inbox-thread--light {
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  background-color: #ffffff;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.inbox-thread.inbox-thread--light h3 { color: inherit; }
.inbox-thread.inbox-thread--light .muted { color: var(--muted); }
.inbox-thread.inbox-thread--light label { color: #1f2933; }

.inbox-thread.inbox-thread--light textarea,
.inbox-thread.inbox-thread--light input,
.inbox-thread.inbox-thread--light select {
  background: #fafbff;
  border: 1px solid #d6d8e1;
  color: var(--text);
}

.inbox-thread.inbox-thread--light .btn {
  background: #e1e1e11a;
  color: #0b1020;
  border-color: #2196f3;
}

.inbox-thread.inbox-thread--light .msg {
  background: #f7f8ff;
  border: 1px solid #e4e6ef;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}

.inbox-thread.inbox-thread--light .msg .meta { color: #6b7280; }
.inbox-thread.inbox-thread--light .msg .body { color: #1f2933; }
.inbox-thread.inbox-thread--light .attachments { color: inherit; }
.inbox-thread.inbox-thread--light .attachments a { color: inherit; }



.meta-grid-admin {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px;
      margin-top: 8px;
    }
.meta-cell-admin {
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 12px 14px;
      background: #f9fbff;
      box-shadow: 0 8px 24px rgba(0,0,0,0.05);
      
      border: 1px solid #e5e7ebab;
      border-radius: 4px;
      padding: 14px 14px;
      background: #f9fbff59;

    }



.meta-sub { color: #4b5563; font-size: 14px; margin: 2px 0; font-weight: 400; }
.meta-value { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e8f4ff;
  color: #0b4674;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #c8dff7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.status-new { background: #e0f2fe; color: #0b4674; }
.status-acknowledged { background: #fef9c3; color: #92400e; }
.status-in_review,
.status-investigating { background: #ecfdf3; color: #14532d; }
.status-closed { background: #f3f4f6; color: #374151; }
.status-ok { color: #16a34a; }
.status-fail { color: #b91c1c; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 8px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #6b7280;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

tr:last-child td { border-bottom: none; }

.list { display: none; }
.desktop { display: block; }

.row-card {
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fbff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.row-card h2 { margin: 0 0 4px; font-size: 14px; }
.row-card .meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 11px; color: #6b7280; margin-bottom: 6px; }
.row-card .bottom { display: flex; justify-content: space-between; gap: 6px; align-items: center; }

.status-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.status-form select { flex: 1 1 200px; margin: 0; min-width: 0; width: auto; }
.status-form .btn { flex: 0 0 auto; min-width: 130px; justify-content: center; }

.section-heading {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 6px;
}

.section-body {
  font-size: 14px;
  color: #111827;
  background: #f9fbff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 12px 14px;
  white-space: pre-wrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}

.note {
  font-size: 12px;
  margin: 4px 0 0;
}

.note-strong { color: brown; }

.error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecdd3;
  font-weight: 700;
  font-size: 14px;
}

@media (max-width: 720px) {
  .wrap { padding: 5px 5px 40px; }
  .status-form select { flex: 1 1 100%; width: 100%; }
  .status-form .btn { width: 100%; }
  .desktop { display: none; }
  .list { display: grid; gap: 10px; }
  /* Mobile: hide Font Awesome SVG icons inside buttons/links */
  .btn svg.icon,
  .btn svg.iconx,
  .cta svg.icon,
  .cta svg.iconx,
  .ctax svg.icon,
  .ctax svg.iconx { display: none !important; }
.page-pad { padding: 8px; padding-top: 40px; }
.body.page-top {padding-top: 40px;}
body.page-center { padding: 8px; padding-top: 40px;}
}

@media (min-width: 721px) {
  .status-form { flex-wrap: nowrap; }
}
