/* Minimal, responsive UI (no frameworks) */

:root {
  --bg: #0b1220;
  --panel: #0f1a2f;
  --panel2: #0c1628;
  --text: #e6edf7;
  --muted: #9bb0cc;
  --border: rgba(255, 255, 255, 0.08);
  --primary: #3b82f6;
  --danger: #ef4444;
  --ok: #22c55e;
  --warn: #f59e0b;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: radial-gradient(1200px 900px at 15% 0%, #13244a 0%, var(--bg) 45%, #070b14 100%);
  color: var(--text);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }

.page {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.card {
  width: min(520px, 100%);
  background: rgba(15, 26, 47, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h1 { margin: 0 0 8px; font-size: 22px; }
.footer { margin-top: 14px; font-size: 13px; max-width: 520px; text-align: center; opacity: 0.9; }

.form { display: grid; gap: 10px; margin-top: 10px; }
.form label { display: grid; gap: 6px; font-size: 13px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.75);
  color: var(--text);
  outline: none;
}
textarea { resize: vertical; min-height: 110px; }
input::placeholder, textarea::placeholder { color: rgba(155, 176, 204, 0.7); }

.btn {
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.8);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease;
}
.btn:hover { background: rgba(12, 22, 40, 0.95); }
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: rgba(59, 130, 246, 0.95);
  border-color: rgba(59, 130, 246, 0.6);
  color: white;
}
.btn.primary:hover { background: rgba(59, 130, 246, 1); }

.bootstrap { margin-top: 10px; }

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.7);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 9999;
  font-size: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(11, 18, 32, 0.75);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; gap: 10px; align-items: center; }
.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: rgba(255,255,255,0.95);
}
.brand-title { font-weight: 700; }
.brand-sub { font-size: 12px; }

.nav { display: flex; gap: 10px; align-items: center; }
.tab {
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.65);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}
.tab.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
}

.main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.content { width: 100%; }

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

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.inline { display: grid; gap: 6px; font-size: 12px; }
.inline input, .inline select { padding: 8px 10px; border-radius: 10px; }

.checkbox { display: flex; gap: 8px; align-items: center; padding: 4px 6px; }
.checkbox input { width: auto; }

.actions { display: flex; gap: 10px; align-items: center; }

.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.panel {
  background: rgba(15, 26, 47, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-height: 480px;
}

.panel.detail { min-height: 480px; }

.panel-title {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 13px;
  background: rgba(12, 22, 40, 0.45);
}

.list { padding: 10px; display: grid; gap: 10px; }
.list.small { gap: 8px; }

.ticket {
  border: 1px solid var(--border);
  background: rgba(12, 22, 40, 0.55);
  border-radius: 14px;
  padding: 10px 10px;
  cursor: pointer;
}
.ticket:hover { background: rgba(12, 22, 40, 0.75); }
.ticket.selected { outline: 2px solid rgba(59, 130, 246, 0.55); }

.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}
.ticket-id { font-weight: 800; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.15);
}

.badge.prio-critical { background: rgba(239, 68, 68, 0.18); border-color: rgba(239, 68, 68, 0.35); }
.badge.prio-high { background: rgba(245, 158, 11, 0.18); border-color: rgba(245, 158, 11, 0.35); }
.badge.prio-normal { background: rgba(59, 130, 246, 0.18); border-color: rgba(59, 130, 246, 0.35); }
.badge.prio-low { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.3); }

.ticket-title { margin-top: 8px; font-weight: 700; line-height: 1.2; }
.ticket-meta { margin-top: 6px; font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px; }

.detail-body { padding: 12px; }
.detail-grid { display: grid; gap: 10px; }
.kv { display: grid; gap: 4px; }
.kv .k { font-size: 12px; color: var(--muted); }
.kv .v { font-weight: 600; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

.comments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 10px;
}

.comment {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(12, 22, 40, 0.45);
  padding: 10px;
}
.comment .meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.comment .body { margin-top: 6px; white-space: pre-wrap; }

.comment.internal { border-color: rgba(245, 158, 11, 0.4); }

.inline-form {
  margin-top: 10px;
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 12px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.span2 { grid-column: 1 / span 2; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 14px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-card {
  position: relative;
  width: min(860px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: rgba(15, 26, 47, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.modal-title { font-weight: 800; }

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .panel { min-height: 260px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .grid2 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav { width: 100%; justify-content: space-between; }
  .inline-form { grid-template-columns: 1fr; }
}
