:root {
  --primary: #7367f0;
  --primary-soft: #ebe9ff;
  --primary-dark: #5f55e0;
  --accent-pink: #ff66b3;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --sidebar-bg: #1f2133;
  --sidebar-text: #aeb3c3;
  --sidebar-text-active: #ffffff;
  --border-soft: #e2e5f1;
  --text-main: #1f2933;
}

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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text-main);
}

/* Top gradient bar */

.app-shell {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #ff9f43 0, #7367f0 55%, #28c76f 100%);
  padding: 0.75rem;
}

.app-inner {
  background: var(--bg);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  min-height: calc(100vh - 1.5rem);
}

/* Topbar */

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid #eaecf5;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
}

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

.topbar-logo {
  width: 32px;
  height: 32px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
}

.topbar-title span:first-child {
  font-weight: 600;
  font-size: 0.95rem;
}

.topbar-title span:last-child {
  font-size: 0.8rem;
  color: #6b7280;
}

.topbar-right {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.badge-pill {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 500;
}

/* Layout main areas */

.layout {
  display: flex;
  width: 100%;
  height: calc(100vh - 64px);
}

/* Sidebar */

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1rem 0.5rem;
}

.sidebar-section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1rem 0.25rem;
  opacity: 0.7;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.05s ease;
}

.sidebar-link span.icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.sidebar-link.active {
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  color: var(--sidebar-text-active);
  transform: translateX(2px);
}

.sidebar-link.active span.icon {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
}

/* User section bottom */

.sidebar-bottom {
  margin-top: auto;
  padding: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  font-size: 0.8rem;
}

/* Main content */

.main-content {
  flex: 1;
  padding: 1.25rem 1.5rem 1.5rem;
  overflow-y: auto;
}

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

.page-header h1 {
  font-size: 1.4rem;
  margin: 0;
}

.page-header-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

/* Cards */

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

.card {
  background: var(--card-bg);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.card-title {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 0.3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-value {
  font-size: 1.2rem;
  font-weight: 600;
}

.card-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

/* Two-column section */

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1.4fr;
  gap: 1rem;
  margin-top: 1rem;
}

.pill-positive {
  color: #22c55e;
  font-weight: 500;
}

.pill-negative {
  color: #ef4444;
  font-weight: 500;
}

/* Simple “chart-like” areas */

.fake-chart {
  height: 120px;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, rgba(115, 103, 240, 0.12), transparent);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Buttons & forms */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: #4b5563;
}

/* Tables */

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.table th,
.table td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem;
}

.table th {
  text-align: left;
  background: #f9fafb;
}

/* Login page */

.login-page {
  background: radial-gradient(circle at top left, #ff9f43 0, #7367f0 40%, #28c76f 100%);
  display: flex;
  height: 100vh;
  align-items: center;
  justify-content: center;
}

.login-container {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.25);
}

.login-container h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
}

.login-container p {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #6b7280;
}

.form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #374151;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 0.6rem;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
}
