/* ============================================================
   ATMOSPHERE — Espace Privé
   ============================================================ */

/* ── Page login ──────────────────────────────────────── */
.atm-login-page {
  background: var(--dark);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--font-body);
}
.atm-login-wrap { width: 100%; max-width: 420px; }
.atm-login-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
}
/* ── SPHERE branding — login ─────────────────────── */
.atm-login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.atm-login-welcome {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin: 0 0 14px;
}
.atm-login-logo { display: block; text-decoration: none; }
.atm-sphere-logo {
  height: 190px !important;
  width: 190px !important;
  display: block;
  filter: drop-shadow(0 0 32px rgba(255,255,255,0.10));
}
.atm-login-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  margin: 14px 0 0;
  letter-spacing: 0.06em;
}
.atm-login-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
  margin: 10px 0 0;
  letter-spacing: 0.03em;
}

/* ── SPHERE logo — header ────────────────────────── */
.atm-sphere-header-logo {
  height: 32px !important;
  width: 32px !important;
  flex-shrink: 0;
}
.atm-login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(232,25,44,0.1);
  border: 1px solid rgba(232,25,44,0.3);
  color: #ff8090;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  margin-bottom: 20px;
  text-align: left;
}
.atm-login-form { text-align: left; }
.atm-field { margin-bottom: 16px; }
.atm-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-inv-2);
  margin-bottom: 7px;
}
.atm-field input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--dark-border2);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--text-inv);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.atm-field input:focus {
  border-color: var(--blue);
  background: rgba(0,174,239,0.05);
}
.atm-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 20px;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.2s, transform 0.1s;
}
.atm-login-btn:hover  { background: var(--red-dark); }
.atm-login-btn:active { transform: scale(0.98); }
.atm-login-back {
  display: block;
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-inv-3);
  text-decoration: none;
  transition: color 0.2s;
}
.atm-login-back:hover { color: var(--text-inv-2); }

/* ── Layout commun ───────────────────────────────────── */
.atm-espace-page {
  background: var(--dark);
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-inv);
}

/* Logo SPHERE en filigrane sur toutes les pages espace */
.atm-sphere-watermark {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 440px);
  height: min(80vw, 440px);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
  object-fit: contain;
  user-select: none;
}
.atm-espace-wrap { position: relative; z-index: 1; display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
.atm-espace-header {
  background: var(--dark-2);
  border-bottom: 1px solid var(--dark-border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.atm-espace-header-left,
.atm-espace-header-right { display: flex; align-items: center; gap: 10px; }
.atm-role-badge {
  background: rgba(0,174,239,0.14);
  color: var(--blue);
  border: 1px solid rgba(0,174,239,0.28);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.atm-role-badge--admin {
  background: rgba(232,25,44,0.12);
  color: #ff8090;
  border-color: rgba(232,25,44,0.28);
}
.atm-espace-user {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--text-inv-2);
}
.atm-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  color: var(--text-inv-2);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.atm-logout-btn:hover { background: rgba(232,25,44,0.15); color: var(--red); }

/* Logo dans le header — empêche l'expansion plein écran due à img { height: auto } du thème */
.atm-espace-header img { height: 34px !important; width: auto !important; max-width: none; flex-shrink: 0; }
html body.atm-espace-page { margin-top: 0 !important; padding-top: 0 !important; }

/* Main */
.atm-espace-main {
  flex: 1;
  padding: 16px 20px 24px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}
.atm-admin-page .atm-espace-main { max-width: 960px; }

/* Date bar */
.atm-date-bar {
  font-size: 13px;
  color: var(--text-inv-2);
  text-align: center;
  padding: 8px 0 18px;
  text-transform: capitalize;
}

/* Section title */
.atm-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-inv-2);
  margin: 0 0 16px;
}

/* Card */
.atm-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}

