/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Vixz Host v2.0 · Cinematic Dark Aesthetic
   Estética: cyber minimalista · preto e branco premium
   Tipografia: DM Mono + Syne
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

:root {
  --bg:          #000000;
  --bg-glass:    rgba(4,4,8,0.88);
  --bg2:         #060608;
  --bg3:         #0b0b10;
  --card:        rgba(255,255,255,0.028);
  --card-h:      rgba(255,255,255,0.055);
  --border:      rgba(255,255,255,0.07);
  --border2:     rgba(255,255,255,0.13);
  --border-h:    rgba(255,255,255,0.24);
  --white:       #ffffff;
  --white-90:    rgba(255,255,255,0.9);
  --white-60:    rgba(255,255,255,0.6);
  --white-35:    rgba(255,255,255,0.35);
  --white-15:    rgba(255,255,255,0.15);
  --white-08:    rgba(255,255,255,0.08);
  --white-04:    rgba(255,255,255,0.04);
  --accent:      #ffffff;
  --glow-box:    0 0 0 1px rgba(255,255,255,0.08), 0 0 28px rgba(255,255,255,0.03);
  --green:       #3dffa0;
  --green-dim:   rgba(61,255,160,0.1);
  --red:         #ff4f6b;
  --red-dim:     rgba(255,79,107,0.1);
  --yellow:      #ffd666;
  --text:        #eeeef5;
  --muted:       rgba(255,255,255,0.36);
  --muted2:      rgba(255,255,255,0.54);
  --sans:        'Syne', system-ui, sans-serif;
  --mono:        'DM Mono', monospace;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-xs:   5px;
  --topbar-h:    56px;
  --sidebar-w:   220px;
  --blur:        blur(20px);
  --blur-sm:     blur(10px);
  --shadow:      0 8px 40px rgba(0,0,0,0.85);
  --shadow-lg:   0 20px 72px rgba(0,0,0,0.95);
  --transition:  0.18s cubic-bezier(0.4,0,0.2,1);
  --spring:      0.36s cubic-bezier(0.34,1.56,0.64,1);
}

/* ─── Reset ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  opacity: 0.022;
  mix-blend-mode: overlay;
}

/* Scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.025) 2px, rgba(0,0,0,0.025) 4px);
  opacity: 0.7;
}

/* Canvas de partículas */
#vxCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  animation: canvas-fade 1.8s 0.4s ease forwards;
}
@keyframes canvas-fade { to { opacity: 0.7; } }

#app, .auth-bg { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; border: none; background: none; }

input, select, textarea {
  background: var(--white-04);
  color: var(--white-90);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  width: 100%;
  outline: none;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--border-h);
  background: var(--white-08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 0 24px rgba(255,255,255,0.03);
}
select option { background: #0b0b10; color: var(--white-90); }
::placeholder { color: var(--muted); font-family: var(--mono); }
pre { white-space: pre-wrap; word-break: break-all; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--white-15); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--white-35); }

/* ─── Typography ─────────────────────────── */
h1 { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.1rem, 3vw, 1.3rem);  font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.muted  { color: var(--muted);  font-size: .83rem; font-family: var(--mono); }
.muted2 { color: var(--muted2); }
.eyebrow {
  font-family: var(--mono);
  font-size: .67rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ─── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .8rem;
  font-family: var(--mono);
  letter-spacing: .05em;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
.btn:hover::after { transform: translateX(100%); }
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--white);
  color: #000;
  letter-spacing: .04em;
}
.btn-primary:hover {
  background: #e4e4e4;
  box-shadow: 0 0 28px rgba(255,255,255,0.18), 0 4px 20px rgba(0,0,0,0.5);
}
.btn-ghost {
  background: var(--card);
  color: var(--muted2);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur-sm);
}
.btn-ghost:hover { background: var(--card-h); color: var(--white-90); border-color: var(--border2); }
.btn-danger { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(255,79,107,0.18); }
.btn-danger:hover { background: rgba(255,79,107,0.18); box-shadow: 0 0 18px rgba(255,79,107,0.1); }
.btn-green  { background: var(--green-dim); color: var(--green); border: 1px solid rgba(61,255,160,0.18); }
.btn-green:hover  { background: rgba(61,255,160,0.18);  box-shadow: 0 0 18px rgba(61,255,160,0.1); }
.btn-sm { padding: 7px 13px; font-size: .75rem; border-radius: var(--radius-xs); }
.btn-xs { padding: 4px 9px;  font-size: .72rem; border-radius: var(--radius-xs); }

