/* =========================================
   ZERRA CLOUD - dashboard.css
   Cloud Panel Console Theme
   Clean, Light, Modern — Support All Devices
   FINAL FIXED — Desktop & Mobile Scroll Fixed
   ========================================= */

/* ══════════════════════════════════════════════
   CSS VARIABLES
══════════════════════════════════════════════ */
:root {
  --font-head: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  
  /* Colors - Light Theme */
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-strong: #cbd5e1;
  
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-placeholder: #cbd5e1;
  
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-lt: #eff6ff;
  --accent-bd: #bfdbfe;
  
  --success: #16a34a;
  --success-lt: #f0fdf4;
  --success-bd: #bbf7d0;
  
  --warning: #f59e0b;
  --warning-lt: #fffbeb;
  --warning-bd: #fde68a;
  
  --danger: #ef4444;
  --danger-lt: #fef2f2;
  --danger-bd: #fecaca;
  
  --info: #0ea5e9;
  --info-lt: #f0f9ff;
  --info-bd: #bae6fd;
  
  /* Sizing */
  --sidebar-w: 230px;
  --topbar-h: 48px;
  
  /* Typography */
  --text-xs: 0.625rem;
  --text-sm: 0.75rem;
  --text-md: 0.8125rem;
  --text-lg: 1rem;
  --text-xl: 1.25rem;
  
  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  
  /* Borders & Shadows */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

/* ══════════════════════════════════════════════
   CRITICAL FIX: NO BODY SCROLL — iOS SAFE
   Halaman utama fixed penuh, scroll hanya
   di dalam container konten yang ditentukan.
   Header/judul TIDAK ikut scroll.
══════════════════════════════════════════════ */
html {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.dash-body {
  background: var(--bg);
  display: flex;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height untuk iOS */
  max-height: 100vh;
  max-height: 100dvh;
  width: 100%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  min-height: var(--topbar-h);
}

.sidebar .logo {
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.2px;
}

.sidebar .logo i,
.sidebar .logo em {
  color: var(--accent);
  font-style: normal;
}

.sidebar-close {
  display: none;
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-md);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-close:hover {
  background: var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.su-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-lt);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
  overflow: hidden;
}

.su-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.su-info {
  min-width: 0;
  overflow: hidden;
}

.su-info strong {
  display: block;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.su-info span {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Sidebar Nav — scrollable mandiri */
.sidebar-nav {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.nav-group {
  margin-bottom: 6px;
}

.nav-group-label {
  display: block;
  padding: 4px 10px 2px;
  font-size: 0.6rem;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
  cursor: pointer;
}

.nav-item:hover {
  background: var(--bg);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-lt);
  color: var(--accent);
  font-weight: var(--weight-semibold);
  border-right: 3px solid var(--accent);
}

.nav-item i {
  width: 16px;
  text-align: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.nav-item.active i {
  color: var(--accent);
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: var(--weight-bold);
  min-width: 17px;
  height: 17px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

.nav-logout {
  color: var(--danger) !important;
  margin-top: 3px;
}

.nav-logout:hover {
  background: var(--danger-lt) !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
}

.sidebar-overlay.open {
  display: block;
}

/* ══════════════════════════════════════════════
   MAIN CONTENT — Fixed, no scroll on body
══════════════════════════════════════════════ */
.dash-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: margin-left var(--transition-base);
  position: relative;
}

/* ══════════════════════════════════════════════
   TOPBAR — Sticky, tidak ikut scroll
══════════════════════════════════════════════ */
.topbar {
  height: var(--topbar-h);
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-toggle {
  display: none;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-lg);
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-toggle:hover {
  background: var(--bg);
}

.topbar-breadcrumb {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-md);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: background var(--transition-fast);
}

.topbar-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.topbar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: var(--radius-full);
  border: 2px solid var(--surface);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tu-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  overflow: hidden;
}

.tu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ══════════════════════════════════════════════
   ALERT BANNER — Sticky, tidak ikut scroll
══════════════════════════════════════════════ */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: var(--warning-lt);
  border-bottom: 1px solid var(--warning-bd);
  font-size: 11px;
  color: var(--text-secondary);
  line-height: var(--leading-tight);
  flex-shrink: 0;
}

.alert-banner i {
  color: var(--warning);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   PAGES — HEADER TETAP + KONTEN SCROLLABLE
   Ini fix utama: header tidak ikut scroll,
   hanya konten di bawahnya yang scrollable
══════════════════════════════════════════════ */
.dash-page {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  scroll-behavior: smooth;
  padding: 16px 20px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.dash-page.active {
  display: block;
}

/* Custom scrollbar */
.dash-page::-webkit-scrollbar {
  width: 5px;
}

.dash-page::-webkit-scrollbar-track {
  background: transparent;
}

.dash-page::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}

/* ══════════════════════════════════════════════
   PAGE HEADER — Bagian dari konten scrollable
   tapi tetap di atas
══════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: var(--leading-tight);
  margin: 0;
}

.text-muted {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.d-block {
  display: block;
}

/* ══════════════════════════════════════════════
   STATS GRID
══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: box-shadow var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--shadow-sm);
}

.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.stat-card-icon.blue   { background: var(--accent-lt);   color: var(--accent); }
.stat-card-icon.yellow { background: var(--warning-lt);  color: var(--warning); }
.stat-card-icon.red    { background: var(--danger-lt);   color: var(--danger); }
.stat-card-icon.green  { background: var(--success-lt);  color: var(--success); }

.stat-card-body {
  min-width: 0;
}

.stat-card-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  line-height: var(--leading-tight);
}

.stat-card-val {
  display: block;
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--text);
  line-height: var(--leading-tight);
  margin-top: 1px;
}

/* ══════════════════════════════════════════════
   SECTION CARD
══════════════════════════════════════════════ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.sc-header h3 {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.sc-header h3 i {
  color: var(--accent);
  font-size: 0.8rem;
}

.sc-title {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.sc-title i {
  color: var(--accent);
}

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: var(--weight-medium);
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg);
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 3px 9px;
  font-size: 10.5px;
  border-radius: var(--radius-xs);
}

.w-full {
  width: 100%;
}

/* ══════════════════════════════════════════════
   EMPTY STATE & LOADER
══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 28px 14px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
  opacity: .25;
}

.empty-state p {
  font-size: 11px;
  margin-bottom: 10px;
}

.page-loader {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 11px;
}

.page-loader i {
  margin-right: 5px;
}

/* ══════════════════════════════════════════════
   SERVER MINI LIST
══════════════════════════════════════════════ */
.server-mini-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.server-mini-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.server-mini-item:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
}

.smi-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.smi-dot.online  { background: var(--success); box-shadow: 0 0 0 2px var(--success-lt); }
.smi-dot.offline { background: var(--danger); }

.smi-info {
  flex: 1;
  min-width: 0;
}

.smi-name {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.smi-ip {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.smi-expiry {
  font-size: 10px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  color: var(--text-muted);
}

.smi-expiry.soon    { color: var(--warning); font-weight: var(--weight-semibold); }
.smi-expiry.expired { color: var(--danger); font-weight: var(--weight-semibold); }

/* ══════════════════════════════════════════════
   SERVER CARDS
══════════════════════════════════════════════ */
.server-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.server-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}

.server-card:hover {
  box-shadow: var(--shadow-sm);
}

.server-card.online {
  border-left: 4px solid var(--success);
}

.server-card.offline {
  border-left: 4px solid var(--danger);
}

.server-card.card-expired {
  opacity: 0.72;
  border-left: 4px solid var(--danger) !important;
}

.sc-top {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
}

.sc-top-left {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sc-status-dot {
  width: 9px;
  height: 9px;
  border-radius: var(--radius-full);
  margin-top: 4px;
  flex-shrink: 0;
}

.server-card.online .sc-status-dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-lt);
  animation: pulse 2s infinite;
}

.server-card.offline .sc-status-dot {
  background: var(--text-muted);
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-lt); }
  50% { box-shadow: 0 0 0 6px rgba(16, 124, 16, 0.15); }
}

