:root {
  --bg: #ffffff;
  --bg-elev: #f8f9fa;
  --ink: #1a1a1a;
  --ink-muted: #5f6368;
  --line: #e7eaee;
  --accent: #111111;
  --success: #106642;
  --danger: #8f1d1d;
  --radius: 16px;
  --shadow: 0 16px 34px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(220, 225, 234, 0.35), transparent 42%),
    linear-gradient(135deg, #ffffff 0%, #f9fafb 60%, #f4f6f8 100%);
  color: var(--ink);
  font-family: Inter, "Helvetica Neue", "Avenir Next", sans-serif;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
}

.brand {
  margin: 0;
  font-size: 2rem;
  letter-spacing: 0.1em;
}

.subtitle {
  margin-top: 0.35rem;
  color: var(--ink-muted);
}

.nav-links {
  display: grid;
  gap: 0.65rem;
  margin-top: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-elev);
  transform: translateX(2px);
}

.user-chip {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    text-decoration: none;
    color: var(--ink);
    border-radius: 12px;
    transition: background 0.2s ease;
    padding: 0.6rem;
    margin-top: 0.5rem;
}

.user-chip:hover {
    background: var(--bg-elev);
}

.user-chip > div {
    display: grid;
    gap: 0.1rem;
}

.user-chip span {
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-init,
.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-init {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
}

.avatar-placeholder {
    width: 80px;
    height: 80px;
    font-size: 1.8rem;
}

.role-badge {
    display: inline-block;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.2rem 0.6rem;
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-top: 0.3rem;
  padding: 4rem;
}

.page-title {
  margin: 0;
  font-size: 2.1rem;
}

.page-intro {
  margin-top: 0.5rem;
  color: var(--ink-muted);
}

.card-grid {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 1.4rem;
}

.card,
.table-shell,
.auth-card {
  margin-top: 1.4rem;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.4rem;
}

.metric {
  margin: 0.55rem 0;
  font-size: 2.2rem;
  font-weight: 700;
}

.muted {
  color: var(--ink-muted);
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

input,
select,
button {
  width: 100%;
  border: 1px solid #d8dde3;
  border-radius: 10px;
  padding: 0.62rem 0.72rem;
  font: inherit;
  background: #fff;
}

button {
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.grid-form {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.stack {
  display: grid;
  gap: 0.9rem;
}

.action-row,
.inline {
  display: flex;
  gap: 0.5rem;
}

.alert {
  margin-top: 1rem;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
}

.alert.success {
  color: var(--success);
  background: rgba(16, 102, 66, 0.08);
  border: 1px solid rgba(16, 102, 66, 0.22);
}

.alert.error {
  color: var(--danger);
  background: rgba(143, 29, 29, 0.08);
  border: 1px solid rgba(143, 29, 29, 0.2);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-card {
  width: min(460px, 100%);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 520ms cubic-bezier(0.21, 1.02, 0.73, 1) forwards;
}

.reveal-row {
  opacity: 0;
  transform: translateY(8px);
  animation: revealRow 460ms ease forwards;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealRow {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 1.2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