/* ─── Auth ───────────────────────────────── */
.auth-bg {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-wrap {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  animation: fade-rise 0.65s ease both;
}
@media (min-width: 640px) { .auth-wrap { grid-template-columns: 1fr 1fr; align-items: center; } }

@keyframes fade-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-brand { text-align: center; }
@media (min-width: 640px) { .auth-brand { text-align: left; } }

.brand-logo {
  width: 52px; height: 52px;
  border: 1px solid var(--border2);
  border-radius: 13px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-weight: 400;
  font-size: .76rem;
  letter-spacing: .1em;
  color: var(--white-90);
  margin: 0 auto 18px;
  background: var(--card);
  backdrop-filter: var(--blur);
  animation: logo-pulse 4s ease-in-out infinite;
}
@media (min-width: 640px) { .brand-logo { margin: 0 0 18px; } }
@keyframes logo-pulse {
  0%,100% { box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 20px rgba(255,255,255,0.02); }
  50%     { box-shadow: 0 0 0 1px rgba(255,255,255,0.18), 0 0 36px rgba(255,255,255,0.07); }
}

.brand-title { font-size: clamp(1.7rem, 5vw, 2.3rem); font-weight: 800; letter-spacing: -0.04em; color: var(--white); margin-bottom: 10px; }
.brand-sub   { font-family: var(--mono); color: var(--muted2); font-size: .8rem; margin-bottom: 18px; line-height: 1.75; }
.brand-tags  { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
@media (min-width: 640px) { .brand-tags { justify-content: flex-start; } }
.brand-tags span {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .07em;
  color: var(--muted2);
  transition: all var(--transition);
}
.brand-tags span:hover { border-color: var(--border2); color: var(--white-60); }

.auth-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow), var(--glow-box);
  backdrop-filter: var(--blur);
  background-image: linear-gradient(160deg, rgba(255,255,255,0.025) 0%, transparent 70%);
  animation: fade-rise 0.7s 0.12s ease both;
}
.auth-card h2 { font-size: 1.08rem; color: var(--white-90); }
.auth-link { text-align: center; font-family: var(--mono); font-size: .76rem; color: var(--muted); transition: color var(--transition); }
.auth-link:hover { color: var(--white-60); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-family: var(--mono); font-size: .7rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted2); }

