/* ============================================================
   TooltimeTT Minecraft Panel · V3
   1:1 mit tooltimett.de Design-Tokens
   Mobile-first, App-like
   ============================================================ */

:root {
  /* — Surfaces (matches tooltimett.de exactly) — */
  --bg:           #000000;
  --bg-card:      #0a0a0c;
  --bg-surface:   #121215;
  --bg-hover:     #1a1a1f;
  --bg-popover:   #121215;

  /* — Borders (translucent whites, like the parent site) — */
  --border:        rgba(255,255,255,0.06);
  --border-hover:  rgba(255,255,255,0.12);
  --border-strong: rgba(255,255,255,0.18);
  --border-soft:   rgba(255,255,255,0.04);
  --input-bd:      rgba(255,255,255,0.10);

  /* — Accent (TooltimeTT primary) — */
  --accent:        #c5fe00;
  --accent-hover:  #d9ff4d;
  --accent-deep:   #a8d900;
  --accent-darker: #4d6b0a;
  --accent-dim:    rgba(197,254,0,0.10);
  --accent-glow:   rgba(197,254,0,0.18);
  --accent-border: rgba(197,254,0,0.25);
  --ring:          rgba(197,254,0,0.5);

  /* — Backward compat aliases — */
  --neon:          #c5fe00;
  --neon-dim:      rgba(197,254,0,0.10);
  --neon-glow:     rgba(197,254,0,0.18);
  --neon-border:   rgba(197,254,0,0.25);
  --secondary:     #576c14;

  /* — Text scale — */
  --text-1: #fafafa;   /* foreground */
  --text-2: #a1a1aa;   /* zinc-400 (body) */
  --text-3: #71717a;   /* zinc-500 (muted/labels) */
  --text-4: #52525b;   /* zinc-600 (very muted) */

  /* — Radii (matches tooltimett.de) — */
  --r-sm:  6px;        /* buttons, small chips      */
  --r:     10px;       /* inputs, badges            */
  --r-md:  12px;       /* small cards               */
  --r-lg:  14px;       /* default cards             */
  --r-xl:  16px;       /* prominent cards           */

  /* — Motion — */
  --ease: 0.15s cubic-bezier(.4,0,.2,1);

  /* — Sidebar — */
  --sidebar-w: 220px;
}

/* ── Reset / base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; border-color: var(--border); }
*, *::before, *::after { --tw-border-opacity: 1; }
.divide-y > * + * { border-top-color: var(--border-soft) !important; }
.divide-x > * + * { border-left-color: var(--border-soft) !important; }

html, body { background: var(--bg); }
body {
  color: var(--text-2);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, h6, strong, b { color: var(--text-1); letter-spacing: -0.02em; }

::selection { background: rgba(197,254,0,.22); color: #000; }

/* ── Scrollbars ───────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

/* ── Focus ────────────────────────────────────────────────── */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
  border-radius: var(--r-sm);
}

