    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      --sidebar-width: 272px;
      --sidebar-collapsed-width: 104px;
      --transition: 0.28s ease;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background-color: #f5f5f5;
      color: #333;
      transition: background-color 0.3s, color 0.3s;
      min-height: 100vh;
      width: 100%;
    }

    body.sidebar-collapsed {
      --sidebar-width: var(--sidebar-collapsed-width);
    }

    body.dark-mode {
      background-color: #1a1a1a;
      color: #e0e0e0;
    }

    body.dark-mode .sidebar,
    body.dark-mode .navbar,
    body.dark-mode .card,
    body.dark-mode .action-card,
    body.dark-mode .notification-banner,
    body.dark-mode .service-item {
      background-color: #2d2d2d;
      border-color: #444;
      color: #e0e0e0;
    }

    body.dark-mode .sidebar-menu a,
    body.dark-mode .system-toggle {
      color: #b0b0b0;
    }

    body.dark-mode .sidebar-menu a:hover,
    body.dark-mode .sidebar-menu a.active,
    body.dark-mode .system-toggle:hover,
    body.dark-mode .system-toggle.active {
      background-color: #3a3a3a;
      color: #bb86fc;
    }

    body.dark-mode .card-title,
    body.dark-mode .action-desc,
    body.dark-mode .page-subtitle,
    body.dark-mode .services-title,
    body.dark-mode .user-email,
    body.dark-mode .notification-banner-text,
    body.dark-mode .card-subtitle {
      color: #aaa;
    }

    body.dark-mode .card-value,
    body.dark-mode .page-title,
    body.dark-mode .user-name,
    body.dark-mode .action-title,
    body.dark-mode .notification-banner-title {
      color: #fff;
    }

    body.dark-mode .navbar-icon {
      background-color: #3a3a3a;
      color: #e0e0e0;
    }

    body.dark-mode .menu-toggle {
      background: #2f2f2f;
      border-color: #4a4a4a;
      color: #f1f1f1;
      box-shadow: none;
    }

    body.dark-mode .menu-toggle:hover {
      background: #3a3a3a;
      border-color: #5a5a5a;
    }

    body.dark-mode .notification-banner {
      background-color: #3d2e1c;
      border-color: #a65c00;
    }

    body.dark-mode .system-submenu {
      border-top-color: #444;
    }

    .container {
      display: flex;
      min-height: 100vh;
      position: relative;
      width: 100%;
      flex: 1 1 auto;
      align-items: stretch;
    }

    .sidebar {
      width: var(--sidebar-width);
      background-color: #ffffff;
      border-right: 1px solid #e0e0e0;
      padding: 20px;
      overflow-y: auto;
      overflow-x: hidden;
      position: fixed;
      height: 100vh;
      left: 0;
      top: 0;
      transition: width var(--transition), transform var(--transition), background-color 0.3s;
      z-index: 1000;
    }

    .sidebar-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 28px;
      min-height: 64px;
      padding-inline: 10px;
      transition: all var(--transition);
    }

    .sidebar-logo img {
      display: block;
      max-width: 100%;
      height: auto;
      object-fit: contain;
      object-position: center;
      transition: all var(--transition);
    }

    .sidebar-logo .logo-expanded {
      width: min(156px, 100%);
      max-height: 52px;
    }

    .sidebar-logo .logo-collapsed {
      width: 52px;
      max-height: 52px;
      display: none;
      border-radius: 14px;
    }

    body.sidebar-collapsed .sidebar-logo {
      margin-bottom: 22px;
      min-height: 56px;
    }

    body.sidebar-collapsed .sidebar-logo .logo-expanded {
      display: none;
    }

    body.sidebar-collapsed .sidebar-logo .logo-collapsed {
      display: block;
    }

    .sidebar-menu {
      list-style: none;
    }

    .sidebar-menu li {
      margin-bottom: 10px;
    }

    .sidebar-menu a,
    .system-toggle {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 15px;
      color: #666;
      text-decoration: none;
      border-radius: 8px;
      transition: all 0.25s ease;
      font-size: 14px;
      cursor: pointer;
      border: none;
      background: transparent;
      width: 100%;
      text-align: left;
    }

    .sidebar-menu a:hover,
    .sidebar-menu a.active,
    .system-toggle:hover,
    .system-toggle.active {
      background-color: #f0f0f0;
      color: #667eea;
    }

    .sidebar-menu .icon,
    .system-toggle .icon {
      width: 20px;
      min-width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 16px;
      transition: all 0.25s ease;
      line-height: 1;
      flex-shrink: 0;
    }

    .menu-label {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      transition: opacity var(--transition), width var(--transition), margin var(--transition);
    }

    .system-toggle {
      justify-content: flex-start;
    }

    .system-toggle .arrow {
      margin-left: auto;
      width: 12px;
      min-width: 12px;
      height: 14px;
      position: relative;
      transition: transform var(--transition), opacity var(--transition);
      flex-shrink: 0;
    }

    .system-toggle .arrow::before,
    .system-toggle .arrow::after {
      content: "";
      position: absolute;
      top: 6px;
      width: 7px;
      height: 2px;
      background: currentColor;
      border-radius: 999px;
      transition: transform var(--transition);
    }

    .system-toggle .arrow::before {
      left: 0;
      transform: rotate(45deg);
    }

    .system-toggle .arrow::after {
      right: 0;
      transform: rotate(-45deg);
    }

    .system-menu.open .system-toggle .arrow::before {
      transform: rotate(-45deg);
    }

    .system-menu.open .system-toggle .arrow::after {
      transform: rotate(45deg);
    }

    .system-submenu {
      list-style: none;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid #eaeaea;
      display: none;
    }

    .system-menu.open .system-submenu {
      display: block;
    }

    .system-submenu li {
      margin-bottom: 8px;
    }

    .system-submenu a {
      padding-left: 15px;
    }

    body.sidebar-collapsed .menu-label,
    body.sidebar-collapsed .services-title,
    body.sidebar-collapsed .service-item span {
      opacity: 0;
      width: 0;
      margin: 0;
      overflow: hidden;
      pointer-events: none;
    }

    body.sidebar-collapsed .system-toggle .arrow {
      display: none;
    }

    body.sidebar-collapsed .sidebar-menu a,
    body.sidebar-collapsed .system-toggle,
    body.sidebar-collapsed .service-item {
      justify-content: center;
      align-items: center;
      gap: 0;
      padding: 14px 0;
      text-align: center;
    }

    body.sidebar-collapsed .sidebar-menu li {
      display: flex;
      justify-content: center;
    }

    body.sidebar-collapsed .system-menu {
      display: flex;
      flex-direction: column;
      align-items: center;
    }

    body.sidebar-collapsed .system-submenu {
      display: none !important;
    }

    body.sidebar-collapsed .sidebar-menu .icon,
    body.sidebar-collapsed .system-toggle .icon {
      width: 28px;
      min-width: 28px;
      height: 28px;
      font-size: 22px;
      margin: 0 auto;
    }

    body.sidebar-collapsed .service-item {
      width: 100%;
    }

    body.sidebar-collapsed .service-icon {
      width: 30px;
      min-width: 30px;
      height: 30px;
      font-size: 13px;
      margin: 0 auto;
    }

    .services-list {
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid #e0e0e0;
    }

    .services-title {
      font-size: 12px;
      color: #999;
      font-weight: 600;
      text-transform: uppercase;
      margin-bottom: 10px;
      white-space: nowrap;
    }

    .service-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      margin-bottom: 8px;
      background-color: #f9f9f9;
      border-radius: 6px;
      font-size: 12px;
      color: #666;
      cursor: pointer;
      transition: all 0.3s ease;
      overflow: hidden;
    }

    .service-item:hover {
      background-color: #f0f0f0;
      color: #667eea;
    }

    .service-icon {
      width: 20px;
      min-width: 20px;
      height: 20px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: bold;
      color: white;
      flex-shrink: 0;
    }

    .main {
      margin-left: var(--sidebar-width);
      margin-top: 0;
      width: calc(100% - var(--sidebar-width));
      padding-top: 70px;
      flex: 1;
      display: flex;
      flex-direction: column;
      transition: margin-left var(--transition), width var(--transition);
      min-width: 0;
    }

    .navbar {
      background-color: #ffffff;
      border-bottom: 1px solid #e0e0e0;
      padding: 15px 30px;
      margin-top: 0;
      position: fixed;
      top: 0;
      left: var(--sidebar-width);
      right: 0;
      z-index: 950;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 70px;
      gap: 16px;
    }

    .navbar-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .navbar-actions {
      display: flex;
      align-items: center;
      gap: 20px;
    }

    .menu-toggle {
      width: 42px;
      height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
      border: 1px solid #d5d5d5;
      border-radius: 11px;
      cursor: pointer;
      color: #4f4f4f;
      padding: 0;
      transition: all 0.22s ease;
      flex-shrink: 0;
      box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    }

    .menu-toggle:hover {
      background: #f3f3f3;
      border-color: #c7c7c7;
      color: #333;
    }

    .hamburger {
      width: 18px;
      height: 14px;
      position: relative;
      display: inline-block;
    }

    .hamburger span {
      position: absolute;
      left: 0;
      width: 100%;
      height: 2px;
      background: currentColor;
      border-radius: 999px;
    }

    .hamburger span:nth-child(1) { top: 0; }
    .hamburger span:nth-child(2) { top: 6px; }
    .hamburger span:nth-child(3) { top: 12px; }

    .navbar-icon {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background-color: #f0f0f0;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
      font-size: 16px;
      position: relative;
      flex-shrink: 0;
    }

    .notification-badge {
      position: absolute;
      top: -5px;
      right: -5px;
      width: 20px;
      height: 20px;
      background-color: #ff4757;
      color: white;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      font-weight: bold;
    }

    .user-profile {
      display: flex;
      align-items: center;
      gap: 10px;
      cursor: pointer;
    }

    .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: bold;
      font-size: 14px;
    }

    .user-info {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .user-name {
      font-size: 13px;
      font-weight: 600;
      color: #333;
      white-space: nowrap;
    }

    .user-email {
      font-size: 12px;
      color: #999;
      white-space: nowrap;
    }

    .content {
      flex: 1;
      padding: 30px;
      overflow: visible;
      min-width: 0;
    }

    .page-header {
      margin-bottom: 30px;
    }

    .page-title {
      font-size: 28px;
      font-weight: 700;
      color: #333;
      margin-bottom: 8px;
    }

    .page-subtitle {
      font-size: 14px;
      color: #999;
    }

    .notification-banner {
      background-color: #fff3cd;
      border: 1px solid #ffc107;
      border-radius: 8px;
      padding: 15px 20px;
      margin-bottom: 30px;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .notification-banner-icon {
      font-size: 20px;
      color: #ff9800;
    }

    .notification-banner-content {
      flex: 1;
    }

    .notification-banner-title {
      font-size: 14px;
      font-weight: 600;
      color: #333;
      margin-bottom: 4px;
    }

    .notification-banner-text {
      font-size: 13px;
      color: #666;
    }

    .notification-banner-close {
      cursor: pointer;
      font-size: 18px;
      color: #999;
    }

    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 20px;
      margin-bottom: 30px;
    }

    .card {
      background-color: #ffffff;
      border: 1px solid #e0e0e0;
      border-radius: 12px;
      padding: 25px;
      transition: all 0.3s ease;
      min-width: 0;
    }

    .card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 15px;
      gap: 16px;
    }

    .card-icon {
      width: 50px;
      min-width: 50px;
      height: 50px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;
    }

    .card-icon.primary {
      background-color: #e3f2fd;
      color: #667eea;
    }

    .card-icon.success {
      background-color: #e8f5e9;
      color: #4caf50;
    }

    .card-icon.warning {
      background-color: #fff3e0;
      color: #ff9800;
    }

    .card-title {
      font-size: 14px;
      color: #999;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .card-value {
      font-size: 32px;
      font-weight: 700;
      color: #333;
      margin-bottom: 12px;
    }

    .card-subtitle {
      font-size: 12px;
      color: #999;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 24px;
      border: none;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
    }

    .btn-primary {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: white;
      width: 100%;
      margin-top: 15px;
    }

    .quick-actions {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 15px;
      margin-top: 30px;
    }

    .action-card {
      background-color: #ffffff;
      border: 1px solid #e0e0e0;
      border-radius: 12px;
      padding: 20px;
      text-align: center;
      cursor: pointer;
    }

    .action-icon {
      font-size: 32px;
      margin-bottom: 12px;
    }

    .action-title {
      font-size: 14px;
      font-weight: 600;
      color: #333;
      margin-bottom: 8px;
    }

    .action-desc {
      font-size: 12px;
      color: #999;
    }

    .overlay {
      display: none;
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      z-index: 999;
    }

    .overlay.show {
      display: block;
    }

    @media (max-width: 768px) {
      .navbar {
        padding: 15px 20px;
      }

      .content {
        padding: 20px;
      }

      .page-title {
        font-size: 22px;
      }

      .cards-grid {
        grid-template-columns: 1fr;
      }

      .user-email {
        display: none;
      }
    }

    @media (max-width: 640px) {
      .sidebar {
        width: min(80vw, 280px);
        max-width: 280px;
        height: 100dvh;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
        padding-bottom: 24px;
      }

      .sidebar.show {
        transform: translateX(0);
      }

      .main {
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: 70px;
      }

      .user-info {
        display: none;
      }

      .navbar-actions {
        gap: 10px;
      }

      .navbar {
        left: 0;
        right: 0;
      }

      .content {
        width: 100%;
      }

      body.sidebar-collapsed .menu-label,
      body.sidebar-collapsed .services-title,
      body.sidebar-collapsed .service-item span {
        opacity: 1;
        width: auto;
        pointer-events: auto;
      }

      body.sidebar-collapsed .system-toggle .arrow {
        display: block;
      }

      body.sidebar-collapsed .sidebar-menu a,
      body.sidebar-collapsed .system-toggle,
      body.sidebar-collapsed .service-item {
        justify-content: flex-start;
        gap: 12px;
        padding-left: 15px;
        padding-right: 15px;
      }

      body.sidebar-collapsed .sidebar-logo .logo-expanded {
        display: block;
        width: 140px;
      }

      body.sidebar-collapsed .sidebar-logo .logo-collapsed {
        display: none;
      }

      body.sidebar-collapsed .sidebar-menu .icon,
      body.sidebar-collapsed .system-toggle .icon {
        width: 20px;
        min-width: 20px;
        height: 20px;
        font-size: 16px;
        margin: 0;
      }
    }

    @media (max-width: 380px) {
      .sidebar {
        width: min(78vw, 260px);
        max-width: 260px;
      }
    }


