:root {
  color-scheme: light;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #eef2ff;
  color: #0f172a;
  line-height: 1.5;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top left,
      rgba(99, 102, 241, 0.12),
      transparent 28%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.08),
      transparent 35%
    ),
    #f8fafc;
}

img {
  max-width: 100%;
  display: block;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  background: #111827;
  color: #e2e8f0;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-brand {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 1rem;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #7c3aed, #38bdf8);
  font-weight: 800;
  color: white;
}

.brand-name {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand-subtitle {
  display: block;
  color: #94a3b8;
  font-size: 0.875rem;
}

.sidebar-nav {
  display: grid;
  gap: 0.75rem;
}

.sidebar-link {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: #cbd5e1;
  font-weight: 600;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.sidebar-link.active,
.sidebar-link:hover {
  background: rgba(99, 102, 241, 0.15);
  color: white;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  color: #94a3b8;
  font-size: 0.9rem;
}

.main-panel {
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
}

.drawer-toggle {
  display: none;
  border: none;
  background: #4f46e5;
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  cursor: pointer;
}

.topbar-search {
  flex: 1;
}

.topbar-search input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: white;
  color: #0f172a;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn,
.secondary-btn {
  border: none;
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  cursor: pointer;
}

.profile-pill {
  min-width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: white;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.dashboard {
  padding: 2rem;
  display: grid;
  gap: 1.75rem;
}

.dashboard-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.dashboard-heading h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(2rem, 2.5vw, 2.8rem);
}

.dashboard-heading p {
  margin: 0.75rem 0 0;
  color: #475569;
  max-width: 56rem;
}

.badge {
  background: #f8fafc;
  color: #334155;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-label {
  color: #64748b;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card strong {
  font-size: 2rem;
}

.metric-note {
  color: #475569;
}

.panels-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
}

.panel {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 1.75rem;
}

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

.panel-header h2 {
  margin: 0;
}

.panel-header span {
  color: #64748b;
  font-size: 0.95rem;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 0.9rem;
  min-height: 230px;
}

.chart-grid div {
  display: grid;
  gap: 0.75rem;
  justify-items: center;
}

.chart-bar {
  width: 100%;
  min-height: 2rem;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, #818cf8 0%, #6366f1 100%);
  align-self: end;
  height: calc(var(--value) * 1.8px + 30px);
  transition: height 0.35s ease, background-color 0.25s ease;
}

.tasks-panel .task-list {
  display: grid;
  gap: 1rem;
}

.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.task-item strong {
  display: block;
}

.task-item p {
  margin: 0.35rem 0 0;
  color: #475569;
  font-size: 0.94rem;
}

.status-pill {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.success {
  color: #14532d;
  background: #dcfce7;
}

.status-pill.in-progress {
  color: #1d4ed8;
  background: #dbeafe;
}

.status-pill.warning {
  color: #78350f;
  background: #fef3c7;
}

.activity-table {
  display: grid;
  gap: 0.75rem;
}

.table-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.header-row {
  background: #ffffff;
  border-color: #cbd5e1;
  font-weight: 700;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.status-grid div {
  padding: 1rem;
  border-radius: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.status-grid span {
  display: block;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.status-grid strong {
  font-size: 1.6rem;
}

.footer {
  padding: 1.5rem 2rem;
  color: #475569;
  font-size: 0.95rem;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.8);
}

.hidden {
  display: none;
}

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

  .sidebar {
    position: fixed;
    inset: 0 auto auto 0;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-120%);
    transition: transform 0.25s ease;
    z-index: 20;
    height: 100vh;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 15;
  }

  .topbar {
    padding: 1rem 1rem;
  }

  .drawer-toggle {
    display: inline-flex;
  }

  .dashboard {
    padding: 1.5rem;
  }

  .metrics-grid,
  .panels-grid {
    grid-template-columns: 1fr;
  }

  .chart-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row span {
    display: block;
  }
}

@media (max-width: 640px) {
  .topbar-search {
    display: none;
  }

  .topbar-actions {
    gap: 0.5rem;
  }

  .metric-card strong {
    font-size: 1.6rem;
  }

  .badge {
    width: fit-content;
  }

  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
