:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --muted: #8b9bb4;
  --text: #e8eef7;
  --accent: #3b82f6;
  --accent2: #22c55e;
  --danger: #ef4444;
  --border: #2a3545;
  --radius: 10px;
}

* { box-sizing: border-box; }

body.app {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #0b0f14 0%, #121a24 40%, #0f1419 100%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(26, 35, 50, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { font-weight: 700; letter-spacing: 0.02em; }

.nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--text); }

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

h1 { font-size: 1.35rem; margin: 0 0 1rem; font-weight: 650; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; color: var(--muted); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat {
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(15, 20, 25, 0.5);
}
.stat .n { font-size: 1.6rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: 0.85rem; margin-top: 0.25rem; }

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.data th, table.data td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.data th { color: var(--muted); font-weight: 600; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.badge-open { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.badge-pending { background: rgba(234, 179, 8, 0.2); color: #fcd34d; }
.badge-resolved { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.badge-closed { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }

label { display: block; margin-top: 0.75rem; font-weight: 600; font-size: 0.88rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1419;
  color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }

.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn-secondary { background: #334155; }
.btn-danger { background: var(--danger); }

.login-wrap {
  max-width: 400px;
  margin: 4rem auto;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }

.chart-placeholder {
  height: 140px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}