.sc-title-pkg {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
  color: var(--text);
  margin-bottom: 2px;
}

.sc-title-pkg small {
  display: block;
  font-weight: var(--weight-normal);
  color: var(--text-muted);
  font-size: 10px;
}

.sc-code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  margin-top: 2px;
  letter-spacing: 0.3px;
}

.sc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-medium);
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.tag i {
  font-size: 0.6rem;
  opacity: 0.7;
}

.tag.online-tag {
  background: var(--success-lt);
  color: var(--success);
  border-color: var(--success-bd);
}

.tag.offline-tag {
  background: var(--danger-lt);
  color: var(--danger);
  border-color: var(--danger-bd);
}

.sc-top-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  min-width: 150px;
}

.sc-btn-group {
  display: flex;
  gap: 5px;
  align-items: stretch;
  width: 100%;
}

.sc-top-right .btn {
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: var(--weight-semibold);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.sc-top-right .btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.sc-top-right .btn-outline:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-perpanjang-card {
  width: 100%;
  flex: none !important;
  background: #22c55e !important;
  border: none !important;
  color: white !important;
  padding: 7px 10px !important;
}

.btn-perpanjang-card:hover {
  background: #16a34a !important;
}

.btn-perpanjang-card.btn-expired {
  background: #94a3b8 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
  pointer-events: none;
}

/* ══════════════════════════════════════════════
   CREDENTIALS GRID
══════════════════════════════════════════════ */
.cred-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.cred-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
}