/* ── Sidebar (desktop) ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #050507;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  padding: 1.125rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .625rem;
  text-decoration: none;
}
.sidebar-brand-logo {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
  transition: all var(--ease);
}
.sidebar-brand:hover .sidebar-brand-logo {
  border-color: var(--accent-border);
}
.sidebar-brand-logo img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 7px;
}
.sidebar-brand-text { line-height: 1.2; min-width: 0; }
.sidebar-brand-text strong {
  display: block;
  font-size: .875rem; font-weight: 700;
  color: var(--text-1); letter-spacing: -0.025em;
}
.sidebar-brand-text strong em { color: var(--accent); font-style: normal; }
.sidebar-brand-text span {
  font-size: 10.5px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .16em;
  font-weight: 500;
}

.sidebar-section { padding: .75rem .5rem; flex: 1; }
.sidebar-section-label {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--text-3);
  padding: 0 .625rem; margin: 1rem 0 .375rem;
}
.sidebar-section-label:first-child { margin-top: 0; }

.nav-link {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .625rem; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2); text-decoration: none;
  transition: all var(--ease);
  cursor: pointer; border: 1px solid transparent;
  margin-bottom: 1px;
}
.nav-link svg, .nav-link [data-lucide] { width: 15px; height: 15px; flex-shrink: 0; opacity: .65; stroke-width: 2; }
.nav-link:hover { background: rgba(255,255,255,0.04); color: var(--text-1); }
.nav-link:hover svg, .nav-link:hover [data-lucide] { opacity: 1; }
.nav-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent-border);
  font-weight: 600;
}
.nav-link.active svg, .nav-link.active [data-lucide] { opacity: 1; }

.sidebar-bottom { border-top: 1px solid var(--border); padding: .625rem .5rem; }

.sidebar-user {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .625rem; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  margin-bottom: .5rem;
}
.sidebar-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-email {
  font-size: 12px; color: var(--text-1); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10.5px; color: var(--text-3);
  text-transform: capitalize; letter-spacing: .02em;
}
.sidebar-actions { display: flex; gap: .25rem; }
.sidebar-icon-btn {
  width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--ease); text-decoration: none;
}
.sidebar-icon-btn:hover {
  background: var(--bg-hover); color: var(--text-1);
  border-color: var(--border-hover);
}
.sidebar-icon-btn [data-lucide] { width: 13px; height: 13px; }

.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  font-size: 11px; font-weight: 600;
  margin-bottom: .5rem;
  letter-spacing: .04em;
}
.lang-toggle a {
  flex: 1; padding: .35rem 0; text-align: center;
  color: var(--text-3); text-decoration: none;
  transition: all var(--ease);
}
.lang-toggle a:hover { color: var(--text-1); background: rgba(255,255,255,.04); }
.lang-toggle a.active { color: var(--accent); background: var(--accent-dim); }
.lang-toggle a + a { border-left: 1px solid var(--border); }

.sidebar-support {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .625rem; border-radius: 8px;
  font-size: 12px; color: var(--text-2); text-decoration: none;
  background: transparent; border: 1px solid var(--border);
  transition: all var(--ease); margin-bottom: .5rem;
}
.sidebar-support:hover {
  background: var(--bg-surface); color: var(--text-1);
  border-color: var(--border-hover);
}
.sidebar-support [data-lucide] { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Main area ────────────────────────────────────────────── */
.main-area {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}

/* Header: glass effect like tooltimett.de */
.main-header {
  background: rgba(0,0,0,0.70);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  height: 52px;
  display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
  padding-top: env(safe-area-inset-top, 0);
}
.main-header-title {
  font-size: .875rem; font-weight: 600;
  color: var(--text-1); letter-spacing: -0.015em;
}
.main-header-breadcrumb { font-size: .8125rem; color: var(--text-3); }
.main-header-breadcrumb a {
  color: var(--text-3); text-decoration: none;
  transition: color var(--ease);
}
.main-header-breadcrumb a:hover { color: var(--text-1); }

/* Server sub-nav */
.subnav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 0;
  padding: 0 1.25rem;
  overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav-link {
  display: flex; align-items: center; gap: .4rem;
  padding: .75rem .875rem;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-3); text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all var(--ease);
}
.subnav-link:hover { color: var(--text-1); }
.subnav-link.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.subnav-link [data-lucide] { width: 13px; height: 13px; }

/* ── Live status indicator (tooltimett.de signature) ──────── */
.dot-live {
  position: relative; display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(197,254,0,.18);
  flex-shrink: 0;
}
.dot-live::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0;
  animation: pulse-soft 2.4s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes pulse-soft {
  0%   { opacity: .8; transform: scale(.8); }
  100% { opacity: 0;  transform: scale(2.2); }
}
.dot-offline {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--text-4);
  flex-shrink: 0;
}

/* Status badge (pill) */
.status-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .625rem;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: .04em;
  border: 1px solid;
}
.status-online  {
  background: rgba(197,254,0,.06); color: var(--accent);
  border-color: rgba(197,254,0,.20);
}
.status-offline {
  background: rgba(255,255,255,.04); color: var(--text-3);
  border-color: var(--border);
}

/* ── Page content ─────────────────────────────────────────── */
.page-content { flex: 1; padding: 1.25rem; max-width: 100%; }
.container-tight { max-width: 1200px; margin-inline: auto; padding-inline: 1rem; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color var(--ease);
}
.card-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 13px; font-weight: 600;
  color: var(--text-1); flex: 1;
  letter-spacing: -0.01em;
}
.card-body { padding: 1.25rem; }

/* Eyebrow label (tooltimett.de signature) */
.eyebrow {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--text-3);
}