/* Table styles services */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
}

.services-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.services-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.services-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.services-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Filter select */
.filter-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    min-width: 250px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Dark mode */
body.dark-mode .services-table {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .services-table th {
    background: #3a3a3a;
    border-bottom-color: #555;
}

body.dark-mode .services-table td {
    border-bottom-color: #444;
}

body.dark-mode .services-table tbody tr:hover {
    background-color: #3a3a3a;
}

body.dark-mode .filter-select {
    background: #2d2d2d;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .badge-success {
    background: #1e3a2a;
    color: #8bc34a;
}

body.dark-mode .badge-danger {
    background: #4a2c2c;
    color: #f28b82;
}

/* Service toggle (có submenu) */
.service-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background-color: #f9f9f9;
  border-radius: 6px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  border: none;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
}

.service-toggle:hover {
  background-color: #f0f0f0;
  color: #667eea;
}

.service-toggle .icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.service-toggle .arrow {
  margin-left: auto;
  width: 12px;
  min-width: 12px;
  height: 14px;
  position: relative;
  transition: transform var(--transition), opacity var(--transition);
  flex-shrink: 0;
}

.service-toggle .arrow::before,
.service-toggle .arrow::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 7px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform var(--transition);
}

.service-toggle .arrow::before {
  left: 0;
  transform: rotate(45deg);
}

