/* ===== RESET & BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  transition: background 0.3s ease, color 0.3s ease;
  overflow: hidden;
}

/* ===== THEME COLORS ===== */
body.light-mode {
  background: #f5f7fa;
  color: #1a1a2e;
}

body.dark-mode {
  background: #0a0a0f;
  color: #e8e9ed;
}

/* Loading screen removed */

/* ===== SEARCH MODAL ===== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal.active {
  display: flex;
}

.search-container {
  width: 90%;
  max-width: 600px;
}

.search-header {
  background: #16161f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px;
}

body.light-mode .search-header {
  background: white;
  border: 1px solid #e5e7eb;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-icon {
  font-size: 20px;
  opacity: 0.5;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 16px;
  color: white;
}

body.light-mode .search-input {
  color: #1a1a2e;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

body.light-mode .search-input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.search-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 18px;
  transition: all 0.2s;
}

.search-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.light-mode .search-close {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a2e;
}

body.light-mode .search-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.search-results {
  background: #16161f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  padding: 8px;
  max-height: 60vh;
  overflow-y: auto;
}

body.light-mode .search-results {
  background: white;
  border: 1px solid #e5e7eb;
  border-top: none;
}

.endpoint-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  cursor: pointer;
  text-decoration: none;
  color: white;
  transition: background 0.2s;
}

body.light-mode .endpoint-item {
  color: #1a1a2e;
}

.endpoint-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .endpoint-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ===== APP CONTAINER ===== */
.app-container {
  display: flex;
  height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

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

.sidebar-dark {
  background: #12121a;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-light {
  background: white;
  border-right: 1px solid #e5e7eb;
  color: #1a1a2e;
}

@media (min-width: 768px) {
  .sidebar {
    position: relative;
    transform: translateX(0);
  }
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-content::-webkit-scrollbar {
  width: 4px;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

body.light-mode .sidebar-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 20px;
  text-decoration: none;
  color: inherit;
}

.logo-image {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
}

.sidebar-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 12px 8px;
  opacity: 0.5;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  transition: background 0.2s;
}

.menu-item i {
  font-size: 16px;
  opacity: 0.7;
}

.menu-item-dark:hover {
  background: rgba(255, 255, 255, 0.05);
}

.menu-item-light:hover {
  background: rgba(0, 0, 0, 0.05);
}

.misc-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-footer {
  padding: 16px;
  text-align: center;
  font-size: 10px;
  opacity: 0.3;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .sidebar-footer {
  border-top: 1px solid #e5e7eb;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  z-index: 30;
}

.header-dark {
  background: #12121a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-light {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  color: #1a1a2e;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: inherit;
  padding: 4px;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
}

.header-title {
  font-size: 18px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: inherit;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.light-mode .action-btn {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* ===== THEME DROPDOWN ===== */
.theme-dropdown {
  position: relative;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #16161f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px;
  min-width: 140px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 999;
}

.theme-menu.active {
  display: flex;
}

body.light-mode .theme-menu {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: none;
  border: none;
  color: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
}

.theme-option:hover {
  background: rgba(255, 255, 255, 0.05);
}

body.light-mode .theme-option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-option i {
  font-size: 16px;
  opacity: 0.7;
}

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

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

body.light-mode .main-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

/* ===== STATISTICS OVERVIEW CARD ===== */
.stats-overview-card {
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .stats-overview-card {
  border: 1px solid #e5e7eb;
}

.stats-overview-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}

.stats-overview-title i {
  font-size: 18px;
  opacity: 0.7;
}

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

@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-box {
    flex-direction: column;
    text-align: center;
    padding: 14px 12px;
    gap: 8px;
  }
  
  .stat-icon {
    font-size: 24px;
  }
  
  .stat-label {
    font-size: 10px;
  }
  
  .stat-number {
    font-size: 18px;
  }
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

body.light-mode .stat-box {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

body.light-mode .stat-box:hover {
  background: rgba(0, 0, 0, 0.05);
}

.stat-icon {
  font-size: 28px;
  opacity: 0.7;
  min-width: 32px;
}

.stat-icon.success-icon {
  color: #10b981;
}

.stat-icon.failed-icon {
  color: #ef4444;
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.stat-number {
  font-size: 22px;
  font-weight: 700;
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: transform 0.2s;
}

.dashboard-card:hover {
  transform: translateY(-2px);
}

.card-dark {
  background: #16161f;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-light {
  background: white;
  border: 1px solid #e5e7eb;
  color: #1a1a2e;
}

.card-icon {
  font-size: 40px;
  opacity: 0.6;
}

.card-content {
  flex: 1;
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.7;
}

.status-dot {
  font-size: 8px;
}

.status-active {
  color: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.card-value {
  font-size: 13px;
  opacity: 0.7;
}

.card-value-large {
  font-size: 28px;
  font-weight: 700;
  opacity: 0.9;
}

.owner-card {
  grid-column: 1 / -1;
}

.owner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  opacity: 0.7;
}

/* ===== TQTO SECTION ===== */
.tqto-card {
  padding: 24px;
}

.tqto-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.tqto-title i {
  color: #ef4444;
}

.tqto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.tqto-item {
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: transform 0.2s;
}

.tqto-item:hover {
  transform: translateY(-2px);
}

.tqto-avatar {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .tqto-avatar {
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.tqto-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.tqto-role {
  font-size: 13px;
  opacity: 0.6;
  margin-bottom: 6px;
}

.tqto-desc {
  font-size: 11px;
  opacity: 0.4;
}

/* ===== STATISTICS SECTION ===== */
.statistics-section {
  margin-top: 24px;
}

.statistics-content {
  margin-top: 16px;
}

.statistics-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-item {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s;
}

body.light-mode .stat-item {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.stat-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(4px);
}

body.light-mode .stat-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

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

.stat-method {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.stat-method.get {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.stat-method.post {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.stat-method.put {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.stat-method.delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.stat-time {
  font-size: 11px;
  opacity: 0.5;
}

.stat-endpoint {
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  opacity: 0.8;
  word-break: break-all;
}

/* ===== NOTIFICATION BADGE ===== */
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== DROPDOWN ===== */
.relative {
  position: relative;
}

.dropdown-content {
  padding-left: 12px;
}

.relative button {
  width: 100%;
  text-align: left;
}