.cred-label {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.cred-label i {
  font-size: 0.65rem;
}

.cred-val {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: var(--weight-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--text);
}

.cred-val.masked span {
  filter: blur(4px);
  cursor: pointer;
  user-select: none;
  transition: filter var(--transition-fast);
}

.cred-val.masked:hover span {
  filter: none;
}

.cred-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  padding: 3px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.cred-copy:hover {
  background: var(--border);
  color: var(--accent);
}

.cred-empty {
  color: var(--text-placeholder);
  font-style: italic;
}

/* ══════════════════════════════════════════════
   MONITOR BARS
══════════════════════════════════════════════ */
.monitor-bars {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.monitor-bar-item {
  flex: 1;
  min-width: 90px;
}

.mb-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  margin-bottom: 2px;
  color: var(--text-muted);
}

.mb-label-row strong {
  font-weight: var(--weight-semibold);
  color: var(--text);
}

.mb-track {
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mb-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
  background: var(--success);
}

.mb-fill.warn { background: var(--warning); }
.mb-fill.crit { background: var(--danger); }

/* ══════════════════════════════════════════════
   EXPIRY SECTION
══════════════════════════════════════════════ */
.sc-expiry {
  padding: 7px 14px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg);
  flex-wrap: wrap;
  gap: 6px;
}

.sc-expiry i {
  font-size: 0.65rem;
}

.sc-expiry strong {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.expiry-warn {
  color: var(--warning) !important;
  font-weight: var(--weight-semibold);
}

.expiry-crit {
  color: var(--danger) !important;
  font-weight: var(--weight-semibold);
}

/* ══════════════════════════════════════════════
   CREDENTIALS LOCK BLOCK
══════════════════════════════════════════════ */
.cred-lock-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 18px 14px;
  margin: 10px 14px;
  background: var(--warning-lt);
  border: 1px solid var(--warning-bd);
  border-radius: var(--radius-sm);
}

.cred-lock-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--warning);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
}

.cred-lock-title {
  font-weight: var(--weight-semibold);
  font-size: 12px;
  color: var(--text);
}

.cred-lock-desc {
  font-size: 11px;
  color: var(--text-muted);
  max-width: 260px;
}

.cred-lock-order {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
}

.cred-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.cred-lock-btn:hover {
  background: var(--accent-hover);
}