.service-toggle .arrow::after {
  right: 0;
  transform: rotate(-45deg);
}

.service-item-wrapper.open .service-toggle .arrow::before {
  transform: rotate(-45deg);
}

.service-item-wrapper.open .service-toggle .arrow::after {
  transform: rotate(45deg);
}

.service-submenu {
  list-style: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eaeaea;
  display: none;
  padding-left: 20px; /* thụt vào để phân biệt với menu cha */
}

.service-item-wrapper.open .service-submenu {
  display: block;
}

.service-submenu li {
  margin-bottom: 8px;
}

.service-submenu a {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.25s ease;
  font-size: 12px;
  background-color: transparent;
}

.service-submenu a:hover {
  background-color: #f0f0f0;
  color: #667eea;
}

/* Dark mode */
body.dark-mode .service-toggle {
  background-color: #3a3a3a;
  color: #b0b0b0;
}

body.dark-mode .service-toggle:hover {
  background-color: #4a4a4a;
  color: #bb86fc;
}

body.dark-mode .service-submenu {
  border-top-color: #444;
}

body.dark-mode .service-submenu a {
  color: #b0b0b0;
}

body.dark-mode .service-submenu a:hover {
  background-color: #4a4a4a;
  color: #bb86fc;
}

/* Khi sidebar thu gọn */
body.sidebar-collapsed .service-toggle .arrow {
  display: none;
}

body.sidebar-collapsed .service-submenu {
  display: none !important;
}

/* Responsive: khi thu gọn trên mobile, hiển thị lại bình thường */
@media (max-width: 640px) {
  body.sidebar-collapsed .service-toggle .arrow {
    display: block;
  }
  body.sidebar-collapsed .service-submenu {
    display: none !important; /* vẫn ẩn submenu khi collapsed trên mobile */
  }
}

/* Khi sidebar thu gọn - điều chỉnh icon và căn giữa cho service-toggle */
body.sidebar-collapsed .service-toggle {
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 14px 0;
  text-align: center;
}

body.sidebar-collapsed .service-toggle .icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  font-size: 13px;
  margin: 0 auto;
}

body.sidebar-collapsed .service-toggle .icon,
body.sidebar-collapsed .system-toggle .icon,
body.sidebar-collapsed .sidebar-menu a .icon {
  cursor: pointer;
}
