:root {
  color-scheme: dark;
  --bg: #0f0f14;
  --bg-accent: #171721;
  --panel: rgba(22, 23, 32, 0.92);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #e9ecf1;
  --muted: #9aa4b2;
  --accent: #ff4444;
  --accent-soft: rgba(255, 68, 68, 0.2);
  --accent-strong: #ff6b6b;
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 26px rgba(0, 0, 0, 0.4);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, Arial, sans-serif;
  background: radial-gradient(circle at top left, #2c1116 0%, var(--bg) 45%, #0b0b11 100%);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

.content h2 {
  margin-top: 0;
  font-size: 28px;
  letter-spacing: 0.5px;
}

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

.sidebar {
  width: 240px;
  background: linear-gradient(180deg, rgba(19, 16, 22, 0.98) 0%, rgba(11, 11, 16, 0.98) 100%);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid var(--panel-border);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 48px;
  height: 48px;
}

.sidebar h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: 1px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar nav a:hover {
  background: var(--accent-soft);
  color: #fff;
  transform: translateX(2px);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.content {
  flex: 1;
  padding: 30px;
  background: linear-gradient(180deg, rgba(24, 22, 30, 0.9) 0%, rgba(13, 13, 19, 0.96) 100%);
}

.card {
  background: var(--panel);
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.card h3 {
  margin-top: 0;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow);
  border-color: rgba(255, 255, 255, 0.14);
}

label {
  display: block;
  margin-bottom: 12px;
  font-weight: bold;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 8px;
  margin-top: 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 12, 18, 0.9);
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  background: rgba(10, 10, 18, 0.95);
}

textarea {
  min-height: 80px;
}

button {
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: transform 0.1s ease, background 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 68, 68, 0.25);
}

button:active {
  transform: translateY(0);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: var(--panel);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--panel-border);
}

.button {
  display: inline-block;
  margin-top: 20px;
  background: linear-gradient(135deg, #f0b429 0%, #f7c55b 100%);
  color: #121212;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(240, 180, 41, 0.25);
}

.rule-grid {
  display: grid;
  gap: 16px;
}

.rule-card {
  margin-bottom: 0;
}

.rule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rule-header h4 {
  margin: 0;
}

.ticket-preview {
  margin-top: 16px;
  padding: 16px;
  background: rgba(10, 10, 15, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.ticket-preview h4 {
  margin: 0 0 6px;
}

.ticket-preview-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.details {
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(10, 10, 15, 0.65);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.details summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--text);
}

.details[open] {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(10, 10, 16, 0.85);
}

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

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--muted);
}

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

.table th,
.table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
}

.table thead th {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 8, 12, 0.6);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}
