:root {
  --bg-app: #F4F7FE;
  --bg-sidebar: #0D121E;
  --bg-sidebar-elevated: #151C2C;
  --bg-card: #FFFFFF;
  --bg-topbar: #FFFFFF;

  --text-primary: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-on-dark: #E5E7EB;
  --text-on-dark-muted: #9AA3B5;

  --accent: #2E6BFF;
  --accent-soft: rgba(46, 107, 255, 0.12);
  --green: #22C55E;
  --green-soft: rgba(34, 197, 94, 0.12);
  --purple: #A855F7;
  --purple-soft: rgba(168, 85, 247, 0.12);
  --amber: #F59E0B;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --blue: #3B82F6;
  --blue-soft: rgba(59, 130, 246, 0.12);

  --border: #E5E7EB;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-width: 280px;
  --font: "DM Sans", system-ui, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg-app);
}

body {
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  padding: 1.25rem 1rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar__brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.25rem 0.5rem 1.25rem;
}

.sidebar__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #2E6BFF, #6D8CFF);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar__brand strong,
.login-card__brand strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.sidebar__brand span,
.login-card__brand span {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--text-on-dark-muted);
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.sidebar__section-label {
  margin: 1.1rem 0.65rem 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-muted);
}

.sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--text-on-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.sidebar__link.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(46, 107, 255, 0.35);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-on-dark);
  font-size: 0.88rem;
  font-weight: 600;
}

.sidebar__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(46, 107, 255, 0.22);
  color: #BFDBFE;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__user-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-on-dark-muted);
  font-weight: 500;
}

.sidebar__logout {
  margin: 0;
}

.sidebar__link--logout {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text-on-dark-muted);
}

.sidebar__link--logout:hover {
  color: #FCA5A5;
  background: rgba(248, 113, 113, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
}

.badge--soft {
  background: #EEF2FF;
  color: #64748B;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
}

/* Main */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.content {
  padding: 1.5rem;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-header h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
}

.page-header p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(229, 231, 235, 0.7);
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.card__head h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.link-soft {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  font-weight: 600;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn--pill {
  background: #F3F4F6;
  color: var(--text-primary);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
}

.btn--pill:hover {
  background: #E5E7EB;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1rem;
  box-shadow: 0 8px 20px rgba(46, 107, 255, 0.28);
}

.btn--primary:hover {
  background: #2558DB;
}

.btn--block {
  width: 100%;
}

.text-success {
  color: var(--green);
  font-weight: 600;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }
}
