/* Luys Panel */

:root {
  --bg: #111111;
  --bg-light: #1a1a1a;
  --bg-card: #222222;
  --border: #333333;
  --text: #ffffff;
  --text-muted: #aaaaaa;
  --accent: #1e4d8c;
  --accent-hover: #163a6e;
  --success: #22c55e;
  --error: #ef4444;
  --radius: 12px;
  --sidebar-width: 220px;
}

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

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

button, .btn {
  font-family: inherit;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--text-muted); }
.btn:disabled, .btn.disabled { opacity: 0.5; cursor: not-allowed; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success { background: rgba(34, 197, 94, 0.12); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-error { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-info { background: rgba(30, 77, 140, 0.2); border: 1px solid rgba(30, 77, 140, 0.4); color: #93c5fd; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.form-group textarea { min-height: 100px; resize: vertical; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-open { background: rgba(34, 197, 94, 0.15); color: #86efac; }
.badge-closed { background: rgba(170, 170, 170, 0.15); color: var(--text-muted); }
.badge-admin { background: rgba(30, 77, 140, 0.3); color: #93c5fd; }

/* Auth layout */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-box {
  width: 100%;
  max-width: 420px;
}

.auth-brand {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.auth-brand span { color: var(--accent); }

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.auth-footer {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-footer a { color: var(--accent); }

/* Panel layout */

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-light);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-brand span { color: var(--accent); }

.sidebar-nav { flex: 1; }

.sidebar-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar-nav a:hover { background: var(--bg-card); color: var(--text); }
.sidebar-nav a.active { background: var(--accent); color: #fff; }

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.sidebar-footer .user-name { color: var(--text); font-weight: 600; }

.panel-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 6px; }
.page-header p { color: var(--text-muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-card h3 { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }
.stat-card .value { font-size: 1.5rem; font-weight: 700; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; }

.ticket-list a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-card);
}

.ticket-list a:hover { border-color: var(--text-muted); }

.message {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.message-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.invite-code {
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.05em;
  background: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Install wizard */

.install-page {
  min-height: 100vh;
  padding: 40px 24px;
}

.install-inner {
  max-width: 560px;
  margin: 0 auto;
}

.install-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.install-step {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}

.install-step.done { background: var(--accent); }
.install-step.active { background: var(--accent); opacity: 0.6; }

.req-list { list-style: none; margin: 16px 0; }
.req-list li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.req-ok { color: #86efac; }
.req-fail { color: #fca5a5; }

@media (max-width: 900px) {
  .sidebar { position: static; width: 100%; }
  .panel-layout { flex-direction: column; }
  .panel-main { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