/* ══════════════════════════════════════════════
   TABLE
══════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dash-table thead th {
  background: var(--bg);
  padding: 6px 9px;
  text-align: left;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.dash-table tbody td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text);
}

.dash-table tbody tr:hover {
  background: var(--surface-hover);
}

.table-loading {
  text-align: center !important;
  color: var(--text-muted);
  padding: 18px !important;
}

.order-code {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: var(--weight-semibold);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.badge-active    { background: var(--success-lt); color: var(--success); border: 1px solid var(--success-bd); }
.badge-pending   { background: var(--warning-lt); color: var(--warning); border: 1px solid var(--warning-bd); }
.badge-confirmed { background: var(--info-lt);    color: var(--info);    border: 1px solid var(--info-bd); }
.badge-expired   { background: var(--bg);         color: var(--text-muted); border: 1px solid var(--border); }
.badge-cancelled { background: var(--danger-lt);  color: var(--danger);  border: 1px solid var(--danger-bd); }

/* ══════════════════════════════════════════════
   CHAT — Fixed container, internal scroll only
   FIXED: Desktop tidak terpotong, flex grow
══════════════════════════════════════════════ */
.chat-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 350px;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
  overflow: hidden;
}

/* FIX: Desktop - gunakan flex:1 agar mengisi sisa ruang */
@media (min-width: 769px) {
  .chat-container {
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
  }
}

.chat-info-banner {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: var(--accent-lt);
  border-bottom: 1px solid var(--accent-bd);
  font-size: 11px;
  flex-shrink: 0;
}

.chat-info-banner i {
  color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.chat-info-links {
  display: flex;
  gap: 8px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.chat-info-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: var(--weight-medium);
  font-size: 10.5px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-msg {
  display: flex;
  gap: 7px;
  max-width: 78%;
  align-items: flex-start;
}

.chat-msg.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-lt);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  flex-shrink: 0;
  overflow: hidden;
}

.chat-msg.mine .msg-avatar {
  background: var(--accent);
  color: #fff;
}

.msg-bubble {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: var(--leading-normal);
  word-break: break-word;
}

.chat-msg.mine .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-msg:not(.mine) .msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}

.msg-time {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
  padding: 0 3px;
}

.chat-input-bar {
  display: flex;
  gap: 6px;
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
  background: var(--surface);
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  resize: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  outline: none;
  min-height: 32px;
  max-height: 90px;
  transition: border-color var(--transition-fast);
}

#chatInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-lt);
}

.chat-loader {
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ══════════════════════════════════════════════
   GLOBAL CHAT — FIXED Desktop tidak terpotong
══════════════════════════════════════════════ */
.gc-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 350px;
  max-height: calc(100vh - 180px);
  max-height: calc(100dvh - 180px);
}

/* FIX: Desktop - gunakan full height yang tersedia */
@media (min-width: 769px) {
  .gc-container {
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
  }
}

.gc-room-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.gc-room-tab {
  flex: 1;
  padding: 9px 12px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.gc-room-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--accent-lt);
}

.gc-room-tab:hover:not(.active) {
  color: var(--text);
  background: var(--bg);
}

.gc-tab-badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  min-width: 15px;
  height: 15px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

.gc-room-info {
  padding: 7px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.gc-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.gc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.gc-online-sidebar {
  width: 170px;
  border-left: 1px solid var(--border);
  padding: 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}

.gc-online-header {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-online-user {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 5px;
  border-radius: var(--radius-xs);
  font-size: 10px;
}

.gc-online-avatar {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--accent-lt);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: var(--weight-semibold);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.gc-online-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gc-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: var(--radius-full);
  border: 1px solid var(--surface);
}

.gc-online-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-crown {
  color: var(--warning);
  font-size: 0.55rem;
  flex-shrink: 0;
}

.gc-no-online {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
}

.gc-input-area {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  align-items: flex-end;
  background: var(--surface);
  flex-shrink: 0;
}

.gc-upload-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 5px;
  font-size: var(--text-md);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.gc-upload-btn:hover {
  background: var(--bg);
  color: var(--accent);
}

#gcInput {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  font-size: 11px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: none;
  outline: none;
  min-height: 32px;
  max-height: 90px;
  transition: border-color var(--transition-fast);
}

#gcInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-lt);
}

