/* =============================================================================
   DASHBOARD.CSS — Styles du dashboard principal
   ============================================================================= */

#app {
  display: none;
  height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

#app.visible {
  display: flex;
}

/* Main content */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
}

.welcome-section {
  max-width: 800px;
  margin: 0 auto 32px;
}

.welcome-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.welcome-sub {
  color: var(--text-muted);
  font-size: 15px;
}

/* Services grid */
.services-grid {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

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

.service-card:active {
  transform: translateY(0);
}

.service-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.service-card.disabled:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

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

.service-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.5);
}

.service-status.offline {
  background: var(--text-dim);
  box-shadow: none;
}

.service-status.coming-soon {
  background: var(--yellow);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.4);
}

.service-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.service-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.service-badge {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

/* ═══ Profile Section ═══ */
.profile-section {
  max-width: 800px;
  margin: 40px auto 0;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.profile-name {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.profile-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-email {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-role-badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
}

.profile-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-btn {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.profile-btn:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.profile-auth-info {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.auth-badge {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
}

/* ═══ Password Modal ═══ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-field {
  margin-bottom: 16px;
}

.modal-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.modal-field input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.modal-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.modal-error {
  font-size: 13px;
  color: var(--red, #f87171);
  margin-bottom: 12px;
  display: none;
}

.modal-error.visible {
  display: block;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border);
  font-family: inherit;
}

.modal-btn.cancel {
  background: var(--surface-raised);
  color: var(--text-muted);
}

.modal-btn.cancel:hover {
  background: var(--surface-hover);
}

.modal-btn.confirm {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.modal-btn.confirm:hover {
  opacity: 0.9;
}

.modal-btn.confirm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transition: transform 0.3s ease;
  white-space: nowrap;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}
