:root {
  --blue: #0b4f9c;
  --blue-dark: #07386f;
  --green: #2f9e55;
  --green-light: #dff7e6;
  --yellow-light: #fff3bf;
  --red: #b42318;
  --text: #1f2937;
  --muted: #667085;
  --border: #d0d5dd;
  --page: #f4f7fb;
  --white: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #0b5db4 0%, #083d7c 45%, #072f61 100%);
  min-height: 100vh;
}

a { color: inherit; }

.page-shell {
  width: min(100% - 32px, 980px);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  color: #fff;
}

.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: .2px;
}

.topbar a {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}

.card {
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.20);
  padding: 28px;
}

.card + .card { margin-top: 18px; }

h1, h2, h3 { margin-top: 0; }
h1 { color: var(--blue-dark); margin-bottom: 8px; }
.lead { color: var(--muted); margin-top: 0; line-height: 1.6; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field-full { grid-column: 1 / -1; }

label {
  display: block;
  margin-bottom: 7px;
  font-weight: 700;
  color: #344054;
}

.optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 13px;
  font: inherit;
  background: #fff;
  color: var(--text);
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #5a9ee8;
  box-shadow: 0 0 0 4px rgba(41, 112, 190, .13);
}

textarea { min-height: 150px; resize: vertical; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { filter: brightness(.93); }
.btn-light { background: #eef2f6; color: #344054; }
.btn-danger { background: var(--red); color: #fff; }

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 18px;
  line-height: 1.5;
}
.alert-error { background: #fff1f0; border: 1px solid #fecdca; color: #912018; }
.alert-success { background: #ecfdf3; border: 1px solid #abefc6; color: #067647; }

.ticket-code {
  display: inline-block;
  font-family: Consolas, Monaco, monospace;
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 900;
  letter-spacing: 1px;
  color: var(--blue-dark);
  background: #eef6ff;
  border: 1px dashed #5a9ee8;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 12px 0 4px;
}

.admin-shell {
  width: min(100% - 28px, 1250px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  color: #fff;
}

.admin-links { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-links a {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.35);
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 700;
  transition: all 0.15s ease-in-out;
}
.admin-links a:hover {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.6);
}
.admin-links a.active {
  background: #ffffff;
  color: var(--blue-dark);
  border-color: #ffffff;
}

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

.search-form { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.search-form input { max-width: 460px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #eaecf0;
  vertical-align: top;
}

th { color: #475467; font-size: 13px; background: #f9fafb; }
tr:hover td { background: #fbfdff; }

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.status-new { background: #eaf2ff; color: #175cd3; }
.status-progress { background: var(--yellow-light); color: #7a5b00; }
.status-resolved { background: var(--green-light); color: #137333; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.meta-item {
  background: #f8fafc;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  padding: 12px;
}
.meta-item strong { display: block; color: #475467; margin-bottom: 4px; font-size: 13px; }
.description-box {
  white-space: pre-wrap;
  line-height: 1.65;
  background: #fff;
  border: 1px solid #eaecf0;
  border-radius: 10px;
  padding: 16px;
  margin-top: 14px;
}

.small { font-size: 13px; color: var(--muted); }
.empty {
  text-align: center;
  padding: 32px;
  color: var(--muted);
}

.honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 700px) {
  .page-shell { width: min(100% - 20px, 980px); padding-top: 16px; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .form-grid, .meta-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .topbar { align-items: flex-start; }
}
