@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0a0b10;
  --bg-soft: #0d0f16;
  --surface: #14161f;
  --surface-2: #191c27;
  --border: #23262f;
  --text: #f2f3f6;
  --text-muted: #8b91a5;
  --text-faint: #5b6072;
  --accent: #5865f2;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(88, 101, 242, 0.14);
  --danger: #ed4245;
  --danger-soft: rgba(237, 66, 69, 0.12);
  --success: #3ba55d;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- Shared decoration ---------- */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Login page ---------- */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(88, 101, 242, 0.16), transparent 45%),
    radial-gradient(circle at 80% 75%, rgba(139, 92, 246, 0.14), transparent 45%), var(--bg);
}

.login-card {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 44px;
  text-align: center;
  max-width: 380px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.login-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.35);
}

.login-mark svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-card p {
  color: var(--text-muted);
  margin: 0 0 28px;
  font-size: 14px;
}

.login-error {
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(237, 66, 69, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 20px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #4752c4);
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  width: 100%;
}

.btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn.secondary {
  background: var(--surface-2);
  border: 1px solid var(--border);
  width: auto;
}

.btn.small {
  padding: 9px 16px;
  font-size: 13px;
  width: auto;
}

/* ---------- Dashboard layout ---------- */
.app {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 252px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 22px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  stroke: white;
}

.sidebar-header span {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  user-select: none;
  border-left: 2px solid transparent;
  transition: background 0.12s ease, color 0.12s ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: #b3bcff;
  border-left-color: var(--accent);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
}

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 18px 12px 6px;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.main {
  flex: 1;
  padding: 36px 44px 60px;
  max-width: 920px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
}

.user-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: block;
}

h1 {
  font-size: 26px;
  margin: 0 0 4px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.subtitle {
  color: var(--text-muted);
  margin: 0 0 24px;
  font-size: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 18px;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  flex-shrink: 0;
}

.card-icon svg {
  width: 16px;
  height: 16px;
  stroke: #b3bcff;
}

.card p.desc {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.5;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hero-card img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.hero-card .placeholder-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.grid .card {
  margin-bottom: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.grid .card:hover {
  border-color: #363b4a;
  transform: translateY(-2px);
}

input[type='text'],
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  margin-bottom: 14px;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

input[type='text']:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

label {
  font-size: 12.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.tag {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.tag button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.tag button:hover {
  color: var(--danger);
}

.inline-form {
  display: flex;
  gap: 10px;
}

.inline-form input {
  margin-bottom: 0;
}

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

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

tr:last-child td {
  border-bottom: none;
}

th {
  color: var(--text-faint);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td .row-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

td .row-delete:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.empty-state {
  color: var(--text-faint);
  font-size: 14px;
  padding: 28px 0;
  text-align: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(59, 165, 93, 0.18);
}

.saved-hint {
  font-size: 13px;
  color: var(--success);
  margin-left: 12px;
  font-weight: 500;
}

.stat-row {
  display: flex;
  gap: 24px;
  margin-top: 4px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat .value {
  font-size: 15px;
  font-weight: 600;
}

.stat .label {
  font-size: 12px;
  color: var(--text-faint);
}