/* ── Stat cards ───────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.125rem 1.25rem;
  position: relative; overflow: hidden;
  transition: border-color var(--ease);
}
.stat-card:hover { border-color: var(--border-hover); }

/* ── Progress bars ────────────────────────────────────────── */
.prog-bar {
  height: 4px; background: rgba(255,255,255,.06);
  border-radius: 999px; overflow: hidden;
  margin-top: .75rem;
}
.prog-fill {
  height: 100%; border-radius: 999px;
  transition: width .6s ease;
  background: var(--accent);
}

/* ── Server list row ──────────────────────────────────────── */
.server-row {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  transition: background var(--ease);
}
.server-row:not(:last-child) { border-bottom: 1px solid var(--border-soft); }
.server-row:hover { background: rgba(255,255,255,.02); }
.server-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
  letter-spacing: -.02em;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  border: 1px solid;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-green, .badge-online  {
  background: rgba(197,254,0,.06); color: var(--accent);
  border-color: rgba(197,254,0,.20);
}
.badge-gray, .badge-offline {
  background: rgba(255,255,255,.03); color: var(--text-3);
  border-color: var(--border);
}
.badge-blue   { background: rgba(96,165,250,.08); color: #93c5fd; border-color: rgba(96,165,250,.2); }
.badge-yellow { background: rgba(251,191,36,.08); color: #fcd34d; border-color: rgba(251,191,36,.2); }
.badge-red    { background: rgba(239,68,68,.08);  color: #f87171; border-color: rgba(239,68,68,.2); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn, .neon-btn, .btn-secondary, .btn-ghost, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .425rem;
  height: 36px;
  padding: 0 .875rem;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: all var(--ease);
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .neon-btn:active, .btn-secondary:active, .btn-danger:active { transform: scale(.97); }
.btn:disabled, .neon-btn:disabled, .btn-secondary:disabled, .btn-danger:disabled {
  opacity: .4; cursor: not-allowed; transform: none !important;
}
.btn [data-lucide], .neon-btn [data-lucide], .btn-secondary [data-lucide],
.btn-danger [data-lucide], .btn-ghost [data-lucide] {
  width: 14px; height: 14px; flex-shrink: 0; stroke-width: 2;
}

.btn-primary, .neon-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.btn-primary:hover, .neon-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: rgba(255,255,255,.04);
  border-color: var(--border);
  color: var(--text-1);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.08);
  border-color: var(--border-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: rgba(255,255,255,.04);
  color: var(--text-1);
}

.btn-danger {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239,68,68,.14);
  border-color: rgba(239,68,68,.40);
}

.btn-sm { height: 30px; padding: 0 .625rem; font-size: 12px; }
.btn-lg { height: 44px; padding: 0 1.25rem; font-size: 14px; }

/* ── Power buttons (server controls) ──────────────────────── */
.power-btn {
  display: inline-flex; align-items: center; gap: .425rem;
  height: 38px;
  padding: 0 1rem;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  border: 1px solid;
  cursor: pointer;
  transition: all var(--ease);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.power-btn:active   { transform: scale(.97); }
.power-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.power-btn [data-lucide] { width: 14px; height: 14px; flex-shrink: 0; }

.power-start   { background: rgba(197,254,0,.08);  border-color: rgba(197,254,0,.30);  color: var(--accent); }
.power-start:hover:not(:disabled)   { background: rgba(197,254,0,.14); border-color: rgba(197,254,0,.50); }
.power-stop    { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.30);  color: #f87171; }
.power-stop:hover:not(:disabled)    { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.50); }
.power-restart { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.30); color: #fcd34d; }
.power-restart:hover:not(:disabled) { background: rgba(251,191,36,.14); border-color: rgba(251,191,36,.50); }
.power-kill    { background: rgba(100,116,139,.08); border-color: rgba(100,116,139,.30); color: #94a3b8; }
.power-kill:hover:not(:disabled)    { background: rgba(100,116,139,.14); border-color: rgba(100,116,139,.50); }

/* ── Inputs ───────────────────────────────────────────────── */
.input-field {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--input-bd);
  border-radius: var(--r-sm);
  padding: .55rem .875rem;
  font-size: 13px; color: var(--text-1);
  transition: all var(--ease);
  outline: none;
  font-family: inherit;
  width: 100%;
}
.input-field:hover { border-color: var(--border-hover); }
.input-field:focus {
  border-color: rgba(197,254,0,.45);
  box-shadow: 0 0 0 3px var(--ring);
  background: rgba(255,255,255,.05);
}
.input-field::placeholder { color: var(--text-4); }
.input-field[disabled] { opacity: .5; cursor: not-allowed; }

select.input-field { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 14px;
  padding-right: 2.25rem;
}

textarea.input-field { resize: vertical; min-height: 80px; line-height: 1.55; }

/* ── Console output ───────────────────────────────────────── */
.console-output {
  background: #050507;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px; line-height: 1.65;
}
.console-output > div, .console-output > span {
  padding: .5px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Action btns (icon-only) ──────────────────────────────── */
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.action-btn:hover {
  background: var(--bg-surface); color: var(--text-1);
  border-color: var(--border-hover);
}

.player-btn {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .375rem .75rem; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  border: 1px solid; cursor: pointer;
  transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.player-btn:active { transform: scale(.97); }

/* ── Wizard / Modpack cards ───────────────────────────────── */
.software-card input:checked + .software-card-inner {
  border-color: rgba(197,254,0,.5) !important;
  background: var(--accent-dim) !important;
}
.ram-option input:checked + .ram-inner {
  border-color: rgba(197,254,0,.5) !important;
  background: var(--accent-dim) !important;
}
.ram-option input[disabled] + .ram-inner { opacity: .3; cursor: not-allowed; }

.modpack-tab {
  background: transparent; border: 1px solid transparent;
  color: var(--text-3); transition: all var(--ease);
  cursor: pointer; font-family: inherit;
}
.modpack-tab:hover { color: var(--text-1); }
.tab-active {
  background: var(--accent-dim) !important;
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}

.modpack-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all var(--ease);
}
.modpack-card:hover {
  border-color: var(--accent-border);
  background: var(--bg-hover);
}

/* ── Login background ─────────────────────────────────────── */
.login-grid-bg, .grid-bg {
  background-image:
    linear-gradient(rgba(197,254,0,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(197,254,0,.012) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ── Compat ───────────────────────────────────────────────── */
#statusPill { font-size: 11px; }
tbody tr:last-child { border-bottom: none; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
thead th {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-3);
  text-align: left;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
tbody tr:hover { background: rgba(255,255,255,.015); }

/* ── Quick-link cards (server dashboard) ──────────────────── */
.quick-link-card {
  display: flex; flex-direction: column; gap: .25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.125rem 1.25rem;
  text-decoration: none;
  transition: all var(--ease);
}
.quick-link-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface);
  transform: translateY(-1px);
}

/* ── File-list action buttons ─────────────────────────────── */
.file-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-3); cursor: pointer; transition: all var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.file-action-btn:hover {
  background: var(--bg-hover); color: var(--text-1);
  border-color: var(--border-hover);
}
.file-action-btn.file-action-danger:hover {
  color: #f87171; border-color: rgba(239,68,68,.3);
  background: rgba(239,68,68,.06);
}

/* ── Lucide icon defaults ─────────────────────────────────── */
[data-lucide] { stroke-width: 2; vertical-align: middle; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * { animation: fadeUp .25s ease both; }
.page-content > *:nth-child(2) { animation-delay: .04s; }
.page-content > *:nth-child(3) { animation-delay: .08s; }
.page-content > *:nth-child(4) { animation-delay: .12s; }

@keyframes neonGlow {
  0%, 100% { box-shadow: 0 0 6px var(--accent), 0 0 12px var(--accent); }
  50%      { box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(197,254,0,.4); }
}
.glow-pulse { animation: neonGlow 2s ease-in-out infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(197,254,0,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.btn-loading { opacity: .7; cursor: wait; pointer-events: none; }

@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    rgba(255,255,255,.02) 25%,
    rgba(255,255,255,.06) 50%,
    rgba(255,255,255,.02) 75%
  );
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  color: transparent; user-select: none;
}
#pageLoader { transition: width .25s cubic-bezier(.4,0,.2,1); }

/* ── Mobile bottom nav ────────────────────────────────────── */
#mobileNav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow-x: auto;
  scrollbar-width: none;
  flex-direction: row;
  align-items: stretch;
  height: calc(58px + env(safe-area-inset-bottom, 0));
}
#mobileNav::-webkit-scrollbar { display: none; }
#mobileNav a, #mobileNav button {
  flex: 0 0 auto; min-width: 64px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; padding: 8px 10px;
  font-size: 10px; font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-3); text-decoration: none;
  border: none; background: transparent;
  cursor: pointer;
  transition: color var(--ease);
  white-space: nowrap;
  border-top: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.mnav-icon {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
}
.mnav-icon [data-lucide] { width: 20px; height: 20px; stroke-width: 2; }
#mobileNav a.active {
  color: var(--accent);
  border-top-color: var(--accent);
  background: rgba(197,254,0,.04);
}
#mobileNav a:active { background: rgba(197,254,0,.08); }

/* ── Mobile bottom-sheet modal ────────────────────────────── */
.mobile-sheet {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(8px);
  display: flex; align-items: flex-end;
  justify-content: center;
}
.mobile-sheet-content {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 1.25rem;
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0));
  animation: sheetUp .25s cubic-bezier(.4,0,.2,1);
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 767px) {
  body { display: block; }
  nav.sidebar { display: none !important; }
  .main-area { width: 100%; }
  #mobileNav { display: flex !important; }

  /* Header tweaks */
  .main-header { height: 50px; padding: 0 1rem; padding-top: env(safe-area-inset-top, 0); }
  .main-header-title, .main-header-breadcrumb { font-size: 13px; }

  /* Sub-nav: compact, only icons + active label */
  .subnav { padding: 0 .5rem; }
  .subnav-link { padding: .65rem .625rem; font-size: 12px; }

  /* Page content: bottom-pad for mobile nav, no horizontal padding waste */
  .page-content {
    padding: .875rem;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0));
  }

  /* Touch-friendly */
  .btn, .neon-btn, .btn-secondary, .btn-danger, .btn-ghost,
  .power-btn { min-height: 44px; height: auto; padding: .55rem 1rem; }
  .action-btn, .file-action-btn { width: 36px; height: 36px; }
  .player-btn { min-height: 36px; padding: .4rem .875rem; }

  /* Tailwind .fixed.inset-0 modals — convert to bottom sheet on mobile.
     Two structures exist:
     1) Simple modals: .fixed.inset-0 > [content]
     2) Scrollable wrapped modals (wizard/import): .fixed.inset-0 > [flex wrapper with min-height] > [content]
     We detect (2) by the inline min-height style on the wrapper. */
  .fixed.inset-0:not(.pointer-events-none) {
    align-items: flex-end !important;
  }
  .fixed.inset-0:not(.pointer-events-none) > div[style*="min-height"] {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  /* Content card — covers both structures */
  .fixed.inset-0:not(.pointer-events-none) > div:not(#pageLoader):not(.pointer-events-none):not([style*="min-height"]),
  .fixed.inset-0:not(.pointer-events-none) > div[style*="min-height"] > div {
    border-radius: 18px 18px 0 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    animation: sheetUp .25s cubic-bezier(.4,0,.2,1);
  }

  /* Console: smaller font, no rounded corners that waste space */
  .console-output { font-size: 11.5px !important; border-radius: var(--r-md); }

  /* Grids: collapse to 2 columns max */
  .grid.grid-cols-3, .grid.grid-cols-4, .grid.grid-cols-5 { grid-template-columns: 1fr 1fr !important; }
  .grid.lg\:grid-cols-5 { grid-template-columns: 1fr 1fr !important; }

  /* Prevent iOS zoom on focus */
  input, select, textarea { font-size: 16px !important; }

  /* Make tables horizontally scrollable in a controlled way */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  thead th, tbody td { padding: .625rem .75rem; }

  /* Sub-nav is replaced by bottom nav on mobile */
  nav.subnav { display: none !important; }

  /* Stat-card tighter */
  .stat-card { padding: .875rem 1rem; }

  /* Card tighter */
  .card-header { padding: .75rem 1rem; }
  .card-body { padding: 1rem; }

  /* Server row tighter */
  .server-row { padding: .875rem 1rem; gap: .75rem; }
  .server-icon { width: 34px; height: 34px; }

  /* Quick-link card tighter */
  .quick-link-card { padding: .875rem 1rem; }
}

@media (max-width: 480px) {
  .page-content { padding: .75rem; padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)); }
  .grid.sm\:grid-cols-3 { grid-template-columns: 1fr 1fr !important; }
}

@media (min-width: 768px) {
  #mobileNav { display: none !important; }
}

/* ── PWA / iOS standalone ─────────────────────────────────── */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top, 0); }
}

/* ── Misc utilities ───────────────────────────────────────── */
.no-scroll { overflow: hidden !important; }
.text-mono { font-family: 'JetBrains Mono', 'Fira Code', monospace; letter-spacing: 0; }
.dim { color: var(--text-3); }
