/* Dashboard CSS */
:root {
  --sidebar-width: 260px;
  --header-height: 70px;
  --bg-dark: #0f172a;
  --bg-light: #f1f5f9;
  --text-dark: #cbd5e1;
  --text-primary: #1e293b;
  --accent-color: #3b82f6;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-dark);
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  font-family: 'Inter', sans-serif;
  margin-bottom: 2.5rem;
  padding-left: 0.5rem;
}

.brand-logo {
  max-height: 50px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background-color: var(--accent-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
}

.menu {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-item {
  margin-bottom: 0.5rem;
}

/* Force overrides for Bootstrap conflicts */
.menu-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-dark) !important;
  /* Force color */
  text-decoration: none !important;
  /* Force no underline */
  transition: all 0.2s;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
}

.menu-link:hover,
.menu-link.active {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
}

.menu-link i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
}

/* Submenu Styling - Forced */
.submenu {
  padding-left: 45px;
  font-size: 0.9em;
  display: none;
  margin-top: 5px;
  margin-bottom: 10px;
  list-style: none;
  /* Ensure no bullets */
}

/* Force links in submenu to behave */
.submenu-link {
  color: #94a3b8 !important;
  text-decoration: none !important;
  display: block;
  padding: 5px 0;
  transition: color 0.2s;
}

.submenu-link:hover {
  color: #fff !important;
}

/* .has-submenu:hover .submenu {
  display: block;
} */

.has-submenu.open .submenu {
  display: block;
}

.menu-item.open>.menu-link {
  background-color: rgba(255, 255, 255, 0.1);
  color: white !important;
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

header {
  height: var(--header-height);
  background-color: white;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  background-color: #e2e8f0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #64748b;
}

.user-info {
  text-align: right;
}

.user-info small {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
}

/* Dashboard Grid & Cards */
.dashboard-container {
  padding: 2rem;
  overflow-y: auto;
}

.card {
  background-color: var(--card-bg);
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
}

/* Mini Grid System (Fallback/Override) */
.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

.col-md-6,
.col-8,
.col-4,
.col-md-9,
.col-md-3,
.col-sm-3,
.col-sm-9 {
  position: relative;
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
}

@media (min-width: 768px) {
  .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .col-md-9 {
    flex: 0 0 75%;
    max-width: 75%;
  }

  .col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

.col-8 {
  flex: 0 0 66.666667%;
  max-width: 66.666667%;
}

.col-4 {
  flex: 0 0 33.333333%;
  max-width: 33.333333%;
}

.mb-3 {
  margin-bottom: 1rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.mb-2 {
  margin-bottom: 0.5rem !important;
}

.mt-3 {
  margin-top: 1rem !important;
}

.w-100 {
  width: 100% !important;
}

/* Styles for utilities */
.btn {
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.btn-primary:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

/* Sidebar Toggle Button (mobile) */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.sidebar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar-overlay.active {
  display: block;
}

/* Mobile Responsive - Dashboard */
@media (max-width: 768px) {
  body {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  /* Sidebar: slide-in from left */
  .sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.open {
    left: 0;
  }

  /* Show toggle button */
  .sidebar-toggle {
    display: flex;
  }

  /* Header */
  header {
    height: 56px;
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-title {
    font-size: 1rem;
  }

  .user-info span {
    font-size: 0.85rem;
  }

  .user-info small {
    display: none;
  }

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  /* Main content */
  .main-content {
    width: 100%;
    overflow: visible;
  }

  .dashboard-container {
    padding: 12px;
    overflow-y: visible;
  }

  /* Welcome */
  .welcome-message {
    font-size: 1.1rem;
  }

  .welcome-sub {
    font-size: 0.85rem;
  }

  /* Calendar */
  .calendar-section {
    padding: 12px;
  }

  .calendar-table td {
    height: 50px;
    padding: 2px 1px;
  }

  .day-num {
    font-size: 0.75rem;
  }

  .booking-count {
    font-size: 0.6rem;
  }

  .dot {
    width: 5px;
    height: 5px;
  }

  .month-nav h4 {
    font-size: 0.95rem;
  }

  .legend {
    gap: 8px;
  }

  .legend-item {
    font-size: 0.7rem;
  }

  /* Simulator section */
  .sim-section {
    padding: 12px;
  }

  .sim-card {
    padding: 10px;
  }

  .sim-card .sim-name {
    font-size: 0.9rem;
  }

  /* Quick links */
  .quick-link-card {
    padding: 10px 12px;
    gap: 8px;
  }

  .quick-link-card i {
    font-size: 1.1rem;
    width: 32px;
    height: 32px;
  }

  .quick-link-card span {
    font-size: 0.8rem;
  }
}