:root {
  --bg-deep: #070c16;
  --bg-sidebar: #0a1120;
  --bg-card: #0f192d;
  --bg-card-alt: #13223c;
  --bg-input: #080e1a;
  
  --border-subtle: rgba(56, 189, 248, 0.08);
  --border-glow: rgba(45, 212, 191, 0.3);
  
  --text-main: #f1f5f9;
  --text-muted: #8498b5;
  --text-dim: #4b5f7d;

  --turquoise: #2dd4bf;
  --turquoise-glow: rgba(45, 212, 191, 0.35);
  --sky: #38bdf8;
  --sky-glow: rgba(56, 189, 248, 0.35);
  --emerald: #10b981;
  --rose: #f43f5e;
  --amber: #f59e0b;

  --font: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
}

.shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  padding: 0 4px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #091322;
  border: 1px solid rgba(45, 212, 191, 0.35);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.2);
  flex-shrink: 0;
}

.brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-meta h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.1;
}

.brand-meta span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
  text-align: left;
}

.nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
}

.nav-btn.active {
  background: linear-gradient(90deg, rgba(45, 212, 191, 0.16), rgba(56, 189, 248, 0.03));
  border-left: 2px solid var(--turquoise);
  color: #fff;
}

.count-pill {
  margin-left: auto;
  background: rgba(45, 212, 191, 0.15);
  color: var(--turquoise);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-family: var(--mono);
}

/* Main Area */
.content {
  flex-grow: 1;
  padding: 32px 40px;
  overflow-y: auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.header-info h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.header-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Views */
.view {
  display: none;
}

.view.active {
  display: block;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 18px 20px;
  position: relative;
  transition: border-color 0.2s;
}

.kpi-card:hover {
  border-color: var(--border-glow);
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin-top: 10px;
  font-family: var(--mono);
}

.kpi-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Layout Grid */
.grid-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .grid-layout { grid-template-columns: 1fr; }
  .shell { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-subtle); }
}

/* Cards */
.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-head.flex-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-head h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #fff;
}

.card-body {
  padding: 20px;
}

.data-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.data-row span {
  color: var(--text-muted);
}

.data-row strong {
  color: var(--text-main);
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
}

/* Filters */
.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  background-color: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active {
  background-color: var(--turquoise);
  color: #070c16;
  font-weight: 700;
  border-color: var(--turquoise);
}

/* Tickets Grid */
.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 14px;
}

.ticket-item {
  background-color: var(--bg-card-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.ticket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ticket-name {
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  font-family: var(--mono);
}

.pill {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--mono);
}

.pill-unclaimed { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.pill-claimed { background: rgba(45, 212, 191, 0.15); color: var(--turquoise); }
.pill-closed { background: rgba(244, 63, 94, 0.15); color: var(--rose); }

.field-block {
  margin-top: 8px;
  font-size: 12px;
}

.field-title {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.field-content {
  background: rgba(0, 0, 0, 0.35);
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--text-main);
  word-break: break-word;
}

.ticket-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: flex-end;
}

.btn-ticket-close {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--rose);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ticket-close:hover {
  background: var(--rose);
  color: #fff;
}

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

select, textarea, input {
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

select:focus, textarea:focus, input:focus {
  border-color: var(--turquoise);
}

.divider {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: 20px 0;
}

.submit-btn {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.submit-btn.primary {
  background: linear-gradient(135deg, #0d9488, #0284c7);
  color: #fff;
  border: 1px solid rgba(45, 212, 191, 0.3);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.2);
}

.submit-btn.primary:hover {
  background: linear-gradient(135deg, #14b8a6, #0369a1);
}

.submit-btn.secondary {
  background-color: #0b1c33;
  border: 1px solid var(--sky);
  color: #fff;
}

.submit-btn.secondary:hover {
  background-color: #112d54;
}

.submit-btn.danger {
  background-color: var(--rose);
  color: #fff;
  flex: 1;
}

.submit-btn.success {
  background-color: var(--emerald);
  color: #fff;
  flex: 1;
}

.dual-btn {
  display: flex;
  gap: 12px;
}

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

/* Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 12px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.btn-delete-row {
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--rose);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-delete-row:hover {
  background: var(--rose);
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