.alert { padding: 10px 14px; border-radius: var(--radius-xs); font-family: var(--mono); font-size: .78rem; }
.alert-error   { background: var(--red-dim);   border: 1px solid rgba(255,79,107,0.22);  color: #ff8fa0; }
.alert-success { background: var(--green-dim); border: 1px solid rgba(61,255,160,0.22);  color: var(--green); }

/* ─── App Layout ─────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100dvh; }

/* ─── Topbar ─────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(0,0,0,0.9);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 12px;
  animation: fade-down 0.5s ease both;
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topbar-left  { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; position: relative; }

.topbar-logo {
  width: 30px; height: 30px;
  border: 1px solid var(--border2);
  border-radius: 7px;
  display: grid; place-items: center;
  font-family: var(--mono); font-weight: 400; font-size: .68rem; letter-spacing: .08em;
  color: var(--white-90); flex-shrink: 0; background: var(--card);
}
.admin-logo { border-color: rgba(255,255,255,0.22); }
.topbar-title { font-weight: 700; font-size: .86rem; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--white-90); }

.menu-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius-xs);
  color: var(--muted2); font-size: 1rem; border: 1px solid transparent;
  transition: all var(--transition);
}
.menu-toggle:hover { background: var(--card-h); border-color: var(--border); color: var(--white-90); }
@media (min-width: 900px) { .menu-toggle { display: none; } }

.user-btn    { gap: 8px; }
.user-avatar {
  width: 28px; height: 28px;
  border: 1px solid var(--border2); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: .7rem;
  color: var(--white-90); flex-shrink: 0; background: var(--card);
}
.user-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: rgba(3,3,6,0.97);
  border: 1px solid var(--border2); border-radius: var(--radius);
  padding: 8px; min-width: 180px;
  box-shadow: var(--shadow-lg), var(--glow-box);
  backdrop-filter: var(--blur); z-index: 200;
  animation: fade-rise 0.18s ease;
}
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.dropdown-info { padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.dropdown-info strong { font-size: .86rem; color: var(--white-90); }
.dropdown-item { display: block; padding: 8px 10px; border-radius: var(--radius-xs); font-family: var(--mono); font-size: .77rem; color: var(--muted2); transition: all var(--transition); }
.dropdown-item:hover { background: var(--card-h); color: var(--white-90); }

.plan-badge { padding: 3px 9px; border-radius: 3px; font-family: var(--mono); font-size: .68rem; letter-spacing: .06em; white-space: nowrap; }
.plan-badge.active   { background: var(--green-dim); color: var(--green); border: 1px solid rgba(61,255,160,0.2); }
.plan-badge.inactive { background: var(--red-dim);   color: var(--red);   border: 1px solid rgba(255,79,107,0.2); }

/* ─── Layout / Sidebar ───────────────────── */
.layout { display: flex; flex: 1; position: relative; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w);
  background: rgba(0,0,0,0.65);
  border-right: 1px solid var(--border);
  backdrop-filter: var(--blur);
  display: flex; flex-direction: column; flex-shrink: 0;
  transition: transform var(--transition); overflow-y: auto;
}
@media (max-width: 899px) {
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 90;
    transform: translateX(-100%); box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0; top: var(--topbar-h);
    background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); z-index: 89;
  }
}
.sidebar-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .78rem; letter-spacing: .04em;
  color: var(--muted); transition: all var(--transition);
  text-align: left; width: 100%; border: 1px solid transparent;
}
.sidebar-item:hover { background: var(--card-h); color: var(--white-60); border-color: var(--border); }
.sidebar-item.active { background: var(--white-08); color: var(--white-90); border-color: var(--border2); }
.sidebar-icon { font-size: .88rem; flex-shrink: 0; }

.main-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px 18px; max-width: 1200px; margin: 0 auto; width: 100%; }
@media (min-width: 640px) { .main-content { padding: 28px 28px; } }

/* ─── Views ──────────────────────────────── */
.view { display: none; }
.view.active { display: block; animation: fade-rise 0.38s ease both; }
.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.view-sub { font-family: var(--mono); color: var(--muted); font-size: .76rem; margin-top: 5px; letter-spacing: .03em; }
.hide-xs { display: none; }
@media (min-width: 400px) { .hide-xs { display: inline; } }

/* ─── Stats Row ──────────────────────────── */
.stats-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-pill { background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 5px 13px; font-family: var(--mono); font-size: .74rem; color: var(--muted); letter-spacing: .05em; transition: all var(--transition); }
.stat-pill span { font-weight: 500; color: var(--white-90); }
.stat-pill:hover { border-color: var(--border2); }

/* ─── Project Cards ──────────────────────── */
.projects-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 520px) { .projects-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); } }

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
  transition: all 0.25s ease;
  position: relative; overflow: hidden;
  backdrop-filter: var(--blur-sm);
  animation: fade-rise 0.4s ease both;
}
.project-card::before {
  content: '';
  position: absolute; top: 0; left: 16px; right: 16px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-h), transparent);
  opacity: 0; transition: opacity 0.3s ease;
}
.project-card:hover { background: var(--card-h); border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 12px 44px rgba(0,0,0,0.7), var(--glow-box); }
.project-card:hover::before { opacity: 1; }

.project-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.project-name { font-weight: 700; font-size: .9rem; letter-spacing: -0.01em; color: var(--white-90); }
.project-type { display: inline-block; font-family: var(--mono); font-size: .66rem; letter-spacing: .08em; color: var(--muted); background: var(--card); padding: 2px 8px; border-radius: 3px; border: 1px solid var(--border); margin-top: 4px; text-transform: uppercase; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 7px; }
.status-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse-green 2.2s ease-in-out infinite; }
.status-dot.offline { background: var(--white-15); }
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 5px var(--green), 0 0 10px rgba(61,255,160,0.18); }
  50%     { box-shadow: 0 0 12px var(--green), 0 0 22px rgba(61,255,160,0.35); }
}