.gc-locked-banner {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: var(--warning-lt);
  border-top: 1px solid var(--warning-bd);
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.gc-reply-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gc-reply-bar span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gc-reply-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  font-size: var(--text-sm);
}

.gc-loader,
.gc-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 11px;
}

/* ══════════════════════════════════════════════
   GARANSI PAGE — FIXED Desktop tidak terpotong
══════════════════════════════════════════════ */
#pageGaransi .section-card {
  max-height: none;
  overflow: visible;
}

/* FIX: Container scrollable untuk desktop */
#pageGaransi > div {
  max-height: none;
  overflow-y: visible;
  padding-right: 4px;
}

/* Desktop: batasi max-height agar tidak overflow viewport */
@media (min-width: 769px) {
  #pageGaransi > div {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

#pageGaransi > div::-webkit-scrollbar {
  width: 4px;
}

#pageGaransi > div::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

#garansiHistory {
  max-height: none;
}

/* ══════════════════════════════════════════════
   TESTIMONI PAGE — FIXED Desktop tidak terpotong
══════════════════════════════════════════════ */
/* FIX: Hanya batasi max-height di desktop */
@media (min-width: 769px) {
  #pageTestimoni .section-card {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    padding-right: 8px;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  #pageTestimoni .section-card {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    padding-right: 8px;
    overscroll-behavior: contain;
  }
}

#pageTestimoni .section-card::-webkit-scrollbar {
  width: 4px;
}

#pageTestimoni .section-card::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ══════════════════════════════════════════════
   PROFILE PAGE — FIXED Desktop tidak terpotong
══════════════════════════════════════════════ */
/* FIX: Hanya batasi max-height di desktop */
@media (min-width: 769px) {
  #pageProfile .profile-grid {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  #pageProfile .profile-grid {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }
}

#pageProfile .profile-grid::-webkit-scrollbar {
  width: 4px;
}

#pageProfile .profile-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ══════════════════════════════════════════════
   SERVERS PAGE — FIXED Desktop tidak terpotong
══════════════════════════════════════════════ */
/* FIX: Hanya batasi max-height di desktop */
@media (min-width: 769px) {
  #serverList {
    max-height: calc(100vh - 200px);
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  #serverList {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    padding-right: 4px;
    overscroll-behavior: contain;
  }
}

#serverList::-webkit-scrollbar {
  width: 4px;
}

#serverList::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ══════════════════════════════════════════════
   FORM FIELDS
══════════════════════════════════════════════ */
.field-group {
  margin-bottom: 10px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.field-label i {
  color: var(--accent);
  font-size: 0.7rem;
}

.field-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast);
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-lt);
}

select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

textarea.field-input {
  resize: vertical;
  min-height: 56px;
}

.field-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  display: block;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field-wrap .field-input {
  padding-right: 32px;
}

.pw-toggle {
  position: absolute;
  right: 7px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  font-size: 0.72rem;
  transition: color var(--transition-fast);
}

.pw-toggle:hover {
  color: var(--accent);
}

/* ══════════════════════════════════════════════
   ALERT
══════════════════════════════════════════════ */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  line-height: var(--leading-tight);
}

.alert-error   { background: var(--danger-lt);  color: var(--danger);  border: 1px solid var(--danger-bd); }
.alert-success { background: var(--success-lt); color: var(--success); border: 1px solid var(--success-bd); }
.alert-info    { background: var(--info-lt);    color: var(--info);    border: 1px solid var(--info-bd); }