/* ── Pointage ────────────────────────────────────────── */
.atm-pointage-section { text-align: center; }
.atm-pt-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  color: var(--text-inv-2);
  margin: 0 0 18px;
}
.atm-pt-msg--active { color: #4ade80; font-weight: 500; }
.atm-pt-msg--done   { color: var(--text-inv-2); }
.atm-pt-timer {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #4ade80;
  margin-bottom: 20px;
  line-height: 1;
}
.atm-pointage-actions { display: flex; justify-content: center; }
.atm-pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-head);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
}
.atm-pt-btn:active { transform: scale(0.97); }
.atm-pt-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.atm-pt-btn--start { background: #16a34a; color: #fff; }
.atm-pt-btn--start:hover { filter: brightness(1.1); }
.atm-pt-btn--stop  { background: var(--red); color: #fff; }
.atm-pt-btn--stop:hover  { filter: brightness(1.1); }

/* ── Outils ──────────────────────────────────────────── */
.atm-tools-section { margin-bottom: 8px; }
.atm-tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.atm-tool-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  cursor: pointer;
}
.atm-tool-card:hover:not(.atm-tool-card--soon) {
  border-color: rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
}
.atm-tool-card--soon { opacity: 0.5; pointer-events: none; }
.atm-tool-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.atm-tool-icon--red    { background: rgba(232,25,44,0.13);  color: #ff8090; }
.atm-tool-icon--blue   { background: rgba(0,174,239,0.13);  color: var(--blue); }
.atm-tool-icon--green  { background: rgba(74,222,128,0.1);  color: #4ade80; }
.atm-tool-icon--orange { background: rgba(251,146,60,0.13); color: #fb923c; }
.atm-tool-icon--gray   { background: rgba(255,255,255,0.07); color: var(--text-inv-3); }
.atm-tool-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-inv);
  line-height: 1.35;
  flex: 1;
}
.atm-tool-arrow { color: var(--text-inv-3); align-self: flex-end; }
.atm-soon-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.07);
  color: var(--text-inv-3);
  border-radius: 4px;
  padding: 2px 7px;
}

/* ── Admin : stats ───────────────────────────────────── */
.atm-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.atm-stat-card {
  background: var(--dark-card);
  border: 1px solid var(--dark-border2);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.atm-stat-val {
  font-family: var(--font-head);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-inv);
}
.atm-stat-val--green { color: #4ade80; }
.atm-stat-val--blue  { color: var(--blue); }
.atm-stat-label { font-size: 12px; color: var(--text-inv-2); }

/* ── Table ───────────────────────────────────────────── */
.atm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.atm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.atm-table th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-inv-3);
  border-bottom: 1px solid var(--dark-border);
  white-space: nowrap;
}
.atm-table td {
  padding: 12px 12px;
  border-bottom: 1px solid var(--dark-border);
  color: var(--text-inv);
  white-space: nowrap;
}
.atm-table tr:last-child td { border-bottom: none; }
.atm-table tr:hover td { background: rgba(255,255,255,0.02); }
.atm-row-absent td { opacity: 0.5; }