.project-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.meta-tag { font-family: var(--mono); font-size: .67rem; background: var(--card); border: 1px solid var(--border); border-radius: 3px; padding: 2px 8px; color: var(--muted); letter-spacing: .05em; }
.meta-tag.port { color: var(--white-60); border-color: var(--border2); background: var(--white-08); }

.project-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.project-actions .btn { flex: 1; min-width: 0; }

/* ─── Templates ──────────────────────────── */
.templates-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 480px) { .templates-grid { grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); } }

.template-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  display: flex; flex-direction: column; gap: 8px;
  transition: all 0.25s ease;
  backdrop-filter: var(--blur-sm);
  animation: fade-rise 0.4s ease both;
}
.template-card:hover { background: var(--card-h); border-color: var(--border2); transform: translateY(-3px); box-shadow: 0 16px 52px rgba(0,0,0,0.7), var(--glow-box); }
.template-icon { font-size: 1.45rem; }
.template-name { font-weight: 700; font-size: .88rem; color: var(--white-90); }
.template-desc { font-family: var(--mono); color: var(--muted); font-size: .74rem; line-height: 1.55; }
.template-type { font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); background: var(--white-08); border: 1px solid var(--border); padding: 2px 8px; border-radius: 3px; align-self: flex-start; }

/* ─── Monitor ────────────────────────────── */
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.monitor-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; transition: all var(--transition); backdrop-filter: var(--blur-sm); }
.monitor-card:hover { background: var(--card-h); border-color: var(--border2); }
.monitor-label { font-family: var(--mono); font-size: .64rem; color: var(--muted); text-transform: uppercase; letter-spacing: .14em; margin-bottom: 8px; }
.monitor-value { font-size: 1.65rem; font-weight: 800; font-family: var(--mono); letter-spacing: -0.02em; }
.monitor-bar-wrap { height: 2px; background: var(--border); border-radius: 99px; margin-top: 12px; overflow: hidden; }
.monitor-bar { height: 100%; border-radius: 99px; transition: width 0.8s ease; }
.monitor-bar.low    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.monitor-bar.medium { background: var(--yellow); }
.monitor-bar.high   { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ─── Panel ──────────────────────────────── */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; margin-bottom: 14px; backdrop-filter: var(--blur-sm); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head p { font-family: var(--mono); color: var(--muted); font-size: .76rem; margin-top: 3px; }

/* ─── Modais ─────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.84);
  backdrop-filter: blur(10px);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
  animation: fade-in 0.16s ease;
}
@media (min-width: 600px) { .modal-overlay { align-items: center; padding: 20px; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: rgba(3,3,6,0.97);
  border: 1px solid var(--border2);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%; max-width: 520px; max-height: 92dvh;
  overflow-y: auto; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow-lg), var(--glow-box);
  backdrop-filter: var(--blur);
  background-image: linear-gradient(180deg, rgba(255,255,255,0.022) 0%, transparent 90px);
  animation: slide-up 0.24s cubic-bezier(0.34,1.1,0.64,1);
}
@media (min-width: 600px) { .modal-box { border-radius: var(--radius); animation: scale-in 0.2s cubic-bezier(0.34,1.1,0.64,1); } }
@keyframes slide-up { from { transform: translateY(32px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes scale-in { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-lg { max-width: 740px; }
.modal-xl { max-width: 1000px; max-height: 95dvh; }

.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modal-sub  { font-family: var(--mono); color: var(--muted); font-size: .74rem; margin-top: 3px; }
.modal-head-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.modal-close { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-xs); color: var(--muted); font-size: .88rem; flex-shrink: 0; transition: all var(--transition); border: 1px solid transparent; }
.modal-close:hover { background: var(--card-h); border-color: var(--border); color: var(--white-90); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 4px; }

/* ─── Logs ───────────────────────────────── */
.logs-wrap { flex: 1; overflow: hidden; }
.log-box {
  background: #010103;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px; font-family: var(--mono); font-size: .73rem;
  line-height: 1.65; color: rgba(61,255,160,0.82);
  height: clamp(200px, 42vh, 500px); overflow-y: auto; letter-spacing: .02em;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.07) 2px, rgba(0,0,0,0.07) 4px);
}
.console-bar { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.65); border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: 8px 12px; backdrop-filter: var(--blur-sm); }
.console-prompt { color: rgba(61,255,160,0.65); font-family: var(--mono); font-size: .8rem; flex-shrink: 0; }
.console-input  { background: transparent; border: none; flex: 1; padding: 0; font-family: var(--mono); font-size: .8rem; min-width: 0; color: var(--white-90); }
.console-input:focus { box-shadow: none; border-color: transparent; }

