:root {
  --primary: #1976d2;
  --success: #2e7d32;
  --warning: #ed6c02;
  --danger: #d32f2f;
  --background: #f5f5f5;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 70px;
  --header-height: 64px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
}

body {
  background: var(--background);
  color: #333;
}

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background: white;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #eee;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.sidebar-header h2 {
  font-size: 1.25rem;
  color: var(--primary);
}

.nav-links {
  list-style: none;
  padding: 1rem 0;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-links a {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  gap: 1rem;
}

.nav-links a:hover {
  background: #f5f5f5;
  color: var(--primary);
}

.nav-links li.active a {
  background: #e3f2fd;
  color: var(--primary);
  font-weight: 500;
}

/* Main Content Styles */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

.main-content.expanded {
  margin-left: var(--sidebar-collapsed-width);
}

/* Top Navigation */
.top-nav {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.menu-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #666;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.search-box {
  position: relative;
}

.search-box input {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 300px;
  font-size: 0.875rem;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.notifications {
  position: relative;
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
}

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

/* Dashboard Content */
.dashboard-content {
  padding: 2rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.stat-details h3 {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-change {
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* Activity Section */
.activity-section {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.activity-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.activity-item:hover {
  background: #f5f5f5;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e3f2fd;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.activity-details h4 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.activity-details p {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.activity-time {
  font-size: 0.75rem;
  color: #999;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .search-box input {
    width: 200px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed-width);
  }

  .main-content {
    margin-left: var(--sidebar-collapsed-width);
  }

  .sidebar-header h2,
  .nav-links span {
    display: none;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .dashboard-content {
    padding: 1rem;
  }

  .search-box {
    display: none;
  }
}

@media (max-width: 576px) {
  .top-nav {
    padding: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .activity-section {
    padding: 1rem;
  }
}

/* Schedule and Sales Summary Layout */
.schedule-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;

  padding: 2rem;
}

/* Common Card Styles */
.dashboard-card {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

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

.card-header h3 {
  font-family: "Playfair Display", serif;
  color: var(--dark);
  font-size: 1.25rem;
}

/* Schedule Table Styles */
.schedule-table {
  width: 100%;
  overflow-x: auto;
}

.schedule-table table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th {
  background: var(--cream);
  padding: 1rem;
  text-align: left;
  font-weight: 500;
  color: var(--dark);
  border-bottom: 2px solid var(--gold);
}

.schedule-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--cream);
}

.schedule-table tr:hover {
  background-color: var(--cream);
  transition: background-color 0.3s ease;
}

/* Status Badge Styles */
.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-badge.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.status-badge.completed {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

/* Button Styles */
.btn-add {
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  transition: background 0.3s ease;
}

.btn-add:hover {
  background: #b69468;
}

.action-btn {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.3s ease;
}

.action-btn.edit:hover {
  color: var(--gold);
}

.action-btn.delete:hover {
  color: #ef4444;
}

/* Sales Summary Styles */
.sales-summary .date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.no-data {
  padding: 2rem;
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  background: var(--cream);
  border-radius: 8px;
  margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .schedule-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .schedule-table {
    font-size: 0.875rem;
  }

  .schedule-table th,
  .schedule-table td {
    padding: 0.75rem 0.5rem;
  }

  .action-btn {
    padding: 0.25rem;
  }

  .btn-add {
    width: 100%;
    justify-content: center;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dashboard-card {
  animation: fadeIn 0.3s ease-out;
}

/* Custom Scrollbar for Table */
.schedule-table::-webkit-scrollbar {
  height: 6px;
}

.schedule-table::-webkit-scrollbar-track {
  background: var(--cream);
}

.schedule-table::-webkit-scrollbar-thumb {
  background-color: var(--gold);
  border-radius: 3px;
}

/* Table Cell Truncation */
.schedule-table td {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Enhanced Submenu Styles */
.submenu {
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin-left: 2.75rem;
}

.has-submenu.active .submenu {
  max-height: 400px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.submenu li {
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  margin: 2px 0;
}

.submenu a {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  color: #a0a0a0;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 0 6px 6px 0;
  transition: all 0.3s ease;
  position: relative;
}

.submenu a i {
  width: 20px;
  font-size: 0.85rem;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.submenu a:before {
  content: "";
  position: absolute;
  left: -2px;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--gold);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}

.submenu a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  padding-left: 20px;
}

.submenu a:hover:before {
  transform: scaleY(1);
}

.submenu a:hover i {
  color: var(--gold);
  transform: translateX(3px);
}

.has-submenu.active .submenu li {
  opacity: 1;
  transform: translateX(0);
}

/* Add transition delays for smooth animation */
.has-submenu.active .submenu li:nth-child(1) {
  transition-delay: 0.1s;
}
.has-submenu.active .submenu li:nth-child(2) {
  transition-delay: 0.15s;
}
.has-submenu.active .submenu li:nth-child(3) {
  transition-delay: 0.2s;
}
.has-submenu.active .submenu li:nth-child(4) {
  transition-delay: 0.25s;
}
.has-submenu.active .submenu li:nth-child(5) {
  transition-delay: 0.3s;
}

/* Active submenu item */
.submenu a.active {
  color: var(--gold);
  background: rgba(198, 168, 125, 0.1);
}

.submenu a.active i {
  color: var(--gold);
}

.submenu a.active:before {
  transform: scaleY(1);
}

/* Update menu link styles */
.menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: #a0a0a0;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.menu-link > span {
  margin-right: auto;
  margin-left: 0.75rem;
}

.submenu-icon {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.has-submenu.active .menu-link {
  background: rgba(198, 168, 125, 0.1);
  color: var(--gold);
}

.has-submenu.active .submenu-icon {
  transform: rotate(180deg);
}

/* Additional Menu Styling */
.sidebar-menu + .menu-category {
  margin-top: 2rem;
}

/* Adjust submenu max-height for longer lists */
.has-submenu.active .submenu {
  max-height: 400px;
}

/* Add transition delays for more submenu items */
.has-submenu.active .submenu li:nth-child(5) {
  transition-delay: 0.5s;
}
.has-submenu.active .submenu li:nth-child(6) {
  transition-delay: 0.6s;
}

/* Highlight active submenu item */
.submenu a.active {
  background: rgba(198, 168, 125, 0.1);
  color: var(--gold);
}

/* Improve submenu icon alignment */
.menu-link .submenu-icon {
  margin-left: 0.5rem;
}

/* Add hover indication */
.menu-link:hover .submenu-icon {
  color: var(--gold);
}
