:root {
  --bg: #f7f8fc;
  --panel: #ffffff;
  --text: #080d27;
  --muted: #5f6475;
  --line: #cfd3dd;
  --soft-line: #e8eaf1;
  --navy: #080d27;
  --navy-2: #111735;
  --soft: #f1f3f8;
  --success: #0f7a4f;
  --danger: #a32929;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px;
  border-bottom: 1px solid var(--soft-line);
}

.brand {
  color: var(--text);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: 18px;
  font-size: .9rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-bottom: 72px;
}

.hero {
  max-width: 820px;
  padding: 76px 0 52px;
}

.compact-hero { padding-bottom: 38px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 760;
  letter-spacing: .14em;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: .94;
  letter-spacing: -.065em;
}

h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  letter-spacing: -.035em;
}

.intro {
  max-width: 680px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
  gap: 24px;
  align-items: start;
}

.form-panel, .lookup-panel { padding: 28px; }
.section-heading { margin-bottom: 24px; }

label {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
  font-weight: 700;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

input, select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--navy);
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}

.button-primary {
  background: var(--navy);
  color: white;
}

.button-secondary {
  background: transparent;
  color: var(--text);
}

.button-link { text-decoration: none; }

.form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.form-error { color: var(--danger); }
.muted { color: var(--muted); }

.success-panel {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid #b9d8c9;
  background: #f4fbf7;
}

.ticket-code {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: white;
  font-weight: 800;
}

.lookup-result {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--soft-line);
}

.status-pill {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
}

.reply-box {
  margin-top: 16px;
  padding: 14px;
  background: var(--soft);
  border-left: 3px solid var(--navy);
}

.workspace { overflow: hidden; }

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-bottom: 1px solid var(--soft-line);
}

.stats {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: .9rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px auto;
  gap: 12px;
  padding: 18px 28px;
  background: var(--soft);
  border-bottom: 1px solid var(--soft-line);
}

.clear-form {
  padding: 14px 28px;
  border-bottom: 1px solid var(--soft-line);
  text-align: right;
}

.admin-ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .85fr);
  gap: 30px;
  padding: 28px;
  border-bottom: 1px solid var(--soft-line);
}

.ticket-topline {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: .78rem;
}

.ticket-id {
  color: var(--text);
  font-weight: 800;
}

.ticket-title { margin: 8px 0 0; }
.ticket-requester, .ticket-description { color: var(--muted); }

.admin-controls {
  padding-left: 28px;
  border-left: 1px solid var(--soft-line);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.delete-button {
  margin-top: 12px;
  color: var(--danger);
}

.empty-state {
  padding: 70px 28px;
  text-align: center;
}

.notice {
  padding: 12px 16px;
  border: 1px solid var(--line);
}

.success-notice { color: var(--success); }
.error-notice { color: var(--danger); }

@media (max-width: 820px) {
  .split-layout, .admin-ticket { grid-template-columns: 1fr; }
  .admin-controls {
    padding-left: 0;
    padding-top: 24px;
    border-left: 0;
    border-top: 1px solid var(--soft-line);
  }
  .toolbar { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

  main { width: min(100% - 28px, 1180px); }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }
}


.login-panel {
  width: min(520px, 100%);
  padding: 28px;
}

.small-text {
  font-size: .86rem;
}

.single-form { width: min(760px, 100%); }
.conversation-layout { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr); gap:24px; align-items:start; }
.conversation, .reply-panel { padding:28px; }
.message { padding:20px; margin-bottom:16px; border:1px solid var(--soft-line); }
.message:last-child { margin-bottom:0; }
.message-admin { background:var(--soft); border-left:4px solid var(--navy); }
.message-customer { background:#fff; border-left:4px solid var(--line); }
.message-meta { display:flex; justify-content:space-between; gap:16px; color:var(--muted); font-size:.82rem; }
.message p { margin-bottom:0; }
.reply-panel { position:sticky; top:20px; }
.ticket-title a, .inline-link { color:var(--text); }
.inline-link { font-weight:700; }
.status-row { display:grid; grid-template-columns:1fr auto; gap:8px; margin-top:14px; }
.status-row select { min-width:0; }
@media (max-width:820px) { .conversation-layout { grid-template-columns:1fr; } .reply-panel { position:static; } }