/* ─── File Manager ───────────────────────── */
.files-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.file-upload-label { cursor: pointer; }
.upload-bar { height: 2px; background: var(--border); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.upload-bar-fill { height: 100%; background: var(--white); border-radius: 99px; width: 0; transition: width 0.2s; box-shadow: 0 0 8px rgba(255,255,255,0.4); }
.files-layout { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .files-layout { flex-direction: row; height: clamp(300px, 52vh, 600px); } }

.files-pane { background: rgba(0,0,0,0.55); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow-y: auto; min-height: 160px; }
@media (min-width: 640px) { .files-pane { width: 220px; flex-shrink: 0; } }

.file-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-family: var(--mono); font-size: .76rem; border-bottom: 1px solid var(--border); color: var(--muted2); transition: all var(--transition); }
.file-item:hover { background: var(--card-h); color: var(--white-90); }
.file-item.active { background: var(--white-08); color: var(--white-90); }
.file-item-icon { flex-shrink: 0; font-size: .82rem; }
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { color: var(--muted); font-size: .68rem; white-space: nowrap; }

.editor-pane { flex: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(0,0,0,0.65); border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: 8px 14px; flex-wrap: wrap; }
.editor-filename { font-family: var(--mono); font-size: .74rem; color: var(--muted2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-actions { display: flex; gap: 6px; flex-shrink: 0; }
#fileEditor { flex: 1; background: #010103; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); color: #d4d4d4; font-family: var(--mono); font-size: .8rem; line-height: 1.65; padding: 14px; resize: none; tab-size: 2; min-height: 250px; letter-spacing: .02em; }
@media (min-width: 640px) { #fileEditor { min-height: unset; } }
#fileEditor:focus { box-shadow: none; border-color: var(--border); }

/* ─── Dependency Panel ───────────────────── */
.dep-panel { background: rgba(0,0,0,0.65); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 16px; backdrop-filter: var(--blur-sm); }
.dep-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.dep-tab { padding: 6px 12px; border-radius: var(--radius-xs); font-family: var(--mono); font-size: .74rem; letter-spacing: .05em; color: var(--muted); border: 1px solid transparent; transition: all var(--transition); }
.dep-tab.active { background: var(--white-08); color: var(--white-90); border-color: var(--border2); }
.dep-content.hidden { display: none; }
.dep-flags { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.dep-flags label { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .74rem; cursor: pointer; color: var(--muted2); }
.dep-output { background: #010103; border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 10px 12px; font-family: var(--mono); font-size: .72rem; color: rgba(61,255,160,0.7); max-height: 160px; overflow-y: auto; margin-top: 10px; white-space: pre-wrap; word-break: break-all; }

/* ─── Toggle ─────────────────────────────── */
.toggle-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-family: var(--mono); font-size: .78rem; color: var(--muted2); }
.toggle-label input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--white); cursor: pointer; }

/* ─── Toast ──────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: rgba(3,3,6,0.97);
  border: 1px solid var(--border2); border-radius: var(--radius-sm);
  padding: 11px 20px; font-family: var(--mono); font-size: .76rem; letter-spacing: .05em;
  box-shadow: var(--shadow-lg), var(--glow-box);
  z-index: 9999; opacity: 0;
  transition: all 0.28s cubic-bezier(0.34,1.3,0.64,1);
  max-width: calc(100vw - 32px); text-align: center;
  pointer-events: none; backdrop-filter: var(--blur);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-ok   { border-color: rgba(61,255,160,0.28);  color: var(--green); }
.toast.toast-err  { border-color: rgba(255,79,107,0.28);  color: var(--red);   }
.toast.toast-info { border-color: rgba(255,255,255,0.18); color: var(--white-90); }

/* ─── Empty State ────────────────────────── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--muted); animation: fade-rise 0.5s ease; }
.empty-icon  { font-size: 2.4rem; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: .98rem; color: var(--white-60); margin-bottom: 8px; }
.empty-state p  { margin-bottom: 22px; font-family: var(--mono); font-size: .78rem; }

/* ─── Plans ──────────────────────────────── */
.plans-main { max-width: 900px; margin: 0 auto; padding: 28px 16px; display: flex; flex-direction: column; gap: 16px; }
.plans-status-card { background: var(--card); border: 1px solid var(--border2); border-radius: var(--radius); padding: 22px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; backdrop-filter: var(--blur-sm); background-image: linear-gradient(135deg, rgba(255,255,255,0.022) 0%, transparent 60%); }
.plans-status-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; color: var(--white-90); }
.plans-status-exp  { font-family: var(--mono); font-size: .76rem; margin-top: 4px; }
.plans-redeem-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; backdrop-filter: var(--blur-sm); }
.redeem-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.redeem-input { font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; }
.redeem-msg { margin-top: 10px; font-family: var(--mono); font-size: .78rem; min-height: 1.2em; }
.plans-grid-wrap .eyebrow { margin-bottom: 12px; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); gap: 10px; }
.plan-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all var(--transition); backdrop-filter: var(--blur-sm); }
.plan-card:hover { background: var(--card-h); border-color: var(--border2); }
.plans-contact-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; backdrop-filter: var(--blur-sm); }
.plans-contact-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.plans-contact-head span { font-size: 1.1rem; opacity: 0.65; }
.plans-contact-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.contact-link { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: all var(--transition); }
.contact-link strong { display: block; font-size: .86rem; color: var(--white-90); }
.contact-link span   { font-family: var(--mono); font-size: .74rem; display: block; }
.contact-link .contact-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }
.contact-link.telegram { border-color: rgba(41,182,246,0.18); background: rgba(41,182,246,0.04); }
.contact-link.telegram:hover { border-color: rgba(41,182,246,0.36); background: rgba(41,182,246,0.08); }
.contact-link.telegram .contact-icon { background: linear-gradient(135deg, #0088cc, #29b6f6); color: #fff; }
.contact-link.telegram span { color: #29b6f6; }

/* ─── Admin ──────────────────────────────── */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 28px 16px; }
.code-block { background: rgba(0,0,0,0.65); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: 12px 14px; font-family: var(--mono); font-size: .74rem; color: var(--white-60); max-height: 220px; overflow-y: auto; letter-spacing: .04em; }

/* ─── Backups ────────────────────────────── */
.backup-list { display: flex; flex-direction: column; gap: 7px; }
.backup-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; transition: all var(--transition); }
.backup-item:hover { background: var(--card-h); border-color: var(--border2); }
.backup-item-name { font-family: var(--mono); font-size: .76rem; color: var(--white-60); }
.backup-item-meta { font-family: var(--mono); font-size: .7rem; color: var(--muted); }

/* ─── Utilities ──────────────────────────── */
code { font-family: var(--mono); font-size: .76rem; background: var(--white-08); padding: 2px 6px; border-radius: 4px; color: var(--white-60); }
.hidden { display: none !important; }
hr.divider { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

/* Staggered entrance */
.project-card:nth-child(1)  { animation-delay: .04s; }
.project-card:nth-child(2)  { animation-delay: .09s; }
.project-card:nth-child(3)  { animation-delay: .14s; }
.project-card:nth-child(4)  { animation-delay: .19s; }
.project-card:nth-child(5)  { animation-delay: .24s; }
.project-card:nth-child(6)  { animation-delay: .29s; }
.template-card:nth-child(1) { animation-delay: .05s; }
.template-card:nth-child(2) { animation-delay: .11s; }
.template-card:nth-child(3) { animation-delay: .17s; }
.template-card:nth-child(4) { animation-delay: .23s; }
.template-card:nth-child(5) { animation-delay: .29s; }
.template-card:nth-child(6) { animation-delay: .35s; }

/* ─── Responsivo extremo ─────────────────── */
@media (max-width: 399px) {
  .btn-sm { padding: 6px 10px; font-size: .72rem; }
  .modal-box { padding: 16px 14px; }
  .topbar { padding: 0 12px; }
  .main-content { padding: 16px 12px; }
  .auth-card { padding: 22px 16px; }
}

/* ─── iOS safe area ──────────────────────── */
@supports (padding: max(0px)) {
  .topbar { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .modal-box { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
  .toast     { bottom: max(28px, env(safe-area-inset-bottom)); }
}
