/* GLOBAL */
body.dark-bg {
    margin: 0;
    font-family: "Inter", sans-serif;
    background-color: #0d1117;
    color: #e6edf3;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #161b22;
    padding: 15px 25px;
    border-bottom: 1px solid #30363d;
}

.title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2f81f7;
}

.nav-right a {
    color: #e6edf3;
    margin-left: 20px;
    text-decoration: none;
}

.nav-right a:hover {
    color: #2f81f7;
}

/* FOOTER */
.footer {
    text-align: center;
    padding: 10px;
    margin-top: 40px;
    font-size: 0.85rem;
    color: #8b949e;
}

/* LOGIN */
.center-container {
    display: flex;
    justify-content: center;
    margin-top: 12vh;
}

.login-card {
    background: #161b22;
    padding: 25px;
    width: 350px;
    border: 1px solid #30363d;
    border-radius: 10px;
    text-align: center;
}

.login-title {
    margin-bottom: 20px;
    color: #2f81f7;
}

.input {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border-radius: 8px;
    border: 1px solid #30363d;
    background: #0d1117;
    color: #e6edf3;
}

.input::placeholder {
    color: #6e7681;
}

.btn-primary {
    width: 95%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    border-radius: 8px;
    background: #2f81f7;
    color: white;
    cursor: pointer;
}

.btn-primary:hover {
    background: #1b63c7;
}

.error {
    margin-top: 12px;
    color: #ff6b6b;
}

/* DASHBOARD */
.dashboard-title {
    text-align: center;
    font-size: 2rem;
    margin-top: 40px;
}

.cards-grid {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 40px;
}

.card {
    background: #1c2128;
    padding: 20px;
    width: 220px;
    border-radius: 12px;
    border: 1px solid #30363d;
    text-align: center;
}

.card h3 {
    color: #2f81f7;
}

.card p {
    color: #e6edf3;
    margin-top: 8px;
    font-size: 1.2rem;
}
.logo {
    height: 32px;
    margin-right: 10px;
}


/* DASHBOARD V2 */
.dash-wrap{
  max-width: 1100px;
  margin: 30px auto;
  padding: 0 18px;
}

.dash-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin-bottom: 18px;
}

.dash-title{
  margin:0;
  font-size: 1.8rem;
  letter-spacing: .2px;
}

.dash-subtitle{
  margin: 6px 0 0 0;
  color:#8b949e;
  font-size:.95rem;
}

.dash-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap: wrap;
}

.btn-secondary{
  display:inline-block;
  padding:10px 12px;
  border:1px solid #30363d;
  background:#161b22;
  border-radius:10px;
  text-decoration:none;
  color:#e6edf3;
}

.btn-secondary:hover{ border-color:#2f81f7; color:#2f81f7; }

.stats-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:14px;
  margin-top: 14px;
}

.stat-card{
  background:#1c2128;
  border:1px solid #30363d;
  border-radius: 14px;
  padding: 14px 14px 12px 14px;
}

.stat-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom: 10px;
}