.atm-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.atm-badge--active { background: rgba(74,222,128,0.12);  color: #4ade80; }
.atm-badge--done   { background: rgba(0,174,239,0.12);   color: var(--blue); }
.atm-badge--none   { background: rgba(255,255,255,0.05); color: var(--text-inv-3); }

/* ── Footer ──────────────────────────────────────────── */
.atm-espace-footer {
  border-top: 1px solid var(--dark-border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-inv-3);
}
.atm-espace-footer a { color: var(--blue); text-decoration: none; font-size: 12px; }

/* ── Mobile small ────────────────────────────────────── */
@media (max-width: 480px) {
  .atm-login-card { padding: 32px 24px; }
  .atm-tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .atm-tool-card  { padding: 14px 12px; }
  .atm-tool-icon  { width: 38px; height: 38px; }
  .atm-pt-timer   { font-size: 42px; }
  .atm-stats-row  { gap: 8px; }
  .atm-stat-val   { font-size: 28px; }
}

/* ── Desktop ─────────────────────────────────────────── */
@media (min-width: 769px) {
  .atm-espace-header { padding: 14px 40px; }

  .atm-espace-main {
    max-width: 920px;
    padding: 28px 40px 48px;
  }
  .atm-admin-page .atm-espace-main {
    max-width: 1160px;
    padding: 28px 40px 48px;
  }

  .atm-tools-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .atm-tool-card  { padding: 22px 20px; }
  .atm-tool-icon  { width: 50px; height: 50px; border-radius: 12px; }
  .atm-tool-label { font-size: 14px; }

  .atm-card { padding: 28px; }
  .atm-pt-timer { font-size: 72px; }
  .atm-pt-btn   { max-width: 340px; font-size: 18px; padding: 20px 28px; }

  .atm-stats-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .atm-stat-val   { font-size: 44px; }

  .atm-date-bar { text-align: left; padding: 6px 0 22px; font-size: 14px; }
  .atm-section-title { font-size: 14px; margin-bottom: 18px; }

  .atm-login-wrap { max-width: 460px; }
  .atm-login-card { padding: 48px 44px; }
  .atm-login-title { font-size: 30px; }
}

@media (min-width: 1200px) {
  .atm-tools-grid { grid-template-columns: repeat(4, 1fr); }
}

.atm-fh-export-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(52,211,153,0.14);
  border: 1px solid rgba(52,211,153,0.35);
  color: #34d399;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s;
  white-space: nowrap;
}
.atm-fh-export-link:hover { background: rgba(52,211,153,0.24); }

/* ── Bouton vue aperçu ───────────────────────────────── */
.atm-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 9px;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.atm-preview-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.atm-preview-btn--on {
  background: rgba(251,191,36,0.15);
  border-color: rgba(251,191,36,0.4);
  color: #fbbf24;
}
.atm-preview-btn--on:hover { background: rgba(251,191,36,0.25); color: #fbbf24; }

/* ── Bannière mode aperçu ────────────────────────────── */
.atm-preview-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(251,191,36,0.10);
  border-bottom: 1px solid rgba(251,191,36,0.25);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
}
.atm-preview-quit {
  margin-left: auto;
  color: rgba(251,191,36,0.7);
  text-decoration: underline;
  font-weight: 500;
}
.atm-preview-quit:hover { color: #fbbf24; }

/* ── Bouton actualiser ───────────────────────────────── */
.atm-refresh-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.18s, color 0.18s, transform 0.3s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.atm-refresh-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.atm-refresh-btn:active { transform: rotate(180deg); }

/* ── Salutation ──────────────────────────────────────── */
.atm-greeting-block {
  padding: 22px 20px 6px;
  text-align: left;
}
.atm-greeting-title {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-head);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.atm-greeting-date {
  font-size: 13px;
  color: rgba(255,255,255,0.38);
  margin: 0;
  font-weight: 500;
  text-transform: capitalize;
}

/* ── Widgets du jour ─────────────────────────────────── */
.atm-day-widgets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px 18px;
}
.atm-widget {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
}
.atm-widget-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.atm-widget-label {
  font-size: 13px;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
  line-height: 1.4;
}
.atm-widget-label strong { color: #fff; font-weight: 700; }
.atm-widget--weather { border-color: rgba(0,174,239,0.18); }
.atm-widget--saint   { border-color: rgba(255,255,255,0.09); }
.atm-widget--quote   {
  border-color: rgba(255,200,60,0.18);
  background: rgba(255,200,60,0.04);
}
.atm-widget-quote-text {
  font-style: italic;
  color: rgba(255,255,255,0.58);
}

/* ── Icône dépannage teal ────────────────────────────── */
.atm-tool-icon--teal {
  background: rgba(20,184,166,0.14);
  border: 1px solid rgba(20,184,166,0.3);
  color: #2dd4bf;
}

/* ── Outil désactivé (bientôt) ───────────────────────── */
.atm-tool-card--disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.atm-tool-soon {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 2px 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
}
