:root {
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --sidebar-bg: #e0f2fe; /* Light sky blue */
  --header-bg: #bae6fd; /* Sky blue */
  --sidebar-text: #0284c7;
  --card-bg: #ffffff;
  
  --color-pink: #38bdf8; /* Sky blue cards */
  --color-yellow: #86efac; /* Light green cards */
  --color-blue: #7dd3fc;
  --color-green: #4ade80;
  
  --border-color: #e2e8f0;
  --transition: all 0.3s ease;

  /* Main accent, same as the public pages; used by dashboard buttons, links and active tabs */
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
}

[data-theme='dark'] {
  --bg-color: #000000;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --sidebar-bg: #0f172a;
  --header-bg: #020617;
  --sidebar-text: #bae6fd;
  --card-bg: #0f172a;
  --color-pink: #0284c7;
  --color-yellow: #22c55e;
  --color-blue: #0ea5e9;
  --color-green: #16a34a;
  --border-color: #334155;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
}

.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar:not(.open) {
  width: 0;
  overflow: hidden;
}

/* Sidebar Nav styles */
.sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.sidebar-category {
  padding: 0.5rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 1rem;
}

.sidebar-link {
  padding: 0.75rem 1.5rem;
  color: var(--sidebar-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  font-size: 0.9rem;
  cursor: pointer;
}

.sidebar-link:hover, .sidebar-link.active {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--text-main);
}

[data-theme='dark'] .sidebar-link:hover, [data-theme='dark'] .sidebar-link.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.sidebar-link i {
  width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 60px;
  background-color: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  color: var(--text-main);
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-family: inherit;
}

#sidebar-toggle i, #theme-toggle i {
  font-size: 1.2rem;
  color: var(--sidebar-text);
}

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

#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 2rem;
  background-color: var(--bg-color);
}

.page-footer {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

.scroll-top {
  background: var(--color-blue);
  color: #fff;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

/* Dashboard Specifics */
.dashboard-earnings {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.earning-row {
  display: flex;
}

.earning-card {
  flex: 1;
  color: #111;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-radius: 8px;
}

[data-theme='dark'] .earning-card {
  color: #fff;
}

.earning-card.total { background-color: var(--color-pink); }
.earning-card.month { background-color: var(--color-yellow); }
.earning-card.today { background-color: var(--color-blue); }

.earning-card .plan-stats {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.plan-stats .stat-row {
  display: flex;
  justify-content: space-between;
}

.earning-card .card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-footer h2 {
  font-size: 1.8rem;
  font-weight: 700;
}

.card-footer h3 {
  font-size: 1.8rem;
  font-weight: 700;
}

/* Statistics section */
.dashboard-stats {
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.stats-banner {
  background-color: var(--color-green);
  color: #fff;
  padding: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border-color);
}

.stat-box {
  background: var(--card-bg);
  padding: 1.5rem 2rem;
}

.stat-icon {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  color: var(--color-blue);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Charts */
.chart-container {
  background: var(--card-bg);
  padding: 2rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  border-radius: 8px;
}

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

.chart-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
}
.chart-header .sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.income-pill {
  background: var(--bg-color);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* List/Table Styles (Consultants Page) */
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
}

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 1rem;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  width: 300px;
  border: 1px solid var(--border-color);
}

.search-bar input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  margin-left: 10px;
  width: 100%;
}

.btn-primary {
  background: var(--color-blue);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.data-table th, .data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.data-table td.id-col { color: var(--text-muted); font-size: 0.85rem;}

.user-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.btn-edit, .btn-delete {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #fff;
  margin-right: 0.5rem;
  border: none;
  cursor: pointer;
}
.btn-edit { background: var(--color-yellow); }
.btn-delete { background: var(--color-pink); }