/* ══════════════════════════════════════════════
   MODAL
══════════════════════════════════════════════ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  backdrop-filter: blur(2px);
}

.modal-backdrop.is-open {
  display: block;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 201;
  overflow-y: auto;
  padding: 20px;
  pointer-events: none;
}

.modal-overlay.is-open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  pointer-events: auto;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 640px;
  margin: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  max-height: 90vh;
  max-height: 90dvh;
  animation: modalPopIn 0.24s cubic-bezier(0.34,1.2,0.64,1) forwards;
}

.modal-box.modal-lg {
  max-width: 700px;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  touch-action: pan-y;
  user-select: none;
}

.modal-title-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.modal-title-icon {
  width: 32px;
  height: 32px;
  background: var(--accent-lt);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.modal-title-icon i {
  font-size: 0.9rem;
}

.modal-title-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.modal-title-main {
  font-size: 13px;
  font-weight: var(--weight-semibold);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-title-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-left: 8px;
}

.modal-close-btn:hover {
  background: var(--danger-lt);
  border-color: var(--danger-bd);
  color: var(--danger);
}

#serverModalContent {
  padding: 14px 18px 18px;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

#serverModalContent::-webkit-scrollbar {
  width: 4px;
}

#serverModalContent::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

/* ══════════════════════════════════════════════
   TOAST
══════════════════════════════════════════════ */
.toast-wrap {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column-reverse;
  gap: 5px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 11px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 5px;
  animation: toastIn .25s ease;
  max-width: 300px;
  pointer-events: all;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.toast-success { background: var(--success-lt); color: var(--success); border: 1px solid var(--success-bd); }
.toast-error   { background: var(--danger-lt);  color: var(--danger);  border: 1px solid var(--danger-bd); }
.toast-info    { background: var(--info-lt);    color: var(--info);    border: 1px solid var(--info-bd); }

.toast-success i { color: var(--success); }
.toast-error i   { color: var(--danger); }
.toast-info i    { color: var(--info); }

/* ══════════════════════════════════════════════
   PROFILE GRID
══════════════════════════════════════════════ */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 800px;
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: var(--accent-lt);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ══════════════════════════════════════════════
   STAR PICKER
══════════════════════════════════════════════ */
.star-picker {
  display: flex;
  gap: 2px;
}

.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--warning);
  font-size: 1.1rem;
  padding: 2px;
}

.star-btn:hover i {
  transform: scale(1.15);
}

.star-btn.active i {
  color: var(--warning);
}

/* ══════════════════════════════════════════════
   UPLOAD BOX
══════════════════════════════════════════════ */
.upload-box {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  background: var(--bg);
}

