/* ═══════════════════════════════════════════
   ConvyPanel — Premium Game Server Panel UI
   ═══════════════════════════════════════════ */
:root {
  --bg:         #060A14;
  --sidebar:    #080C18;
  --card:       #0C1422;
  --card2:      #101B2E;
  --border:     #172035;
  --border2:    #1F2D48;
  --text:       #E2EAF8;
  --dim:        #3D5070;
  --dim2:       #5E7496;
  --cyan:       #22D3EE;
  --accent:     #22D3EE;
  --accent-glow:rgba(34,211,238,.3);
  --mc:         #22C55E;
  --mc-dim:     rgba(34,197,94,.12);
  --mc-glow:    rgba(34,197,94,.3);
  --fivem:      #3B82F6;
  --fivem-dim:  rgba(59,130,246,.12);
  --fivem-glow: rgba(59,130,246,.3);
  --green:      #10B981;
  --yellow:     #F59E0B;
  --red:        #EF4444;
  --sidebar-w:  230px;
  --radius:     12px;
  --radius-lg:  16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
.mono { font-family: 'JetBrains Mono', monospace; }
.dim { color: var(--dim2); }
.small { font-size: 12px; }

/* ── App shell ── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ═══════════════ SIDEBAR ═══════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  overflow: hidden;
}

.sidebar-brand {
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

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

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #22D3EE, #0EA5E9);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(99,102,241,.4);
}

.brand-icon svg { width: 20px; height: 20px; }

.brand-name {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: .08em;
  background: linear-gradient(135deg, #22D3EE, #38BDF8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 10px 10px 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--dim2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  cursor: pointer;
}

.nav-link svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.nav-link.active { background: rgba(34,211,238,.1); color: #22D3EE; }

.sidebar-sep { height: 1px; background: var(--border); margin: 8px 10px; }

/* Sidebar user area — relative container for dropdown */
.sidebar-user-wrap {
  padding: 12px 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 4px;
  border-radius: 9px;
  transition: background .12s;
}

.user-row:hover { background: rgba(255,255,255,.05); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #3B82F6);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: var(--dim2); }
.user-chevron { color: var(--dim); font-size: 12px; flex-shrink: 0; }

/* User dropdown */
.user-dropdown {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 10px; right: 10px;
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
  z-index: 200;
  display: none;
  overflow: hidden;
}

.user-dropdown.open { display: block; }

.ud-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}

.ud-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #3B82F6);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  overflow: hidden;
  flex-shrink: 0;
}

.ud-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ud-name { font-size: 13px; font-weight: 700; }
.ud-username { font-size: 11px; color: var(--dim2); }
.ud-role-badge { font-size: 10px; font-weight: 700; background: rgba(99,102,241,.2); color: #A5B4FC; padding: 1px 7px; border-radius: 4px; display: inline-block; margin-top: 2px; }

.ud-items { padding: 6px; }

.ud-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--dim2);
  cursor: pointer;
  transition: background .12s, color .12s;
}

