/* ============================================================
   MoonServ — Panel Interior CSS v3
   ============================================================ */

/* ---- TOP NAV ---- */
.panel-topnav {
  position:fixed; top:0; left:0; right:0; z-index:100;
  background:rgba(10,15,30,.9); backdrop-filter:blur(24px) saturate(1.4);
  border-bottom:1px solid var(--bdr); height:64px;
}
.topnav-inner {
  max-width:1400px; margin:0 auto; padding:0 20px;
  display:flex; align-items:center; height:100%; gap:16px;
}
.topnav-brand {
  display:flex; align-items:center; gap:8px; text-decoration:none;
  color:var(--tx); font-weight:800; font-size:16px; margin-right:20px;
}
.topnav-links { display:flex; gap:6px; flex:1; }
.topnav-links > a, .topnav-dropdown > a {
  color:var(--tx2); font-size:14px; font-weight:600;
  padding:10px 18px; border-radius:var(--r);
  transition:all .2s; text-decoration:none;
  display:inline-flex; align-items:center; gap:8px;
}
.topnav-links > a:hover, .topnav-dropdown > a:hover { background:rgba(255,255,255,.06); color:var(--tx); }
.topnav-links > a.active, .topnav-dropdown > a.active { background:var(--acbg); color:var(--ac2); }