.stat-label{ color:#8b949e; font-size:.9rem; }
.stat-badge{
  font-size:.75rem;
  border:1px solid #30363d;
  padding: 4px 8px;
  border-radius: 999px;
  color:#8b949e;
}
.stat-badge.warn{ color:#ffcc66; border-color:#4b3b1f; background:#201a10; }

.stat-value{
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-foot{
  margin-top: 6px;
  color:#8b949e;
  font-size: .85rem;
}

.dash-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:14px;
  margin-top: 14px;
}

.panel{
  background:#161b22;
  border:1px solid #30363d;
  border-radius: 14px;
  padding: 14px;
  min-height: 220px;
}

.panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom: 10px;
}

.panel-title{ margin:0; font-size: 1.05rem; }
.panel-link{
  color:#8b949e;
  text-decoration:none;
  font-size:.9rem;
}
.panel-link:hover{ color:#2f81f7; }

.empty{
  border:1px dashed #30363d;
  border-radius: 14px;
  padding: 18px;
  text-align:center;
  margin-top: 10px;
  background: #0d1117;
}

.empty-icon{ font-size: 1.6rem; margin-bottom: 8px; }
.empty-title{ font-weight: 650; margin-bottom: 6px; }
.empty-text{ color:#8b949e; font-size:.95rem; margin-bottom: 14px; }

.activity{ display:flex; flex-direction:column; gap:12px; margin-top:10px; }
.activity-item{ display:flex; gap:10px; align-items:flex-start; }
.activity-title{ font-weight: 600; }
.activity-sub{ color:#8b949e; font-size:.9rem; margin-top:2px; }

.dot{ width:10px; height:10px; border-radius:50%; margin-top:5px; }
.dot-blue{ background:#2f81f7; }
.dot-purple{ background:#7c3aed; }
.dot-gray{ background:#6e7681; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:.85rem;
  border:1px solid #30363d;
  color:#8b949e;
  background:#0d1117;
}
.pill-ok{
  color:#7ee787;
  border-color:#1f3b2a;
  background:#0f1a13;
}

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

/* TOKEN BOX */
.token-box{
  margin-top: 8px;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius: 12px;
  padding: 12px;
}

.token-label{
  color:#8b949e;
  font-size:.85rem;
  margin-bottom: 8px;
}

.token-row{
  display:flex;
  align-items:center;
  gap:8px;
}

.token-value{
  flex:1;
  display:block;
  padding:10px 10px;
  border-radius:10px;
  border:1px solid #30363d;
  background:#161b22;
  color:#e6edf3;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.blurred{
  filter: blur(7px);
  user-select:none;
}

.icon-btn{
  border:1px solid #30363d;
  background:#161b22;
  color:#e6edf3;
  border-radius:10px;
  padding:10px 10px;
  cursor:pointer;
  line-height:1;
}

.icon-btn:hover{
  border-color:#2f81f7;
  color:#2f81f7;
}

.token-hint{
  color:#8b949e;
  font-size:.85rem;
  margin-top: 8px;
}

.panel-sep{
  border:0;
  border-top:1px solid #30363d;
  margin: 14px 0;
}

.token-toast{
  margin-top: 10px;
  display:inline-block;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid #1f3b2a;
  background:#0f1a13;
  color:#7ee787;
  opacity:0;
  transform: translateY(4px);
  transition: .15s ease;
}

.token-toast.show{
  opacity:1;
  transform: translateY(0);
}

.table { margin-top: 10px; }
.row {
  display:grid;
  grid-template-columns: 2fr 1fr .8fr .8fr .8fr 1.4fr;
  gap: 10px;
  padding: 10px 8px;
  border-top: 1px solid #30363d;
  align-items:center;
  font-size: .92rem;
}
.row.head {
  border-top: none;
  color:#8b949e;
  font-size: .85rem;
  padding-top: 0;
}
.muted { color:#8b949e; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

.pill-bad{
  color:#ff7b72;
  border-color:#4b1f1f;
  background:#1f0f10;
}

.metric{
  display:inline-block;
  padding:4px 8px;
  border-radius:10px;
  border:1px solid #30363d;
  background:#0d1117;
  color:#e6edf3;
}

/* ALERTE */
.metric-bad{
  border-color:#ff3b3b;
  background:#2a0f10;
  color:#ff4d4f;
  font-weight:700;
  box-shadow: 0 0 0 1px rgba(255, 77, 79, 0.15);
}
@keyframes alertPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 77, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 79, 0); }
}

.metric-bad{
  border-color:#ff3b3b;
  background:#2a0f10;
  color:#ff4d4f;
  font-weight:700;
  animation: alertPulse 1.5s ease-out infinite;
}

.machine-name{
  display:flex;
  align-items:center;
}

.machine-link{
  color:#a371f7;           /* violet EMcloud */
  text-decoration:none;
}

.machine-link:hover{
  text-decoration:underline;
}

.download-box{
  margin-top: 12px;
  background:#0d1117;
  border:1px solid #30363d;
  border-radius: 12px;
  padding: 12px;
}

.w-full{
  width:100%;
  display:block;
  text-align:center;
  margin-top: 8px;
}
.kv{ padding: 4px 2px; }
.kv-row{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:10px 0;
  border-top:1px solid #30363d;
}
.kv-row:first-child{ border-top:none; padding-top:0; }
.kv-k{ color:#8b949e; font-size:.9rem; }
.kv-v{
  color:#e6edf3;
  text-align:right;
  max-width:60%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.hint{
  margin-top:12px;
  color:#8b949e;
  font-size:.9rem;
}
.offline-banner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid #ff3b3b;
  background: linear-gradient(180deg, rgba(255,59,59,0.12), rgba(255,59,59,0.05));
  margin: 12px 0 18px;
}

.offline-title{
  font-weight:800;
  font-size:1.05rem;
  color:#ff4d4f;
}

.offline-sub{
  margin-top:4px;
  color:#e6edf3;
  opacity:.85;
  font-size:.92rem;
}

.stale-pill{
  display:inline-block;
  margin-left:10px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid #30363d;
  background:#0d1117;
  color:#8b949e;
  font-size:.78rem;
}

/* Mode offline : tout griser */
.is-offline .stat-card,
.is-offline .panel{
  opacity:.75;
}

.is-offline .metric{
  opacity:.7;
}

/* Garde le rouge OFFLINE bien visible */
.is-offline .pill-bad{
  opacity:1;
}