.upload-box:hover,
.upload-box.drag-over {
  border-color: var(--accent);
  background: var(--accent-lt);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

.upload-placeholder i {
  font-size: 1.3rem;
  color: var(--text-placeholder);
}

.upload-placeholder span {
  font-size: 11px;
  color: var(--text-secondary);
}

.upload-placeholder small {
  font-size: 10px;
  color: var(--text-muted);
}

.upload-preview {
  position: relative;
}

.upload-preview img {
  max-height: 120px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  display: block;
}

.upload-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════
   ROOT MENU DROPDOWN
══════════════════════════════════════════════ */
.root-menu-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.root-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 10;
  overflow: hidden;
  animation: dropdownIn 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.root-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.root-menu-item:last-child {
  border-bottom: none;
}

.root-menu-item:hover {
  background: var(--accent-lt);
  color: var(--accent);
}

.root-menu-status {
  padding: 7px 10px;
  font-size: 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

/* ══════════════════════════════════════════════
   RESPONSIVE — TABLET
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gc-online-sidebar {
    display: none;
  }
  
  .profile-grid {
    grid-template-columns: 1fr;
  }
  
  .cred-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* FIX: Reset max-height untuk tablet */
  #pageGaransi > div {
    max-height: none;
    overflow-y: visible;
  }

  #pageTestimoni .section-card {
    max-height: none;
    overflow-y: visible;
  }

  #pageProfile .profile-grid {
    max-height: none;
    overflow-y: visible;
  }

  #serverList {
    max-height: none;
    overflow-y: visible;
  }

  .chat-container,
  .gc-container {
    max-height: none;
    height: auto;
    flex: 1;
    min-height: 350px;
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — MOBILE
══════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 260px;
    min-width: 260px;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .sidebar-close {
    display: flex;
  }
  
  .dash-main {
    margin-left: 0 !important;
  }
  
  .topbar-toggle {
    display: flex;
  }
  
  .topbar {
    height: 44px;
    min-height: 44px;
    padding: 0 10px;
  }
  
  .topbar-breadcrumb {
    font-size: 11px;
  }
  
  .dash-page {
    padding: 12px 10px 20px;
  }
  
  .page-header {
    margin-bottom: 12px;
  }
  
  .page-header h1 {
    font-size: var(--text-lg);
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 12px;
  }
  
  .stat-card {
    padding: 9px 10px;
    gap: 7px;
  }
  
  .stat-card-icon {
    width: 30px;
    height: 30px;
    font-size: .8rem;
  }
  
  .stat-card-val {
    font-size: var(--text-md);
  }
  
  .section-card {
    padding: 11px 12px;
    margin-bottom: 10px;
  }
  
  .server-cards {
    gap: 8px;
  }
  
  .sc-top {
    flex-direction: column;
    padding: 10px 11px;
  }
  
  .sc-top-right {
    align-items: stretch;
    width: 100%;
  }
  
  .cred-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
  }
  
  .monitor-bars {
    flex-direction: column;
    gap: 7px;
  }

  /* Mobile: batasi max-height agar tidak overflow viewport */
  #serverList {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
  }

  #pageGaransi > div {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
    gap: 10px;
  }

  #pageTestimoni .section-card {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
  }

  #pageProfile .profile-grid {
    max-height: calc(100vh - 170px);
    max-height: calc(100dvh - 170px);
    overflow-y: auto;
  }
  
  /* Mobile Chat */
  .chat-container,
  .gc-container {
    height: calc(100vh - 150px);
    height: calc(100dvh - 150px);
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
    border-radius: 0;
    border-left: none;
    border-right: none;
    flex: none;
  }
  
  /* Mobile Modal */
  .modal-overlay.is-open {
    padding: 0;
    align-items: flex-end;
  }
  
  .modal-box,
  .modal-box.modal-lg {
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    max-height: 92dvh;
    animation: modalSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
  }
  
  @keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  
  .modal-topbar {
    padding: 10px 14px;
  }
  
  #serverModalContent {
    padding: 10px 14px 14px;
  }
  
  .chat-msg {
    max-width: 85%;
  }
  
  .msg-bubble {
    font-size: 10.5px;
    padding: 6px 8px;
  }
  
  .toast-wrap {
    bottom: 10px;
    right: 8px;
    left: 8px;
    align-items: center;
  }
  
  .toast {
    max-width: 100%;
  }

  .dash-page {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }
}

/* ══════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE
══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .dash-page {
    padding: 10px 8px 18px;
  }
  
  .page-header h1 {
    font-size: var(--text-md);
  }
  
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }
  
  .stat-card {
    padding: 7px 8px;
    gap: 5px;
  }
  
  .stat-card-icon {
    width: 26px;
    height: 26px;
    font-size: .7rem;
  }
  
  .stat-card-label {
    font-size: 0.6rem;
  }
  
  .stat-card-val {
    font-size: 11px;
  }
  
  .topbar {
    height: 40px;
    min-height: 40px;
    padding: 0 8px;
  }
  
  .btn-sm {
    padding: 3px 7px;
    font-size: 0.6rem;
  }
  
  .section-card {
    padding: 9px 10px;
    border-radius: var(--radius-sm);
  }
  
  .cred-grid {
    padding: 8px;
    gap: 5px;
  }
  
  .cred-val span {
    font-size: 10px;
  }
  
  .monitor-bars {
    padding: 8px 10px;
    gap: 6px;
  }
  
  .mb-label-row {
    font-size: 0.6rem;
  }
  
  .sc-expiry {
    padding: 5px 10px;
    font-size: 0.6rem;
  }
  
  .field-input {
    font-size: 10px;
    padding: 5px 8px;
  }
  
  .field-label {
    font-size: 0.6rem;
  }

  .chat-container,
  .gc-container {
    height: calc(100vh - 140px);
    height: calc(100dvh - 140px);
    max-height: calc(100vh - 140px);
    max-height: calc(100dvh - 140px);
    flex: none;
  }

  #serverList {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }

  #pageGaransi > div {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }

  #pageTestimoni .section-card {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }

  #pageProfile .profile-grid {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }
}