/* =========================================================
   PrepTrack — Dashboard Specific Styles
   These styles are for index.html dashboard page only
   ========================================================= */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a1a;
  height: 100vh;
  display: flex;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ============================================================
   THIN CUSTOM SCROLLBAR - APPLIES TO ALL ELEMENTS
   ============================================================ */

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

/* Chrome, Edge, Safari */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* For the main content area specifically */
.main::-webkit-scrollbar {
  width: 6px;
}

.main::-webkit-scrollbar-track {
  background: transparent;
}

.main::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

.main::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Dark theme scrollbar */
[data-theme="dark"] * {
  scrollbar-color: #4b5563 transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #4b5563;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

[data-theme="dark"] .main::-webkit-scrollbar-thumb {
  background: #4b5563;
}

[data-theme="dark"] .main::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 240px;
  background: white;
  border-right: 1px solid #e5e7eb;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100vh;
  position: sticky;
  top: 0;
  transition: background 0.3s ease, border-color 0.3s ease;
  overflow-y: auto;
}

/* Sidebar scrollbar - even thinner */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #d1d5db;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background: #404040;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}

.sidebar-logo {
  font-size: 22px;
  font-weight: 700;
  padding: 0 8px 20px 8px;
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  transition: color 0.3s ease;
}

.sidebar-logo span {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 14px;
  margin-left: 4px;
}

.sidebar-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-item:hover {
  background: #f3f4f6;
  color: #1a1a1a;
}

.sidebar-item.active {
  background: #ede9fe;
  color: #7c3aed;
}

.sidebar-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
  transition: border-color 0.3s ease;
}

/* ========== MAIN ========== */
.main {
  flex: 1;
  padding: 24px 32px;
  overflow-y: auto;
}

/* ========== TOP BAR - FIXED ALIGNMENT ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 4px 0;
  width: 100%;
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  transition: border 0.2s, background 0.3s ease, color 0.3s ease;
  height: 44px;
  line-height: 1.4;
}

.topbar-search input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.topbar-search input::placeholder {
  color: #9ca3af;
}

.topbar-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
  pointer-events: none;
}

/* ========== TOPBAR ACTIONS - RIGHT ALIGNED ========== */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.topbar-actions button {
  width: 44px;
  height: 44px;
  border: none;
  background: white;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.topbar-actions button:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
}

.topbar-actions button:active {
  transform: scale(0.95);
}

/* ========== PROFILE AVATAR - EXTREME RIGHT ========== */
.topbar-actions .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #6366f1;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.topbar-actions .avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* ========== RESPONSIVE - FIXED ========== */
@media (max-width: 768px) {
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .topbar-search {
    max-width: 100%;
    flex: 1 1 100%;
    order: 2;
  }
  
  .topbar-actions {
    order: 1;
    flex: 1;
    justify-content: flex-end;
  }
  
  .greeting {
    order: 3;
    flex: 1 1 100%;
  }
}

@media (max-width: 480px) {
  .topbar-actions button:not(:last-child):not(.avatar) {
    display: none;
  }
  
  .topbar-actions button {
    width: 40px;
    height: 40px;
  }
  
  .topbar-actions .avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  .topbar-search input {
    height: 40px;
    font-size: 13px;
  }
}

/* ========== GREETING ========== */
.greeting h1 {
  font-size: 26px;
  font-weight: 700;
}

.greeting p {
  color: #6b7280;
  font-size: 15px;
  margin-top: 2px;
  transition: color 0.3s ease;
}

/* ========== STATS ROW ========== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0 24px;
}

.stat-card {
  background: white;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.stat-card .label {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.stat-card .value {
  font-size: 28px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.stat-card .change {
  font-size: 12px;
  color: #10b981;
  margin-top: 4px;
  display: inline-block;
}

/* ========== TWO COLUMN ========== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.card {
  background: white;
  padding: 20px 24px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  transition: color 0.3s ease;
}

.card-header a {
  color: #6366f1;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

/* ========== DAILY GOAL ========== */
.goal-bar {
  margin: 8px 0 10px;
}

.goal-bar .bar-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.3s ease;
}

.goal-bar .bar-fill {
  height: 100%;
  width: 60%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border-radius: 999px;
}

.goal-text {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #6b7280;
  transition: color 0.3s ease;
}

.goal-text b {
  color: #1a1a1a;
  transition: color 0.3s ease;
}

