/* ============================================
   FEROW ADMIN — Dashboard / Layout Styles
   ============================================ */

/* === LAYOUT GLOBAL === */
body {
  display: flex;
  overflow: hidden;
  height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* Sidebar header */
.sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(19, 127, 236, 0.1);
  border: 1px solid rgba(19, 127, 236, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
}

.sidebar-subbrand {
  font-size: 10px;
  color: var(--primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}



.nav-section-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 10px 8px;
}

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

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.nav-item.active {
  background: rgba(19, 127, 236, 0.12);
  color: var(--primary);
  border: 1px solid rgba(19, 127, 236, 0.2);
}

.nav-item.active .nav-icon { color: var(--primary); }

.nav-item.coming-soon {
  opacity: 0.55;
  cursor: default;
}
.nav-item.coming-soon:hover {
  background: transparent;
  color: #ffffff;
}

.nav-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: inherit;
}

.nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Profile bas sidebar */
.sidebar-profile {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--text-muted);
  transition: all var(--transition);
  flex-shrink: 0;
}

.logout-btn:hover {
  background: rgba(255, 71, 87, 0.1);
  color: var(--danger);
}

/* === MAIN WRAPPER === */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* === HEADER === */
.main-header {
  height: var(--header-height);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  flex-shrink: 0;
  gap: 16px;
}

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

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.menu-toggle:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.page-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

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

.header-status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.4s;
}
.status-dot.online { background: var(--success); box-shadow: 0 0 8px rgba(16,217,123,0.4); }
.status-dot.offline { background: var(--danger); }

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

/* Welcome banner */
.welcome-banner {
  background: linear-gradient(135deg, rgba(19,127,236,0.08) 0%, rgba(0,212,255,0.04) 100%);
  border: 1px solid rgba(19,127,236,0.15);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.welcome-text h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}

.welcome-text p {
  font-size: 14px;
  color: var(--text-secondary);
}

.welcome-time {
  font-size: 13px;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
  line-height: 1.8;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

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

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-blue { background: rgba(19,127,236,0.12); color: var(--primary); }
.icon-green { background: rgba(16,217,123,0.12); color: var(--success); }
.icon-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }
.icon-orange { background: rgba(245,166,35,0.12); color: var(--warning); }

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text-primary);
  line-height: 1;
}

.stat-detail {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-bar {
  height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-blue { background: var(--primary); }
.bar-green { background: var(--success); }
.bar-purple { background: #8b5cf6; }
.bar-orange { background: var(--warning); }

/* Grille du bas */
.bottom-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dashboard-section {
  padding: 20px;
}

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

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

/* Activité récente */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-placeholder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  color: var(--text-muted);
  font-size: 14px;
  justify-content: center;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.activity-content { flex: 1; }

.activity-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
}

/* API Status card */
.api-status-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.api-row-label { color: var(--text-secondary); }

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  transition: all var(--transition);
  text-align: left;
  width: 100%;
}

.quick-action:not(:disabled):hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  transform: translateX(3px);
}

.quick-action.coming { opacity: 0.5; cursor: not-allowed; }

.qa-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qa-blue { background: rgba(19,127,236,0.12); color: var(--primary); }
.qa-green { background: rgba(16,217,123,0.12); color: var(--success); }
.qa-purple { background: rgba(139,92,246,0.12); color: #8b5cf6; }

.qa-text {
  display: flex;
  flex-direction: column;
}

.qa-text span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.qa-text small {
  font-size: 11px;
  color: var(--text-muted);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-grid { grid-template-columns: 1fr; }
  .right-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .main-content { padding: 20px 16px; }
  .main-header { padding: 0 16px; }
  .welcome-banner { flex-direction: column; align-items: flex-start; }
  .welcome-time { display: none; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .right-column { grid-template-columns: 1fr; }
  .header-status { display: none; }
  .btn.btn-ghost { display: none; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
}