/* ---- DROPDOWN (click-based) ---- */
.topnav-dropdown { position:relative; }
.topnav-dropdown .dropdown-menu {
  display:none; position:absolute; top:calc(100% + 6px); left:0;
  min-width:200px;
  background:linear-gradient(145deg, #141c30, #1a2440);
  border:1px solid var(--bdr2); border-radius:var(--r);
  box-shadow:0 12px 40px rgba(0,0,0,.5);
  padding:8px; z-index:500;
}
.topnav-dropdown.open .dropdown-menu { display:block; animation:slideDown .2s ease; }
.dropdown-right { left:auto; right:0; }
.dropdown-menu a, .dropdown-btn {
  display:flex; align-items:center; gap:10px;
  width:100%; text-align:left; padding:10px 14px;
  color:var(--tx2); font-size:13px; font-weight:500;
  border-radius:8px; transition:.2s; text-decoration:none;
  background:none; border:none; cursor:pointer; font-family:var(--font);
  line-height:1.4;
}
.dropdown-menu a:hover, .dropdown-btn:hover { background:rgba(255,255,255,.06); color:var(--tx); }
.dropdown-header {
  padding:10px 14px; font-weight:700; font-size:14px;
  color:var(--tx); border-bottom:1px solid var(--bdr); margin-bottom:4px;
}
.dropdown-divider { height:1px; background:var(--bdr); margin:4px 0; }
.dropdown-btn-logout { color:var(--rd) !important; }
.dropdown-btn-logout:hover { background:var(--rdbg) !important; color:var(--rd) !important; }
.logout-form { margin:0; padding:0; }

.topnav-user { display:flex; align-items:center; gap:14px; margin-left:auto; }
.topnav-balance {
  font-family:var(--mono); font-size:14px; font-weight:700; color:var(--gr);
  padding:8px 16px; border-radius:10px;
  border:1px solid rgba(16,185,129,.25);
  background:rgba(16,185,129,.06);
  display:flex; align-items:center; gap:6px;
  transition:.2s;
}
.topnav-balance:hover {
  border-color:rgba(16,185,129,.4);
  background:rgba(16,185,129,.1);
  text-decoration:none;
}
a.topnav-balance { text-decoration:none; color:var(--gr); }
.topnav-avatar {
  width:38px; height:38px; border-radius:50% !important;
  background:linear-gradient(135deg, var(--ac), #7c3aed);
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:15px; color:#fff; text-decoration:none;
  cursor:pointer; transition:.2s; flex-shrink:0;
  aspect-ratio:1/1;
}
.topnav-avatar:hover { transform:scale(1.08); }
.mobile-toggle { display:none; background:none; border:none; color:var(--tx); cursor:pointer; line-height:0; }

@media(max-width:900px) {
  .mobile-toggle { display:block; }
  .topnav-links { display:none; }
  .topnav-links.open {
    display:flex; flex-direction:column; position:absolute;
    top:56px; left:0; right:0; background:var(--card);
    border-bottom:1px solid var(--bdr); padding:12px; z-index:100;
  }
  .topnav-dropdown .dropdown-menu { position:static; box-shadow:none; border:none; margin-top:0; }
}

/* ---- PANEL MAIN ---- */
.panel-layout { min-height:100vh; }
.panel-main { padding:78px 24px 24px; max-width:1400px; margin:0 auto; }
.panel-container { min-height:60vh; }

/* ---- PAGE HEADER ---- */
.page-header { margin-bottom:24px; display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.page-title { font-size:24px; font-weight:800; letter-spacing:-0.5px; }
.page-subtitle { font-size:14px; color:var(--tx2); margin-top:4px; }
.breadcrumb { font-size:13px; color:var(--tx3); }
.breadcrumb a { color:var(--tx2); }

/* ---- STATS ---- */
.stats-row { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:16px; margin-bottom:24px; }
.stat-card {
  background:linear-gradient(145deg, #111827, #161e30);
  border:1px solid var(--bdr); border-radius:var(--rl); padding:20px;
}
.stat-card-label { font-size:12px; color:var(--tx3); text-transform:uppercase; letter-spacing:1px; margin-bottom:6px; }
.stat-card-value { font-size:26px; font-weight:800; font-family:var(--mono); }
.stat-card-value.green { color:var(--gr); }
.stat-card-value.red { color:var(--rd); }
.stat-card-value.accent { color:var(--ac2); }

/* ---- SERVER LIST ---- */
.table-card {
  background:linear-gradient(145deg, #111827, #151d2e);
  border:1px solid var(--bdr); border-radius:var(--rl); overflow:hidden;
}
.table-card-header {
  padding:16px 20px; border-bottom:1px solid var(--bdr);
  display:flex; align-items:center; justify-content:space-between;
}
.table-card-title { font-weight:700; font-size:15px; }
table.dt { width:100%; border-collapse:collapse; }
table.dt th {
  text-align:left; padding:12px 16px;
  font-size:11px; font-weight:700; text-transform:uppercase;
  letter-spacing:1px; color:var(--tx3); border-bottom:1px solid var(--bdr);
  background:rgba(255,255,255,.02);
}
table.dt td {
  padding:14px 16px; font-size:14px; border-bottom:1px solid var(--bdr);
  vertical-align:middle;
}
table.dt tbody tr { transition:background .15s; cursor:pointer; }
table.dt tbody tr:hover { background:rgba(99,102,241,.03); }
table.dt tbody tr:last-child td { border-bottom:none; }

/* ---- BADGES ---- */
.badge {
  display:inline-flex; align-items:center; gap:5px; padding:4px 10px;
  border-radius:20px; font-size:12px; font-weight:700;
}
.badge-online { background:var(--grbg); color:var(--gr); }
.badge-stopped { background:var(--rdbg); color:var(--rd); }
.badge-installing { background:var(--orbg); color:var(--or); }
.badge-expired { background:rgba(255,255,255,.05); color:var(--tx3); }
.badge-open { background:var(--orbg); color:var(--or); }
.badge-answered { background:var(--grbg); color:var(--gr); }
.badge-closed { background:rgba(255,255,255,.05); color:var(--tx3); }
.badge-admin { background:var(--acbg); color:var(--ac2); }
.badge-user { background:rgba(255,255,255,.05); color:var(--tx2); }
.dot { width:7px; height:7px; border-radius:50%; display:inline-block; }
.dot-online { background:var(--gr); box-shadow:0 0 6px var(--gr); }
.dot-stopped { background:var(--rd); }

/* ---- SERVER DETAIL ---- */
.detail-header {
  display:flex; align-items:center; gap:16px; margin-bottom:24px; padding:20px;
  background:linear-gradient(145deg, #111827, #151d2e);
  border:1px solid var(--bdr); border-radius:var(--rl); flex-wrap:wrap;
}
.detail-icon {
  width:56px; height:56px; border-radius:14px;
  display:flex; align-items:center; justify-content:center; font-size:28px; flex-shrink:0;
}
.detail-info { flex:1; min-width:0; }
.detail-name { font-size:22px; font-weight:800; }
.detail-ip { font-size:13px; color:var(--tx3); font-family:var(--mono); }

.detail-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:16px; margin-bottom:24px; }
.metric-card {
  background:linear-gradient(145deg, #111827, #151d2e);
  border:1px solid var(--bdr); border-radius:var(--rl); padding:20px;
}
.metric-label { font-size:12px; color:var(--tx3); text-transform:uppercase; letter-spacing:1px; margin-bottom:6px; }
.metric-value { font-size:22px; font-weight:800; font-family:var(--mono); }
.metric-bar { height:6px; background:var(--bg2); border-radius:3px; overflow:hidden; margin-top:8px; }
.metric-fill { height:100%; border-radius:3px; transition:width .8s ease; }

/* ---- TABS ---- */
.tabs { display:flex; gap:0; border-bottom:1px solid var(--bdr); margin-bottom:24px; overflow-x:auto; }
.tab-btn {
  padding:12px 20px; font-size:14px; font-weight:600;
  color:var(--tx3); cursor:pointer; border:none;
  border-bottom:2px solid transparent; transition:all .2s;
  background:none; font-family:var(--font); white-space:nowrap;
}
.tab-btn:hover { color:var(--tx2); }
.tab-btn.active { color:var(--ac2); border-bottom-color:var(--ac2); }

/* ---- CONSOLE ---- */
.console {
  background:#010409; border:1px solid var(--bdr); border-radius:var(--rl);
  padding:16px; font-family:var(--mono); font-size:12px;
  color:var(--gr); max-height:300px; overflow-y:auto; line-height:1.8;
}
.console-line { opacity:.85; }
.console-line::before { content:'> '; color:var(--tx3); }
.console-input { display:flex; gap:8px; margin-top:10px; }

/* ---- TICKET MESSAGES ---- */
.msg-list { display:flex; flex-direction:column; gap:12px; margin-bottom:20px; }
.msg-item {
  background:linear-gradient(145deg,#141c30,#1a2440);
  border:1px solid var(--bdr); border-radius:var(--rl);
  padding:18px; animation:fadeUp .3s ease both;
}
.msg-item.admin-msg { border-left:3px solid var(--ac); }
.msg-header { display:flex; justify-content:space-between; margin-bottom:8px; flex-wrap:wrap; gap:4px; }
.msg-author { font-weight:700; font-size:14px; display:flex; align-items:center; gap:8px; }
.msg-date { font-size:11px; color:var(--tx3); }
.msg-body { font-size:14px; color:var(--tx2); line-height:1.7; }

/* ---- CONFIGURATOR ---- */
.config-grid { display:grid; grid-template-columns:1fr 340px; gap:24px; }
@media(max-width:1000px) { .config-grid { grid-template-columns:1fr; } }
.config-section { margin-bottom:24px; }
.config-label { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:1.5px; color:var(--tx3); margin-bottom:12px; }
.opt-row { display:flex; flex-wrap:wrap; gap:10px; }
.opt-btn {
  padding:12px 20px; border-radius:var(--r); border:1px solid var(--bdr);
  background:linear-gradient(145deg,#111827,#151d2e); color:var(--tx2); cursor:pointer;
  font-family:var(--font); font-size:14px; font-weight:600;
  transition:all .2s; position:relative;
}
.opt-btn:hover { border-color:var(--bdr2); color:var(--tx); }
.opt-btn.active { border-color:var(--ac); background:var(--acbg); color:var(--ac2); }
.opt-btn .sub { display:block; font-size:11px; color:var(--tx3); font-family:var(--mono); margin-top:2px; }
.opt-badge-green { position:absolute; top:-8px; right:-4px; background:var(--gr); color:#000; font-size:10px; font-weight:700; padding:2px 6px; border-radius:4px; }

.order-summary {
  background:linear-gradient(145deg, #111827, #151d2e);
  border:1px solid var(--bdr); border-radius:var(--rl);
  padding:24px; position:sticky; top:72px; height:fit-content;
}
.order-title { font-size:17px; font-weight:700; margin-bottom:20px; padding-bottom:14px; border-bottom:1px solid var(--bdr); }
.order-row { display:flex; justify-content:space-between; padding:8px 0; font-size:14px; }
.order-label { color:var(--tx2); }
.order-val { font-weight:700; font-family:var(--mono); }
.order-total { margin-top:14px; padding-top:14px; border-top:1px solid var(--bdr); display:flex; justify-content:space-between; font-size:20px; font-weight:800; }
.order-price { color:var(--gr); }

/* ---- CHART ---- */
.chart-bars { display:flex; align-items:flex-end; gap:10px; height:180px; }
.chart-bar { flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; }
.chart-bar-val { font-size:10px; font-family:var(--mono); color:var(--gr); }
.chart-bar-fill { width:100%; border-radius:6px 6px 0 0; min-height:6px; background:linear-gradient(180deg, var(--ac), rgba(31,111,235,.3)); transition:height .8s ease; }
.chart-bar-label { font-size:11px; color:var(--tx3); }

/* ---- PROFILE ---- */
.profile-grid { display:grid; grid-template-columns:1fr 1fr; gap:20px; }
@media(max-width:768px) { .profile-grid { grid-template-columns:1fr; } }

.promo-input { display:flex; gap:8px; }

/* ---- TOPUP ---- */
.topup-amounts { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:16px; }
.topup-btn {
  padding:12px 20px; border-radius:var(--r); border:1px solid var(--bdr);
  background:linear-gradient(145deg,#111827,#151d2e); color:var(--tx);
  cursor:pointer; font-family:var(--mono); font-size:15px; font-weight:700; transition:.25s;
}
.topup-btn:hover { border-color:var(--gr); color:var(--gr); background:var(--grbg); }
.topup-btn.active { border-color:var(--gr); color:var(--gr); background:var(--grbg); box-shadow:0 0 16px rgba(16,185,129,.12); }

/* ---- MODAL ---- */
.modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.6); backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center; z-index:999;
  animation:fadeIn .2s ease;
}
.modal-box {
  background:linear-gradient(145deg,#111827,#161e30); border:1px solid var(--bdr2);
  border-radius:20px; padding:32px; max-width:480px; width:90%;
  box-shadow:0 20px 60px rgba(0,0,0,.5); animation:scaleIn .3s ease both;
}

/* ---- TOAST ---- */
.toast-notification {
  position:fixed; bottom:24px; right:24px; z-index:9999; max-width:400px;
  padding:14px 20px; border-radius:var(--rl);
  font-family:var(--font); font-size:14px; font-weight:600;
  box-shadow:0 8px 32px rgba(0,0,0,.4); animation:toastIn .3s ease;
}
.toast-success { background:var(--grbg); color:var(--gr); border:1px solid rgba(16,185,129,.2); }
.toast-error { background:var(--rdbg); color:var(--rd); border:1px solid rgba(239,68,68,.2); }

/* ---- UTILS ---- */
.flex { display:flex; }
.flex-wrap { flex-wrap:wrap; }
.gap-8 { gap:8px; }
.gap-12 { gap:12px; }
.gap-16 { gap:16px; }
.gap-20 { gap:20px; }
.mt-16 { margin-top:16px; }
.mt-24 { margin-top:24px; }
.mb-16 { margin-bottom:16px; }
.mb-24 { margin-bottom:24px; }
.mono { font-family:var(--mono); }
.text-2 { color:var(--tx2); }
.text-3 { color:var(--tx3); }
.text-green { color:var(--gr); }
.text-red { color:var(--rd); }
.fw-700 { font-weight:700; }
.fs-13 { font-size:13px; }
.fs-12 { font-size:12px; }

/* ---- MOBILE ---- */
.mobile-bottom-nav {
  display:none; position:fixed; bottom:0; left:0; right:0; z-index:200;
  background:rgba(6,8,15,.95); backdrop-filter:blur(24px);
  border-top:1px solid var(--bdr);
  padding:4px 6px; padding-bottom:env(safe-area-inset-bottom, 4px);
}
.mobile-bottom-nav a {
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap:2px; padding:8px 4px; border-radius:8px;
  font-size:10px; font-weight:600; color:var(--tx3);
  text-decoration:none; transition:.2s;
}
.mobile-bottom-nav a.active { color:var(--ac2); background:var(--acbg); }
.mobile-bottom-nav .nav-icon { display:flex; align-items:center; justify-content:center; height:22px; }

@media(max-width:768px) {
  .mobile-bottom-nav { display:flex; }
  .topnav-links { display:none !important; }
  .topnav-brand .nav-title { display:none; }
  .panel-main { padding-bottom:80px !important; }
  .hide-mobile { display:none !important; }
  .stats-row { grid-template-columns:1fr 1fr !important; }
  .detail-grid { grid-template-columns:1fr !important; }
  .profile-grid { grid-template-columns:1fr !important; }
  .config-grid { grid-template-columns:1fr !important; }
  .page-title { font-size:20px; }
  .page-header { flex-direction:column; align-items:flex-start; }
  .order-summary { position:static !important; }
  .detail-header { flex-direction:column; align-items:flex-start; }
}

@media(max-width:480px) {
  .news-grid { grid-template-columns:1fr !important; }
}

/* ═══ PROFILE HERO ═══ */
.profile-hero {
  position:relative; border-radius:20px; overflow:hidden;
  background:linear-gradient(145deg, #111827, #151d2e);
  border:1px solid var(--bdr);
}
.profile-hero-bg {
  position:absolute; inset:0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.15), transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(6,182,212,.08), transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(168,85,247,.06), transparent 50%);
  z-index:0;
}
.profile-hero-content {
  position:relative; z-index:1;
  display:flex; align-items:center; gap:24px;
  padding:32px; flex-wrap:wrap;
}
.profile-avatar {
  width:80px; height:80px; border-radius:20px;
  background:linear-gradient(135deg, var(--ac), #7c3aed);
  display:flex; align-items:center; justify-content:center;
  font-size:28px; font-weight:900; color:#fff; letter-spacing:1px;
  box-shadow:0 8px 32px rgba(99,102,241,.3);
  flex-shrink:0;
}
.profile-hero-info { flex:1; min-width:200px; }
.profile-hero-name { font-size:26px; font-weight:900; letter-spacing:-.5px; margin-bottom:8px; }
.profile-hero-meta { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.profile-hero-date { font-size:13px; color:var(--tx2); display:inline-flex; align-items:center; gap:6px; }
.profile-hero-stats {
  display:flex; gap:16px; margin-left:auto;
}
.profile-hero-stat {
  text-align:center; padding:12px 20px;
  background:rgba(255,255,255,.04); border-radius:12px;
  border:1px solid var(--bdr); min-width:90px;
}
.profile-hero-stat-val {
  font-size:22px; font-weight:800; font-family:var(--mono);
}
.profile-hero-stat-val.green { color:var(--gr); }
.profile-hero-stat-val.accent { color:var(--ac2); }
.profile-hero-stat-label {
  font-size:11px; color:var(--tx3); text-transform:uppercase;
  letter-spacing:.5px; margin-top:2px;
}

/* Profile info rows */
.profile-info-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 0; border-bottom:1px solid var(--bdr);
}
.profile-info-label { font-size:14px; color:var(--tx2); }
.profile-info-val { font-size:14px; font-weight:700; }

/* Input with prefix icon */
.input-with-icon {
  position:relative; display:flex; align-items:center;
}
.input-icon {
  position:absolute; left:14px; color:var(--tx3);
  font-size:14px; font-weight:700; z-index:1; pointer-events:none;
}
.input-pl { padding-left:32px !important; }

@media(max-width:768px) {
  .profile-hero-content { flex-direction:column; align-items:flex-start; gap:16px; }
  .profile-hero-stats { margin-left:0; width:100%; justify-content:space-between; }
  .profile-hero-stat { flex:1; }
  .profile-avatar { width:64px; height:64px; font-size:22px; border-radius:16px; }
  .profile-hero-name { font-size:22px; }
}

/* ═══ FILE MANAGER ═══ */
.file-row {
  display:flex; align-items:center; gap:12px;
  padding:12px 20px; border-bottom:1px solid var(--bdr);
  font-size:14px; transition:.15s; cursor:default;
}
.file-row:last-child { border-bottom:none; }
.file-row-dir, .file-row-back { cursor:pointer; }
.file-row-dir:hover, .file-row-back:hover { background:rgba(99,102,241,.04); }
.file-name { flex:1; font-weight:600; }
.file-size { min-width:80px; text-align:right; }
.file-date { min-width:100px; text-align:right; }
@media(max-width:600px) {
  .file-size, .file-date { display:none; }
}