/* ========== HEATMAP ========== */
.heatmap {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.heatmap .day {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #6b7280;
  transition: background 0.3s ease, color 0.3s ease;
}

.heatmap .day.green { background: #10b981; color: white; }
.heatmap .day.light-green { background: #6ee7b7; color: #065f46; }
.heatmap .day.yellow { background: #fbbf24; color: #78350f; }
.heatmap .day.gray { background: #f3f4f6; }

/* ============================================================
   FAVORITE COMPANIES SECTION
   ============================================================ */

.favorites-section {
  margin-top: 40px;
  margin-bottom: 20px;
}

.favorites-section .section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.favorites-section .section-header h2 {
  font-size: 20px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.favorites-section .section-header a {
  color: #6366f1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.favorites-section .section-header a:hover {
  text-decoration: underline;
}

.fav-count-badge {
  background: #fee2e2;
  color: #dc2626;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* Favorite Companies Grid - Same card style as target */
.fav-companies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  min-height: 100px;
}

.fav-company-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.fav-company-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
}

.fav-company-card:active {
  transform: scale(0.97);
}

.fav-company-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.fav-company-logo-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.fav-company-info {
  flex: 1;
}

.fav-company-name {
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s ease;
}

.fav-company-count {
  font-size: 13px;
  color: #6b7280;
  transition: color 0.3s ease;
}

/* ===== INSTAGRAM-STYLE HEART BUTTON ===== */
.fav-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fav-remove-btn:hover {
  transform: scale(1.1);
  background: rgba(239, 68, 68, 0.05);
}

.fav-remove-btn:active {
  transform: scale(0.85);
}

/* Heart SVG Icon */
.heart-icon {
  width: 22px;
  height: 22px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #d1d5db;
}

.heart-icon.active {
  color: #ef4444;
  fill: #ef4444;
}

.heart-icon.active:hover {
  transform: scale(1.15);
}

/* Pop animation like Instagram */
.heart-icon.pop {
  animation: heartPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.fav-company-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-left: 56px;
}

.fav-company-pbar {
  flex: 1;
  height: 4px;
  background: #f3f4f6;
  border-radius: 999px;
  overflow: hidden;
  transition: background 0.3s ease;
}

.fav-company-pfill {
  height: 100%;
  background: #6366f1;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fav-company-percent {
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  min-width: 36px;
  text-align: right;
  transition: color 0.3s ease;
}

/* Empty State */
.fav-empty-state {
  grid-column: 1 / -1;
  background: white;
  border: 2px dashed #e5e7eb;
  border-radius: 12px;
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.fav-empty-state .empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.fav-empty-state .empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  transition: color 0.3s ease;
}

.fav-empty-state .empty-sub {
  font-size: 13px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ========== HEART BUTTON ON COMPANY CARDS - Instagram Style ========== */
.company-card .fav-heart-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.company-card .fav-heart-btn:hover {
  transform: scale(1.1);
  background: rgba(239, 68, 68, 0.05);
}

.company-card .fav-heart-btn:active {
  transform: scale(0.85);
}

.company-card .fav-heart-btn .heart-icon {
  width: 22px;
  height: 22px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #d1d5db;
}

.company-card .fav-heart-btn .heart-icon.active {
  color: #ef4444;
  fill: #ef4444;
}

.company-card .fav-heart-btn .heart-icon.active:hover {
  transform: scale(1.15);
}

/* ========== COMPANY GRID ========== */
.company-grid-section {
  margin-top: 8px;
}

.company-grid-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.company-grid-section .section-header h2 {
  font-size: 20px;
  font-weight: 700;
  transition: color 0.3s ease;
}

.company-grid-section .section-header a {
  color: #6366f1;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ===== COMPANY CARD ===== */
.company-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.company-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
}

.company-card:active {
  transform: scale(0.97);
}

.company-card .top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.company-card .logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.company-card .info {
  flex: 1;
}

.company-card .info .name {
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s ease;
}

.company-card .info .meta {
  font-size: 13px;
  color: #6b7280;
  transition: color 0.3s ease;
}

.company-card .arrow {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f3f4f6;
  display: grid;
  place-items: center;
  transition: all 0.3s;
  color: #6b7280;
}

.company-card:hover .arrow {
  background: #6366f1;
  color: white;
}

.company-card .arrow svg {
  width: 16px;
  height: 16px;
}

.company-card .ring-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.company-card .ring-wrap {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.company-card .ring-wrap svg {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.company-card .ring-wrap .ring-bg {
  fill: none;
  stroke: #f3f4f6;
  stroke-width: 5;
  transition: stroke 0.3s ease;
}

.company-card .ring-wrap .ring-fill {
  fill: none;
  stroke: #6366f1;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 150.8;
  stroke-dashoffset: 150.8;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.company-card .ring-wrap .ring-pct {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #1a1a1a;
  transition: color 0.3s ease;
}

.company-card .stats {
  text-align: right;
}

.company-card .stats .solved {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  transition: color 0.3s ease;
}

.company-card .stats .total {
  font-size: 12px;
  color: #6b7280;
  transition: color 0.3s ease;
}

.company-card .difficulty {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.company-card .difficulty .bar {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: #f3f4f6;
  overflow: hidden;
  transition: background 0.3s ease;
}

.company-card .difficulty .bar .fill {
  height: 100%;
  border-radius: 999px;
}

.company-card .difficulty .bar .fill.easy { background: #10b981; }
.company-card .difficulty .bar .fill.medium { background: #f59e0b; }
.company-card .difficulty .bar .fill.hard { background: #ef4444; }

/* ========== DARK THEME SUPPORT ========== */
[data-theme="dark"] body {
  background: #1a1a1a;
  color: #f0f2f5;
}

[data-theme="dark"] .sidebar {
  background: #2d2d2d;
  border-color: #404040;
}

[data-theme="dark"] .sidebar-logo {
  color: #f0f2f5;
}

[data-theme="dark"] .sidebar-item {
  color: #9ca3af;
}

[data-theme="dark"] .sidebar-item:hover {
  background: #3d3d3d;
  color: #f0f2f5;
}

[data-theme="dark"] .sidebar-item.active {
  background: #3b2a6b;
  color: #a78bfa;
}

[data-theme="dark"] .sidebar-bottom {
  border-color: #404040;
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .card,
[data-theme="dark"] .company-card,
[data-theme="dark"] .fav-company-card {
  background: #2d2d2d;
  border-color: #404040;
  color: #f0f2f5;
}

[data-theme="dark"] .fav-company-card:hover {
  border-color: #ef4444;
}

[data-theme="dark"] .fav-empty-state {
  background: #2d2d2d;
  border-color: #404040;
}

[data-theme="dark"] .fav-empty-state .empty-title {
  color: #f0f2f5;
}

[data-theme="dark"] .fav-count-badge {
  background: #3b2a6b;
  color: #a78bfa;
}

[data-theme="dark"] .stat-card .label,
[data-theme="dark"] .stat-card .value,
[data-theme="dark"] .card-header h3,
[data-theme="dark"] .company-card .info .name,
[data-theme="dark"] .company-card .stats .solved,
[data-theme="dark"] .company-card .ring-wrap .ring-pct,
[data-theme="dark"] .goal-text b,
[data-theme="dark"] .fav-company-name {
  color: #f0f2f5;
}

[data-theme="dark"] .stat-card .value {
  color: #f0f2f5;
}

[data-theme="dark"] .greeting p,
[data-theme="dark"] .company-card .info .meta,
[data-theme="dark"] .company-card .stats .total,
[data-theme="dark"] .goal-text,
[data-theme="dark"] .fav-company-count,
[data-theme="dark"] .fav-company-percent {
  color: #9ca3af;
}

/* Dark theme heart */
[data-theme="dark"] .heart-icon {
  color: #6b7280;
}

[data-theme="dark"] .heart-icon.active {
  color: #ef4444;
  fill: #ef4444;
}

[data-theme="dark"] .company-card .fav-heart-btn:hover,
[data-theme="dark"] .fav-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .topbar-search input {
  background: #2d2d2d;
  border-color: #404040;
  color: #f0f2f5;
}

[data-theme="dark"] .topbar-search input::placeholder {
  color: #6b7280;
}

[data-theme="dark"] .topbar-search svg {
  color: #6b7280;
}

[data-theme="dark"] .topbar-actions button {
  background: #2d2d2d;
  border-color: #404040;
  color: #f0f2f5;
}

[data-theme="dark"] .topbar-actions button:hover {
  background: #3d3d3d;
}

[data-theme="dark"] .topbar-actions .avatar {
  border-color: #2d2d2d;
}

[data-theme="dark"] .heatmap .day.gray {
  background: #404040;
  color: #9ca3af;
}

[data-theme="dark"] .goal-bar .bar-track {
  background: #404040;
}

[data-theme="dark"] .company-card .ring-wrap .ring-bg {
  stroke: #404040;
}

[data-theme="dark"] .company-card .arrow {
  background: #404040;
  color: #9ca3af;
}

[data-theme="dark"] .company-card:hover .arrow {
  background: #6366f1;
  color: white;
}

[data-theme="dark"] .company-card .difficulty .bar {
  background: #404040;
}

[data-theme="dark"] .fav-company-pbar {
  background: #404040;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col {
    grid-template-columns: 1fr;
  }
  .company-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .fav-companies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .main {
    padding: 16px;
  }
  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .topbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar-search {
    max-width: 100%;
    flex: 1 1 100%;
    order: 2;
  }
  .topbar-actions {
    order: 1;
    flex: 1;
    justify-content: flex-end;
  }
  .greeting {
    order: 3;
    flex: 1 1 100%;
  }
  .greeting h1 {
    font-size: 20px;
  }
  .company-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .fav-companies-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .fav-company-progress {
    padding-left: 56px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .company-grid {
    grid-template-columns: 1fr;
  }
  .fav-companies-grid {
    grid-template-columns: 1fr;
  }
  .topbar-actions button:not(:last-child):not(.avatar) {
    display: none;
  }
  .topbar-actions button {
    width: 40px;
    height: 40px;
  }
  .topbar-actions .avatar {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .topbar-search input {
    height: 40px;
    font-size: 13px;
  }
  .fav-company-progress {
    padding-left: 56px;
  }
  .favorites-section {
    margin-top: 24px;
  }
}

/* ========== UTILITY ========== */
/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  transform: translateX(100%);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.warn {
  border-left: 4px solid #f59e0b;
}

[data-theme="dark"] .toast {
  background: #2d2d2d;
  border-color: #404040;
  color: #f0f2f5;
}