:root {
  --bg: #050304;
  --surface: #0a0706;
  --card: rgba(18, 13, 11, 0.65);
  --card-hover: rgba(26, 20, 18, 0.8);
  --border: rgba(255, 123, 53, 0.1);
  --border-2: rgba(255, 123, 53, 0.2);
  --text: #fff8f5;
  --text-2: #e8d0c0;
  --muted: rgba(176, 144, 128, 0.9);
  --muted-2: #7a6055;
  --accent: #ff7b35;
  --accent-2: #ffa552;
  --accent-dim: rgba(255, 123, 53, 0.1);
  --accent-glow: rgba(255, 123, 53, 0.4);
  --success: #22c55e;
  --warning: #fb923c;
  --danger: #ef4444;
  --r: 12px;
  --ease: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(255, 123, 53, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 123, 53, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

/* ── Nav ── */
.relative {
  position: relative;
}

.z-10 {
  z-index: 10;
}

.glass-header {
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 16px;
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-home {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--accent-dim);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease),
    box-shadow var(--ease);
  flex-shrink: 0;
}

.nav-home:hover {
  color: var(--accent);
  border-color: var(--border-2);
  background: rgba(255, 123, 53, 0.12);
  box-shadow: 0 0 14px var(--accent-glow);
}

.brand-text {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.35);
  flex-shrink: 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
  animation: pulse 2s infinite;
}

.nav-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-brand::before {
  content: "// ";
  -webkit-text-fill-color: var(--accent);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--accent-dim);
  transition:
    color var(--ease),
    border-color var(--ease),
    background var(--ease);
}

.nav-link:hover {
  color: var(--accent);
  border-color: var(--border-2);
  background: rgba(255, 123, 53, 0.12);
}

/* ── Layout ── */
.main-wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* ── Section label ── */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  flex-shrink: 0;
}

/* ── Cards ── */
.card {
  background: var(--card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

/* ── Apps grid ── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--ease);
  position: relative;
  overflow: hidden;
}

.app-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-2);
  transition:
    background var(--ease),
    box-shadow var(--ease);
}

.app-card:hover {
  border-color: var(--border-2);
  background: var(--card-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.app-card:hover::before {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.app-card.featured {
  border-color: var(--border-2);
}
.app-card.featured::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.app-card .icon {
  font-size: 28px;
}
.app-card .name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.app-card .desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Status grid ── */
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.status-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color var(--ease);
}

.status-card:hover {
  border-color: var(--border-2);
}
.status-card .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.status-card .sname {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.dot-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-status.up {
  background: var(--success);
  box-shadow: 0 0 10px var(--success);
}
.dot-status.down {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
}
.status-card .meta {
  font-size: 12px;
  color: var(--muted);
}
.status-card .meta-mono {
  font-size: 11px;
  color: var(--muted-2);
  font-family: monospace;
}

/* ── Storage ── */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.storage-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.storage-card .stop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.storage-card .mount {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.storage-card .sizes {
  font-size: 12px;
  color: var(--muted);
}

.bar-bg {
  height: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 99px;
  position: relative;
  overflow: hidden;
}
.bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
.bar-fill.low {
  background: var(--success);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
}
.bar-fill.medium {
  background: var(--warning);
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.3);
}
.bar-fill.high {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}
.storage-card .smeta {
  font-size: 11px;
  color: var(--muted-2);
  font-family: monospace;
}

/* ── Refresh ── */
.refresh-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
}

.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-2);
  transition: all var(--ease);
}
.refresh-dot.loading {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 123, 53, 0.05),
    rgba(255, 123, 53, 0.12),
    rgba(255, 123, 53, 0.05)
  );
  background-size: 200% 100%;
  border-radius: 6px;
  height: 14px;
  width: 60%;
  animation: skel 1.5s infinite;
}
@keyframes skel {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ── Mini dashboard ── */
.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.mini-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 123, 53, 0.05);
}
.mini-item:last-child {
  border-bottom: none;
}

.mini-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  margin-top: 2px;
}
.mb-faire {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}
.mb-encours {
  background: rgba(255, 123, 53, 0.15);
  color: var(--accent-2);
}
.mb-bloque {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.mb-termine {
  background: rgba(34, 197, 94, 0.15);
  color: #34d399;
}
.mb-agent {
  background: rgba(255, 123, 53, 0.12);
  color: var(--accent-2);
}
.mb-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #34d399;
}

.mini-text {
  flex: 1;
  min-width: 0;
}
.mini-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-sub {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.see-more {
  display: block;
  margin-top: 14px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  text-align: right;
  opacity: 0.8;
  transition: opacity var(--ease);
}
.see-more:hover {
  opacity: 1;
}

/* ── Footer ── */
footer {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
}
footer a {
  color: var(--accent);
  text-decoration: none;
}

::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 123, 53, 0.3);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 123, 53, 0.55);
}

@media (max-width: 900px) {
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
  .storage-grid {
    grid-template-columns: 1fr 1fr;
  }
  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}
@media (max-width: 700px) {
  .nav-inner {
    padding: 0 16px;
    height: 56px;
  }
  .nav-brand {
    font-size: 14px;
  }
  .main-wrap {
    padding: 24px 16px 48px;
    gap: 32px;
  }
  .mini-grid {
    grid-template-columns: 1fr;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
  .storage-grid {
    grid-template-columns: 1fr;
  }
  .apps-grid {
    grid-template-columns: 1fr 1fr;
  }
  .section-label {
    font-size: 10px;
  }
  .card {
    padding: 16px;
  }
  .app-card {
    padding: 18px 14px;
    gap: 8px;
  }
  .app-card .icon {
    font-size: 24px;
  }
  .app-card .name {
    font-size: 13px;
  }
  .app-card .desc {
    font-size: 11px;
  }
}
@media (max-width: 480px) {
  .apps-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav-link {
    padding: 5px 10px;
    font-size: 11px;
  }
  .nav-link svg {
    width: 10px;
    height: 10px;
  }
  .nav-label {
    display: none;
  }
  .orb {
    filter: blur(60px);
  }
  .app-card {
    padding: 16px 12px;
  }
}
@media (max-width: 400px) {
  .apps-grid {
    grid-template-columns: 1fr;
  }
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 8px;
  }
  .main-wrap {
    padding: 20px 12px 40px;
    gap: 28px;
  }
}
