:root {
  --sidebar-width: 260px;
  --header-height: 60px;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--gray-100);
  margin: 0;
  color: var(--gray-800);
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gray-900);
  color: white;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
}

.sidebar-brand i {
  font-size: 1.5rem;
  color: var(--primary);
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
}

.nav-section {
  padding: 1rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  font-weight: 600;
}

.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  color: var(--gray-300);
  text-decoration: none;
  font-size: 0.875rem;
  transition: all 0.15s ease;
}

.nav-item .nav-link:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-item .nav-link.active {
  background: var(--primary);
  color: white;
}

.nav-item .nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.main-header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 100;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-700);
  cursor: pointer;
}

.header-search {
  flex: 1;
  max-width: 400px;
}

.header-search .input-group-text {
  background: var(--gray-50);
  border-right: none;
}

.header-search .form-control {
  border-left: none;
  background: var(--gray-50);
}

.header-search .form-control:focus {
  background: white;
  box-shadow: none;
  border-color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.header-actions .btn-link {
  color: var(--gray-500);
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
}

.header-date {
  font-size: 0.875rem;
  padding: 0 0.5rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.content-wrapper {
  padding: 1.5rem;
}

/* Dashboard Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.stat-card-title {
  font-size: 0.875rem;
  color: var(--gray-500);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.stat-card-subtitle {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-card-icon.primary { background: rgba(79, 70, 229, 0.1); color: var(--primary); }
.stat-card-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.stat-card-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.stat-card-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

/* Widget Cards */
.widget-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.widget-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.widget-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-body {
  padding: 1.25rem;
}

.widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.widget-list li:last-child {
  border-bottom: none;
}

/* Streak Badge */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: white;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.new { background: #dbeafe; color: #1d4ed8; }
.status-badge.negotiating { background: #fef3c7; color: #b45309; }
.status-badge.hot { background: #fee2e2; color: #dc2626; }
.status-badge.completed, .status-badge.sold { background: #d1fae5; color: #059669; }
.status-badge.planning { background: #e5e7eb; color: #374151; }
.status-badge.in_progress { background: #dbeafe; color: #1d4ed8; }

/* Tables */
.table-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  overflow: hidden;
}

.data-table {
  width: 100%;
  margin: 0;
}

.data-table th {
  background: var(--gray-50);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--gray-600);
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

/* Forms */
.form-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 1.5rem;
}

.form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-control, .form-select {
  border-color: var(--gray-300);
  padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

/* Word Card */
.word-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.word-display {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.word-transliteration {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 1rem;
}

.word-meaning {
  font-size: 1.1rem;
  background: rgba(255,255,255,0.2);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
}

/* Progress Bar */
.progress-thin {
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
}

.progress-thin .progress-bar {
  background: var(--primary);
}

/* Auth Page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
}

.auth-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  background: var(--primary);
  color: white;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

/* Habit Checkbox */
.habit-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.habit-check:hover {
  background: var(--gray-100);
}

.habit-check.completed {
  background: #d1fae5;
}

.habit-check input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray-500);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 767.98px) {
  .content-wrapper {
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