.ud-item:hover { background: rgba(255,255,255,.05); color: var(--text); }
.ud-item-danger { color: #F87171; }
.ud-item-danger:hover { background: rgba(239,68,68,.1); color: var(--red); }
.ud-ico { font-size: 15px; }
.ud-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ═══════════════ MAIN CONTENT ═══════════════ */
.app-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

.page {
  padding: 32px 40px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
}

.btn:disabled { opacity: .45; cursor: default; }

.btn-primary {
  background: linear-gradient(135deg, #22D3EE, #0EA5E9);
  color: #000;
  font-weight: 700;
  box-shadow: 0 2px 20px rgba(34,211,238,.3);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #38E8FF, #22D3EE);
  box-shadow: 0 4px 28px rgba(34,211,238,.5);
  transform: translateY(-1px);
}

.btn-mc {
  background: linear-gradient(135deg, #16A34A, #15803D);
  color: white;
  box-shadow: 0 2px 16px var(--mc-glow);
}
.btn-mc:hover:not(:disabled) {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  box-shadow: 0 4px 24px rgba(34,197,94,.45);
  transform: translateY(-1px);
}

.btn-fivem {
  background: linear-gradient(135deg, #2563EB, #1D4ED8);
  color: white;
  box-shadow: 0 2px 16px var(--fivem-glow);
}
.btn-fivem:hover:not(:disabled) {
  background: linear-gradient(135deg, #3B82F6, #2563EB);
  box-shadow: 0 4px 24px rgba(59,130,246,.45);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--dim2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,.05); color: var(--text); }

.btn-green { background: rgba(16,185,129,.2); color: #10B981; border: 1px solid rgba(16,185,129,.3); }
.btn-green:hover:not(:disabled) { background: rgba(16,185,129,.3); }
.btn-yellow { background: rgba(245,158,11,.15); color: #F59E0B; border: 1px solid rgba(245,158,11,.3); }
.btn-yellow:hover:not(:disabled) { background: rgba(245,158,11,.25); }
.btn-red { background: rgba(239,68,68,.15); color: var(--red); border: 1px solid rgba(239,68,68,.3); }
.btn-red:hover:not(:disabled) { background: rgba(239,68,68,.25); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover:not(:disabled) { background: #DC2626; transform: translateY(-1px); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ═══════════════ CARDS ═══════════════ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

/* ═══════════════ PAGE HEADER ═══════════════ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -.01em;
}

.create-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════ DASHBOARD ═══════════════ */

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.stat-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dim2);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
  margin-bottom: 10px;
}

.stat-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}

.stat-bar-fill.cpu { background: linear-gradient(90deg, #6366F1, #818CF8); }
.stat-bar-fill.ram { background: linear-gradient(90deg, #3B82F6, #60A5FA); }
.stat-sub { font-size: 12px; color: var(--dim2); }

/* Game Library */
.library-section { margin-bottom: 36px; }

.section-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--dim2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.game-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.game-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  min-height: 180px;
  position: relative;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
}

.game-card-mc {
  background: linear-gradient(155deg, #031A0D 0%, #073D1B 45%, #0F5C29 100%);
  border-color: rgba(34,197,94,.18);
}
.game-card-mc:hover { border-color: rgba(34,197,94,.5); box-shadow: 0 16px 48px rgba(34,197,94,.12); }

.game-card-fivem {
  background: linear-gradient(155deg, #040E1F 0%, #0A1E40 45%, #102D5E 100%);
  border-color: rgba(59,130,246,.18);
}
.game-card-fivem:hover { border-color: rgba(59,130,246,.5); box-shadow: 0 16px 48px rgba(59,130,246,.12); }

.game-card-soon {
  background: var(--card);
  border-style: dashed;
  opacity: .55;
  cursor: default;
}
.game-card-soon:hover { transform: none; box-shadow: none; }

.game-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.game-card-icon {
  font-size: 38px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.6));
}

.game-card-name {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 5px;
  letter-spacing: -.01em;
}

.game-card-desc {
  font-size: 12.5px;
  color: rgba(255,255,255,.5);
  margin-bottom: 18px;
  flex: 1;
  line-height: 1.55;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.game-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.1);
}

/* Server sections */
.servers-section { margin-bottom: 32px; }

.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.section-game-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: .04em;
}

.badge-mc { background: var(--mc-dim); color: var(--mc); border: 1px solid rgba(34,197,94,.25); }
.badge-fivem { background: var(--fivem-dim); color: var(--fivem); border: 1px solid rgba(59,130,246,.25); }
.section-count { font-size: 12px; color: var(--dim2); }

/* Server grid */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.server-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  position: relative;
  overflow: hidden;
}

.server-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity .2s;
}

.server-card.mc-card::before { background: linear-gradient(90deg, var(--mc), transparent 60%); }
.server-card.fivem-card::before { background: linear-gradient(90deg, var(--fivem), transparent 60%); }

.server-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(0,0,0,.4); }
.server-card:hover::before { opacity: 1; }

.server-card-header { display: flex; align-items: center; gap: 10px; }

.srv-type-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .05em;
  flex-shrink: 0;
}

.srv-pill-mc { background: var(--mc-dim); color: var(--mc); border: 1px solid rgba(34,197,94,.2); }
.srv-pill-fivem { background: var(--fivem-dim); color: var(--fivem); border: 1px solid rgba(59,130,246,.2); }

.server-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}

.badge.status-running, .badge.status-online { background: rgba(16,185,129,.12); color: #34D399; border: 1px solid rgba(16,185,129,.25); }
.badge.status-stopped, .badge.status-offline { background: rgba(71,85,105,.15); color: #64748B; border: 1px solid rgba(71,85,105,.2); }
.badge.status-starting { background: rgba(245,158,11,.12); color: #FBBF24; border: 1px solid rgba(245,158,11,.25); }

.status-running .status-dot, .status-dot.running { animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.srv-type-badge { font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 5px; }
.srv-type-badge.mc { background: var(--mc-dim); color: var(--mc); }
.srv-type-badge.fivem { background: var(--fivem-dim); color: var(--fivem); }

.server-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.server-meta div { font-size: 12px; color: var(--dim2); }
.server-meta div b { color: var(--text); font-weight: 600; }

.storage-bar { height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; }
.storage-fill { height: 100%; background: linear-gradient(90deg, #22C55E, #16A34A); border-radius: 99px; transition: width .5s; }
.storage-fill.fivem-fill { background: linear-gradient(90deg, #3B82F6, #2563EB); }
.storage-fill.warn { background: linear-gradient(90deg, #F59E0B, #EF4444); }

/* RAM card */
.ram-card { margin-bottom: 0; }
.ram-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.ram-head h3 { font-size: 14px; font-weight: 700; }
.ram-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.ram-stats span { font-size: 12px; color: var(--dim2); }
.ram-stats span b { color: var(--text); }

.ram-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; display: flex; margin-bottom: 10px; }
.ram-seg { height: 100%; transition: width .5s; }
.ram-seg.reserved { background: #2D3748; }
.ram-seg.allocated { background: linear-gradient(90deg, #22C55E, #16A34A); }

.ram-legend { display: flex; gap: 16px; }
.ram-legend span { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.reserved { background: #2D3748; }
.dot.allocated { background: #22C55E; }
.dot.free { background: var(--border2); }

/* Empty */
.empty { text-align: center; padding: 64px 20px; }
.empty-icon { font-size: 52px; margin-bottom: 16px; }
.empty h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.empty p { color: var(--dim2); font-size: 14px; margin-bottom: 24px; line-height: 1.7; }
.empty-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════ FORMS ═══════════════ */
.form-page { max-width: 680px; }
.form { display: flex; flex-direction: column; gap: 20px; }
.form label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; }
.form label .dim { font-weight: 400; font-size: 12px; }

.form input[type=text],.form input[type=number],.form input[type=password],
.form input[type=email],.form select,.form textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}

.form input:focus,.form select:focus,.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}

.form input[type=range] { width: 100%; accent-color: var(--accent); border: none; background: none; padding: 0; }
.slider-val { font-size: 13px; color: var(--dim2); }
.slider-val b { color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.auto-info {
  display: flex; align-items: center; gap: 10px;
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.2);
  border-radius: 10px;
  padding: 12px 16px;
}

.auto-pill {
  background: rgba(99,102,241,.2);
  color: #A5B4FC;
  font-size: 12px; font-weight: 700;
  padding: 3px 10px; border-radius: 6px;
  white-space: nowrap;
}

/* ═══════════════ ALERTS ═══════════════ */
.alert { padding: 12px 16px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); color: #FCA5A5; }
.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.25); color: #6EE7B7; }
.alert-info { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.25); color: #93C5FD; }

/* ═══════════════ SERVER DETAIL ═══════════════ */
.server-page { max-width: 100%; }

.server-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.back-link { font-size: 12.5px; color: var(--dim2); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; transition: color .15s; }
.back-link:hover { color: var(--accent); }

.connect-info {
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.connect-info h3 { font-size: 13px; font-weight: 600; color: var(--dim2); }
.connect-addr {
  background: var(--card2); border: 1px solid var(--border2); border-radius: 8px;
  padding: 6px 14px; font-size: 14px; font-family: 'JetBrains Mono', monospace; color: #60A5FA;
}

.power-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Tabs */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; gap: 2px; }
.tab {
  padding: 9px 18px 11px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--dim2); font-size: 13.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: color .15s, border-color .15s;
  position: relative; bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Console */
.console-card { padding: 0; overflow: hidden; }
.console-output {
  height: 460px; overflow-y: auto;
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.75;
  background: #03050E; color: #7B92B0;
  white-space: pre-wrap; word-break: break-all;
}
.console-output::-webkit-scrollbar { width: 6px; }
.console-output::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
.console-line { display: block; }
.log-error { color: #F87171; }
.log-warn { color: #FCD34D; }
.log-info { color: #60A5FA; }
.log-success { color: #34D399; }

.console-input {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-top: 1px solid var(--border); background: #060A15;
}
.console-prompt { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 700; flex-shrink: 0; }
.console-input input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 12.5px; }

/* File manager */
.file-manager { padding: 0; overflow: hidden; }
.file-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); background: var(--card2); flex-wrap: wrap; gap: 8px; }
.breadcrumbs { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 13px; }
.breadcrumb-sep { color: var(--dim); }
.breadcrumb-item { color: var(--dim2); cursor: pointer; transition: color .12s; }
.breadcrumb-item:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text); }
.file-actions { display: flex; gap: 6px; }
.file-list {}
.file-entry { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.file-entry:last-child { border-bottom: none; }
.file-entry:hover { background: rgba(255,255,255,.03); }
.file-icon { font-size: 17px; flex-shrink: 0; }
.file-name { flex: 1; font-size: 13.5px; }
.file-size { font-size: 12px; color: var(--dim2); }
.file-editor { margin-top: 14px; padding: 0; overflow: hidden; }
.editor-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--card2); }
.editor-filename { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--dim2); }
.editor-actions { display: flex; gap: 8px; }
.editor-textarea { width: 100%; height: 360px; background: #03050E; border: none; outline: none; padding: 14px 18px; font-family: 'JetBrains Mono', monospace; font-size: 12.5px; line-height: 1.7; color: #7B92B0; resize: vertical; }

/* Info table */
.info-table { width: 100%; border-collapse: collapse; }
.info-table tr:nth-child(even) { background: rgba(255,255,255,.02); }
.info-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.info-table tr:last-child td { border-bottom: none; }
.info-table td:first-child { color: var(--dim2); width: 200px; font-weight: 500; }

/* ═══════════════ AUTH ═══════════════ */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 420px; box-shadow: 0 24px 60px rgba(0,0,0,.5); }
.auth-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth-logo-icon { width: 42px; height: 42px; background: linear-gradient(135deg, #6366F1, #3B82F6); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; box-shadow: 0 0 24px rgba(99,102,241,.4); }
.auth-logo-text { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.auth-card h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-card p { color: var(--dim2); font-size: 13.5px; margin-bottom: 28px; }
.auth-card .form { gap: 16px; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--dim2); }
.auth-footer a { color: var(--accent); }
.auth-footer a:hover { text-decoration: underline; }

/* ═══════════════ ADMIN / ACCOUNT ═══════════════ */
.admin-page,.account-page { max-width: 900px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim2); border-bottom: 1px solid var(--border); font-weight: 600; }
.data-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,.02); }

/* ═══════════════ FIVEM FORM EXTRAS ═══════════════ */
.fivem-logo { background: linear-gradient(135deg, #3B82F6, #1D4ED8); color: white; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 5px; }
.fivem-info-banner { display: flex; align-items: flex-start; gap: 12px; background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.2); border-radius: 10px; padding: 14px; font-size: 13px; line-height: 1.6; }
.fivem-info-banner.warn { background: rgba(245,158,11,.07); border-color: rgba(245,158,11,.2); }
.fivem-info-ico { font-size: 20px; flex-shrink: 0; }
.create-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 4px; }
.create-tab { flex: 1; padding: 8px; background: none; border: none; border-radius: 7px; color: var(--dim2); font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s; }
.create-tab:hover { color: var(--text); }
.create-tab.active { background: var(--card2); color: var(--text); }
.create-panel.hidden { display: none; }
.port-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.port-item { background: var(--card2); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 16px; flex: 1; min-width: 140px; }
.port-label { font-size: 11px; color: var(--dim2); margin-bottom: 4px; display: block; }
.port-item code { font-size: 16px; font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--accent); }
.db-section { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.db-toggle { width: 100%; padding: 12px 16px; background: var(--card2); border: none; text-align: left; color: var(--text); font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.db-fields { padding: 16px; display: flex; flex-direction: column; gap: 14px; border-top: 1px solid var(--border); }
.db-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.db-info-row { font-size: 12.5px; color: var(--dim2); background: rgba(255,255,255,.03); padding: 10px; border-radius: 8px; line-height: 1.6; }
.file-drop { position: relative; border: 2px dashed var(--border2); border-radius: 10px; cursor: pointer; transition: border-color .15s; }
.file-drop:hover { border-color: var(--accent); }
.file-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop-inner { padding: 28px; text-align: center; color: var(--dim2); }
.file-drop-ico { font-size: 28px; margin-bottom: 8px; }
.import-progress { display: flex; flex-direction: column; gap: 8px; }
.progress-bar { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #6366F1, #3B82F6); border-radius: 99px; transition: width .3s; width: 0%; }
.hidden { display: none !important; }
.link-subtle { font-size: 12px; color: var(--accent); font-weight: 400; }
.link-subtle:hover { text-decoration: underline; }
.desktop-badge { font-size: 11px; font-weight: 600; color: #A78BFA; background: rgba(124,58,237,.15); border: 1px solid rgba(124,58,237,.25); border-radius: 6px; padding: 3px 9px; display: inline-flex; align-items: center; gap: 5px; }
.desktop-card { border-color: rgba(124,58,237,.2) !important; }
.desktop-card::before { background: linear-gradient(90deg, #7C3AED, transparent 60%) !important; }
.tag-import { font-size: 10px; font-weight: 600; background: rgba(245,158,11,.1); color: #FBBF24; border: 1px solid rgba(245,158,11,.2); padding: 2px 7px; border-radius: 5px; }
.count-pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--dim2); }

/* ═══════════════ SCROLLBAR ═══════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ── Server detail: nieuwe tabs (back-ups, database, remote access) ── */
:root { --line: var(--border); --text-dim: var(--dim2); }

.tab-badge {
  display:inline-block; min-width:16px; padding:0 5px; margin-left:4px;
  font-size:10px; font-weight:700; line-height:16px; text-align:center;
  border-radius:8px; background:var(--cyan); color:#04121a;
}

/* Back-ups */
.backups-list { display:flex; flex-direction:column; gap:8px; }
.backup-row {
  display:flex; align-items:center; gap:12px; padding:12px 14px;
  background:var(--card2); border:1px solid var(--border); border-radius:10px;
}
.backup-ico { font-size:22px; }
.backup-info { flex:1; min-width:0; }
.backup-name { font-weight:600; color:var(--text); }
.backup-actions { display:flex; gap:6px; flex-wrap:wrap; }

/* Sub-users / Remote Access */
.subuser-row {
  display:flex; align-items:center; gap:12px; padding:12px 14px; margin-bottom:8px;
  background:var(--card2); border:1px solid var(--border); border-radius:10px;
}
.subuser-ava { font-size:20px; }
.subuser-info { flex:1; min-width:0; }
.subuser-name { font-weight:600; color:var(--text); margin-bottom:4px; }
.perm-pills { display:flex; flex-wrap:wrap; gap:5px; }
.perm-pill {
  font-size:10.5px; font-weight:600; padding:2px 8px; border-radius:6px;
  background:rgba(34,211,238,.1); border:1px solid rgba(34,211,238,.2); color:var(--cyan);
}
.subuser-form .perm-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr));
  gap:8px; margin-top:8px;
}
.perm-check {
  display:flex; align-items:center; gap:8px; padding:9px 11px;
  background:var(--card2); border:1px solid var(--border); border-radius:8px;
  cursor:pointer; font-size:13px;
}
.perm-check input { accent-color:var(--cyan); width:16px; height:16px; }
.perm-check:hover { border-color:var(--border2); }
.btn-xs.danger { color:var(--red); }

/* ═══════════ Server detail: nette file-manager + editors (juiste klassen) ═══════════ */
.file-manager, .file-editor { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.file-list { max-height: 540px; overflow-y: auto; }
.file-row {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.file-row:last-child { border-bottom: none; }
.file-row:hover { background: rgba(255,255,255,.04); }
.file-row .ico { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.file-row .name { flex: 1 1 auto; font-size: 13.5px; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size { font-size: 12px; color: var(--dim2); width: 84px; text-align: right; flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }
.file-row .mtime { font-size: 12px; color: var(--dim); width: 140px; text-align: right; flex-shrink: 0; }
.file-row .actions { display: flex; gap: 5px; flex-shrink: 0; justify-content: flex-end; }
.file-row .actions button { background: var(--card2); border: 1px solid var(--border); color: var(--dim2); border-radius: 7px; padding: 4px 9px; font-size: 12.5px; cursor: pointer; line-height: 1; transition: .12s; }
.file-row .actions button:hover { border-color: var(--accent); color: var(--text); }
@media (max-width: 700px) { .file-row .mtime { display: none; } }

/* breadcrumb crumbs (server.js) */
.breadcrumbs .crumb, .crumb { color: var(--dim2); cursor: pointer; transition: color .12s; }
.breadcrumbs .crumb:hover, .crumb:hover { color: var(--accent); }

/* quick-nav balk (FiveM files) */
.fivem-quicknav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.02); }

/* server.cfg + bestand-editor textareas */
.config-head, .editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.config-head h3 { margin: 0; }
.editor-head { padding: 12px 16px; margin: 0; border-bottom: 1px solid var(--border); background: var(--card2); }
.cfg-editor, #editorArea, #cfgArea {
  display: block; width: 100%; min-height: 520px; resize: vertical;
  background: #03050E; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin: 0;
  color: #cdd9ee; font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 13px; line-height: 1.75; outline: none; tab-size: 4;
}
#editorArea { border-radius: 0; border: none; min-height: 460px; }
.cfg-editor:focus, #cfgArea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34,211,238,.12); }
.file-editor textarea { width: 100%; }

/* back-ups / subusers rijen netter op de website */
.backups-list .backup-row, .subuser-row { background: var(--card2); }

/* ═══════════ Console: stat-zijbalk + live grafieken ═══════════ */
.console-layout { display: grid; grid-template-columns: 1fr 250px; gap: 16px; align-items: start; }
@media (max-width: 920px) { .console-layout { grid-template-columns: 1fr; } }
.console-main { min-width: 0; }
.stat-sidebar { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 6px; }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 11px 10px; border-radius: 10px; transition: background .12s; }
.stat-row:hover { background: rgba(255,255,255,.035); }
.stat-row + .stat-row { border-top: 1px solid var(--border); }
.stat-ico { font-size: 16px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--card2); border: 1px solid var(--border); border-radius: 9px; flex-shrink: 0; }
.stat-meta { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: 11px; color: var(--dim2); }
.stat-val { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
@media (max-width: 920px) { .stat-charts { grid-template-columns: 1fr; } }
.chart-card { padding: 14px 16px 10px; }
.chart-head { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--dim2); margin-bottom: 8px; }
.chart-now { font-size: 13px; font-weight: 700; color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.chart-card canvas { width: 100%; display: block; }

/* Upload-voortgangsbalk (drijvend) */
#uploadBar { position: fixed; bottom: 22px; right: 22px; width: 330px; background: var(--card); border: 1px solid var(--border2); border-radius: 12px; padding: 13px 15px; box-shadow: 0 16px 48px rgba(0,0,0,.55); z-index: 9999; display: none; }
#uploadBar .ub-label { font-size: 12.5px; color: var(--text); margin-bottom: 9px; font-weight: 600; }
#uploadBar .ub-track { height: 7px; background: var(--border); border-radius: 99px; overflow: hidden; }
#uploadBar .ub-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#22d3ee,#3b82f6); border-radius: 99px; transition: width .2s; }
