/* ============================================================
   ADMIN DASHBOARD — MAIN CSS
   [NAMA WEBSITE] · Dark Mode SaaS Design
   ============================================================ */

/* ===== VARIABLES ===== */
:root {
  /* Backgrounds */
  --bg-body:      #0B1120;
  --bg-sidebar:   #080F1C;
  --bg-card:      #111827;
  --bg-elevated:  #1A2540;
  --bg-input:     #0F1A2E;

  /* Accent */
  --accent:       #2563EB;
  --accent-light: #3B82F6;
  --accent-hover: #1D4ED8;
  --accent-glow:  rgba(37,99,235,0.18);
  --accent-subtle:rgba(37,99,235,0.08);

  /* Status */
  --success:      #10B981;
  --success-bg:   rgba(16,185,129,0.12);
  --success-border:rgba(16,185,129,0.25);
  --error:        #EF4444;
  --error-bg:     rgba(239,68,68,0.12);
  --error-border: rgba(239,68,68,0.25);
  --warning:      #F59E0B;
  --warning-bg:   rgba(245,158,11,0.12);
  --warning-border:rgba(245,158,11,0.25);
  --info:         #06B6D4;
  --info-bg:      rgba(6,182,212,0.12);
  --purple:       #8B5CF6;
  --purple-bg:    rgba(139,92,246,0.12);

  /* Text */
  --text-primary:   #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted:     #475569;
  --text-inverse:   #0B1120;

  /* Borders */
  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(37,99,235,0.35);

  /* Shadows */
  --shadow:     0 4px 24px rgba(0,0,0,0.35);
  --shadow-sm:  0 2px 8px  rgba(0,0,0,0.2);
  --shadow-lg:  0 8px 48px rgba(0,0,0,0.45);

  /* Layout */
  --sidebar-w:      260px;
  --sidebar-w-col:  72px;
  --topbar-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-xl:      20px;
  --font: 'Inter', sans-serif;

  /* Transitions */
  --transition: 0.2s ease;
  --transition-slow: 0.3s cubic-bezier(0.4,0,0.2,1);
}

/* Light theme */
[data-theme="light"] {
  --bg-body:      #F1F5F9;
  --bg-sidebar:   #1E293B;
  --bg-card:      #FFFFFF;
  --bg-elevated:  #F8FAFC;
  --bg-input:     #F1F5F9;
  --border:       rgba(0,0,0,0.08);
  --text-primary: #0F172A;
  --text-secondary:#475569;
  --text-muted:   #94A3B8;
  --shadow:       0 4px 24px rgba(0,0,0,0.10);
  --shadow-sm:    0 2px 8px  rgba(0,0,0,0.06);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font); }
input, textarea, select { font-family: var(--font); }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}

/* Desktop collapsed — sidebar menjadi sempit (icon only) */
.sidebar.collapsed {
  width: 64px;
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .profile-info,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-arrow,
.sidebar.collapsed .visit-store-btn span,
.sidebar.collapsed .nav-link span {
  display: none;
}
.sidebar.collapsed .nav-group-header { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .nav-group-left { justify-content: center; }
.sidebar.collapsed .nav-submenu { max-height: 0 !important; }
.sidebar.collapsed .nav-link { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .sidebar-profile { justify-content: center; }
.sidebar.collapsed .profile-avatar { margin: 0 auto; }
.sidebar.collapsed .visit-store-btn { justify-content: center; }
.sidebar.collapsed .collapse-btn { margin: 0 auto; }

/* Sidebar header */
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.logo-box {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #4F46E5);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px var(--accent-glow);
}
.logo-text {
  font-size: 15px; font-weight: 700; color: var(--text-primary);
  white-space: nowrap; overflow: hidden;
}
.collapse-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); flex-shrink: 0;
}
.collapse-btn:hover { background: var(--accent-subtle); border-color: var(--border-accent); color: var(--accent-light); }

/* Sidebar profile */
.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.profile-name { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.profile-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

/* Visit store button */
.visit-store-btn {
  margin: 10px 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 12px; font-weight: 600;
  transition: all var(--transition);
  flex-shrink: 0;
  white-space: nowrap; overflow: hidden;
}
.visit-store-btn:hover { background: var(--accent-glow); }

/* Sidebar nav */
.sidebar-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 8px 0;
}
.nav-group { margin-bottom: 4px; }
.nav-divider { height: 1px; background: var(--border); margin: 8px 16px; opacity: 0.6; }
.nav-group-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
  cursor: pointer; transition: all var(--transition);
}
.nav-group-header:hover { color: var(--text-secondary); }
.nav-group-left { display: flex; align-items: center; gap: 8px; }
.nav-group-left i { font-size: 14px; width: 16px; text-align: center; }
.nav-arrow { font-size: 10px; transition: transform var(--transition); }

.nav-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
}
.nav-submenu.open { max-height: 600px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 22px;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
  white-space: nowrap;
}
.nav-link i { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; color: var(--text-muted); transition: color var(--transition); }
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.nav-link:hover i { color: var(--accent-light); }
.nav-link.active {
  background: var(--accent-subtle);
  color: var(--accent-light);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent-light);
}
.nav-link.active i { color: var(--accent-light); }


/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 199;
}
.sidebar-overlay.show { display: block; }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left 0.3s cubic-bezier(0.4,0,0.2,1);
  overflow-x: hidden;
  max-width: 100%;
}
.main-wrapper.collapsed {
  margin-left: 64px;
}
/* Tombol buka sidebar / hamburger menu */
.sidebar-open-btn {
  display: none; /* default: hidden */
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.sidebar-open-btn:hover { background: var(--accent-subtle); color: var(--accent-light); border-color: var(--border-accent); }
/* Tampil di desktop hanya saat sidebar collapsed */
.sidebar-open-btn.visible { display: flex; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(11,17,32,0.9);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
}
[data-theme="light"] .topbar { background: rgba(255,255,255,0.9); }

.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.menu-btn { display: none; }

.topbar-search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  max-width: 380px; flex: 1;
  transition: border-color var(--transition);
}
.topbar-search:focus-within { border-color: var(--border-accent); }
.topbar-search i { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.topbar-search input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search kbd {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 4px; padding: 2px 6px;
  font-size: 11px; color: var(--text-muted);
  font-family: inherit;
}

.topbar-icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); position: relative;
}
.topbar-icon-btn:hover { background: var(--accent-subtle); border-color: var(--border-accent); color: var(--accent-light); }

.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--error);
  border: 2px solid var(--bg-body);
}

.topbar-profile {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border-radius: 10px; border: 1px solid var(--border);
  cursor: pointer; transition: all var(--transition);
  position: relative;
}
.topbar-profile:hover { background: var(--accent-subtle); border-color: var(--border-accent); }
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.topbar-username { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.profile-chevron { font-size: 10px; color: var(--text-muted); transition: transform var(--transition); }
.topbar-profile.open .profile-chevron { transform: rotate(180deg); }

/* Profile dropdown */
.profile-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 300;
  overflow: hidden;
  display: none;
  animation: fadeSlideDown 0.15s ease;
}
.profile-dropdown.open { display: block; }
@keyframes fadeSlideDown {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}
.dropdown-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
}
.dropdown-avatar {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.dropdown-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.dropdown-email { font-size: 11px; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; color: var(--text-secondary);
  transition: all var(--transition);
}
.dropdown-item i { width: 16px; text-align: center; font-size: 13px; }
.dropdown-item:hover { background: var(--accent-subtle); color: var(--accent-light); }
.dropdown-item.danger:hover { background: var(--error-bg); color: var(--error); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 24px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Page header */
.page-header {
  margin-bottom: 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text-primary); }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ===== GRID LAYOUTS ===== */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-2-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-7-3 { display: grid; grid-template-columns: 7fr 3fr; gap: 16px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}
.card:hover { border-color: rgba(255,255,255,0.12); }
.card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.card-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }


/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative; overflow: hidden;
  transition: all var(--transition);
}
.stat-card:hover { border-color: rgba(255,255,255,0.12); transform: translateY(-1px); }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-label { font-size: 12px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--accent-subtle); color: var(--accent-light); }
.stat-icon.green  { background: var(--success-bg);    color: var(--success); }
.stat-icon.red    { background: var(--error-bg);      color: var(--error); }
.stat-icon.yellow { background: var(--warning-bg);    color: var(--warning); }
.stat-icon.purple { background: var(--purple-bg);     color: var(--purple); }
.stat-icon.cyan   { background: var(--info-bg);       color: var(--info); }

.stat-value {
  font-size: 26px; font-weight: 800;
  color: var(--text-primary); line-height: 1.1;
}
.stat-value.sm { font-size: 20px; }
.stat-footer { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.stat-change { display: flex; align-items: center; gap: 3px; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--error); }
.stat-note { color: var(--text-muted); }

/* ===== WELCOME BANNER ===== */
.welcome-banner {
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 40%, #3B82F6 100%);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
}
.welcome-banner::before,
.welcome-banner::after {
  content: '';
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.welcome-banner::before { width: 280px; height: 280px; top: -80px; right: -60px; }
.welcome-banner::after  { width: 160px; height: 160px; bottom: -60px; right: 100px; }
.welcome-date { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.75); margin-bottom: 6px; }
.welcome-title { font-size: 28px; font-weight: 800; color: #fff; }
.welcome-sub   { font-size: 14px; color: rgba(255,255,255,0.75); margin-top: 6px; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600;
}
.badge i { font-size: 9px; }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }
.badge-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning-border); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-purple  { background: var(--purple-bg);  color: var(--purple); }
.badge-gray    { background: rgba(255,255,255,0.06); color: var(--text-secondary); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; font-family: var(--font);
  border: 1px solid transparent; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
}
.btn i { font-size: 13px; }
.btn-primary   { background: var(--accent);     color: #fff;   border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline   { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--accent-light); color: var(--accent-light); background: var(--accent-subtle); }
.btn-ghost     { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--accent-subtle); color: var(--accent-light); }
.btn-success   { background: var(--success);    color: #fff;   border-color: var(--success); }
.btn-success:hover { opacity: 0.85; }
.btn-danger    { background: var(--error);      color: #fff;   border-color: var(--error); }
.btn-danger:hover { opacity: 0.85; }
.btn-warning   { background: var(--warning);    color: #000;   border-color: var(--warning); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 8px;  font-size: 11px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab-btn {
  padding: 10px 16px;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition); margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-light); border-bottom-color: var(--accent-light); }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 5px;
  background: var(--bg-elevated); border-radius: 99px;
  font-size: 10px; font-weight: 700; margin-left: 5px;
}
.tab-btn.active .tab-count { background: var(--accent-subtle); color: var(--accent-light); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-control {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary); font-size: 13px; font-family: var(--font);
  outline: none; transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--border-accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }
.input-group { position: relative; }
.input-group .form-control { padding-right: 40px; }
.input-group-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer;
  padding: 4px; transition: color var(--transition);
}
.input-group-btn:hover { color: var(--text-primary); }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Period filter pills */
.period-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.period-pill {
  padding: 7px 14px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.period-pill:hover { border-color: var(--accent-light); color: var(--accent-light); }
.period-pill.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

/* Fix: ketika table-wrap di dalam card, biarkan card yang handle border-radius */
.card > .table-wrap {
  border-radius: 0;
  /* Removed: isolation:isolate — dapat mencegah overflow:hidden clipping di GPU compositing */
}
/* Pastikan tabel mengisi full width dan tidak ada gap di corner */
.card > .table-wrap > .data-table {
  border-radius: 0;
}
/* Fix border-radius clipping: card dengan overflow:hidden perlu transform untuk GPU-clip */
.card[style*="overflow:hidden"],
.card[style*="overflow: hidden"] {
  transform: translateZ(0);
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* Safari fix */
}

.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 700px;
}
.data-table th {
  text-align: left; padding: 10px 14px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
/* Hapus border baris terakhir agar corner card terlihat bersih */
.data-table tr:last-child td { border-bottom: none; }
/* Baris terakhir di dalam card: tambah padding-bottom agar ada ruang untuk border-radius */
.card > .table-wrap .data-table tbody tr:last-child td {
  padding-bottom: 16px;
}
/* Baris pertama thead: tambah padding-top agar border-radius atas terlihat */
.card > .table-wrap .data-table thead tr:first-child th {
  padding-top: 14px;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .invoice-link { color: var(--accent-light); font-weight: 600; cursor: pointer; }
.data-table .invoice-link:hover { text-decoration: underline; }
.data-table .td-strong { color: var(--text-primary); font-weight: 600; }
.data-table .td-product { display: flex; align-items: center; gap: 9px; }
.data-table .product-thumb {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--accent-light); flex-shrink: 0;
}

/* Action buttons in table */
.action-btns { display: flex; align-items: center; gap: 4px; }

/* ===== PAGINATION ===== */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 0; gap: 12px; flex-wrap: wrap;
}
.pagination-info { font-size: 12px; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  min-width: 32px; height: 32px; padding: 0 6px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 7px; color: var(--text-secondary);
  font-size: 12px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--accent-light); color: var(--accent-light); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== PROGRESS BAR ===== */
.progress-wrap { background: var(--bg-elevated); border-radius: 99px; overflow: hidden; height: 8px; }
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.progress-bar.blue   { background: linear-gradient(90deg, var(--accent), var(--accent-light)); }
.progress-bar.green  { background: linear-gradient(90deg, #059669, var(--success)); }
.progress-bar.yellow { background: linear-gradient(90deg, #D97706, var(--warning)); }

/* ===== SWITCH / TOGGLE ===== */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer; transition: all var(--transition);
}
.switch-track::after {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-muted);
  top: 2px; left: 2px;
  transition: all var(--transition);
}
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: #fff; }

/* ===== CHART CONTAINERS ===== */
.chart-container { position: relative; width: 100%; }
.chart-container canvas { max-width: 100%; }

/* ===== STATUS DOTS ===== */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.status-dot.online  { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.offline { background: var(--error); }
.status-dot.pending { background: var(--warning); }

/* ===== PRODUCT RANK CARD ===== */
.rank-card { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rank-card:last-child { border-bottom: none; }
.rank-num {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-subtle); color: var(--accent-light);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-num.gold   { background: rgba(245,158,11,0.15); color: var(--warning); }
.rank-num.silver { background: rgba(148,163,184,0.15); color: #94A3B8; }
.rank-num.bronze { background: rgba(234,88,12,0.15); color: #EA580C; }
.rank-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-subtle); display: flex; align-items: center; justify-content: center; font-size: 15px; color: var(--accent-light); flex-shrink: 0; }
.rank-info { flex: 1; min-width: 0; }
.rank-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.rank-meta  { font-size: 11px; color: var(--text-muted); }
.rank-value { font-size: 13px; font-weight: 700; color: var(--success); white-space: nowrap; }

/* ===== INSIGHT CARD ===== */
.insight-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.insight-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.insight-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.insight-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.insight-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.insight-item:last-child { border-bottom: none; }
.insight-item-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.insight-item-name { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-primary); }
.insight-item-value { font-size: 13px; font-weight: 700; color: var(--success); }
.insight-item-sub { font-size: 11px; color: var(--text-muted); }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  z-index: 500;
  display: none; align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from{opacity:0;transform:scale(0.95) translateY(12px);} to{opacity:1;transform:none;} }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-close-btn {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); font-size: 14px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: all var(--transition);
}
.modal-close-btn:hover { color: var(--error); border-color: var(--error); }
.modal-body { padding: 20px 22px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.modal-footer {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 900;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; min-width: 260px; max-width: 340px;
  background: var(--bg-elevated); border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
  font-size: 13px; color: var(--text-primary);
  animation: toastIn 0.25s ease;
}
.toast.success { border-color: var(--success); }
.toast.error   { border-color: var(--error); }
.toast.warning { border-color: var(--warning); }
@keyframes toastIn { from{opacity:0;transform:translateX(20px);} to{opacity:1;transform:none;} }
.toast i { font-size: 15px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error   i { color: var(--error); }
.toast.warning i { color: var(--warning); }
.toast.info    i { color: var(--info); }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 13px; padding: 2px; }

/* ===== SKELETON LOADING ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, rgba(255,255,255,0.04) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-h { height: 16px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-h.lg { height: 32px; }
.skeleton-h.sm { height: 10px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: var(--text-muted);
}
.empty-state i { font-size: 48px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

/* ===== ALERT / INFO BOX ===== */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.5;
}
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(6,182,212,0.25); color: var(--info); }
.alert-danger  { background: var(--error-bg);   border: 1px solid var(--error-border);  color: var(--error); }
.alert i { flex-shrink: 0; margin-top: 1px; }

/* ===== CODE BLOCK ===== */
.code-block {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px; font-size: 12px;
  font-family: 'Consolas','Monaco',monospace;
  color: #7DD3FC; overflow-x: auto;
  white-space: pre; line-height: 1.6;
  position: relative;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.code-lang { font-size: 11px; color: var(--text-muted); background: var(--bg-elevated); padding: 2px 8px; border-radius: 4px; }

/* ===== MISC UTILITIES ===== */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.text-success { color: var(--success); }
.text-error   { color: var(--error); }
.text-warning { color: var(--warning); }
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--text-primary); }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Section label */
.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 12px;
}

/* Separator */
.sep { height: 1px; background: var(--border); margin: 16px 0; }

/* Gateway card */
.gateway-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.gateway-header { display: flex; align-items: center; justify-content: space-between; }
.gateway-name-row { display: flex; align-items: center; gap: 10px; }
.gateway-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-subtle); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--accent-light); flex-shrink: 0; }
.gateway-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.gateway-mode { font-size: 11px; color: var(--text-muted); }

/* Log row */
.log-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.log-row:last-child { border-bottom: none; }
.log-time  { font-size: 11px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; min-width: 100px; }
.log-dot   { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.log-text  { font-size: 12px; color: var(--text-secondary); flex: 1; line-height: 1.5; }
.log-badge { flex-shrink: 0; }

/* ===== KELOLA PRODUK — KOMPONEN CSS ===== */

/* Image Upload Zone */
.img-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.img-upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
}

/* Drag Over highlight for featured products table */
tr.ft-row { cursor: default; transition: background var(--transition); }
tr.drag-over { background: var(--accent-subtle) !important; outline: 2px solid var(--accent); outline-offset: -1px; }
tr.ft-row[draggable="true"]:hover { background: rgba(255,255,255,0.03); }

/* Btn Danger */
.btn-danger { background: var(--error-bg); color: var(--error); border-color: var(--error-border); }
.btn-danger:hover { background: var(--error); color: #fff; }

/* Btn extra small */
.btn-xs { padding: 5px 10px; font-size: 11px; gap: 5px; }
.btn-xs i { font-size: 11px; }

/* Btn ghost icon */
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-elevated); }
.btn-icon { padding: 6px 8px; }

/* mb-16 */
.mb-16 { margin-bottom: 16px; }

/* ===== PAYMENT METHODS PAGE ===== */

.pm-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.pm-stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; align-items: center; gap: 14px;
  transition: all var(--transition);
}
.pm-stat-card:hover { border-color: rgba(255,255,255,0.12); }
.pm-stat-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.pm-stat-icon.blue   { background: var(--accent-subtle); color: var(--accent-light); }
.pm-stat-icon.green  { background: var(--success-bg);    color: var(--success); }
.pm-stat-icon.red    { background: var(--error-bg);      color: var(--error); }
.pm-stat-icon.purple { background: var(--purple-bg);     color: var(--purple); }
.pm-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.pm-stat-value { font-size: 22px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.pm-filter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pm-method-cell { display: flex; align-items: center; gap: 12px; }
.pm-icon-box {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--accent-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--accent-light); flex-shrink: 0;
}
.pm-name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pm-code { font-size: 11px; color: var(--text-muted); font-family: 'Consolas', monospace; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .grid-4       { grid-template-columns: repeat(2, 1fr); }
  .grid-7-3     { grid-template-columns: 1fr; }
  .grid-2-3     { grid-template-columns: 1fr; }
  .pm-stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; z-index: 201; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-wrapper { margin-left: 0 !important; }
  .menu-btn { display: none !important; }
  .sidebar-open-btn { display: flex !important; }
  .topbar { padding: 0 12px; gap: 8px; height: 56px; }
  .topbar-left { flex: 1; min-width: 0; }
  .topbar-search { max-width: none; flex: 1; min-width: 0; }
  .topbar-search kbd { display: none; }
  .topbar-search i { display: none; }
  .topbar-search input { font-size: 12px; }
  .topbar-username { display: none; }
  .profile-chevron { display: none; }

  .page-content { padding: 12px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-title { font-size: 18px; }
  .page-actions { width: 100%; justify-content: flex-end; }
  .welcome-banner { padding: 18px 20px; margin-bottom: 16px; }
  .welcome-title  { font-size: 20px; }
  .welcome-sub    { font-size: 13px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card  { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat-icon  { width: 34px; height: 34px; font-size: 14px; }
  .card { padding: 14px; }
  .pm-stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tabs { gap: 0; }
  .tab-btn { padding: 9px 12px; font-size: 12px; }
  .period-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .period-pill  { white-space: nowrap; }
  .gateway-header { flex-wrap: wrap; gap: 10px; }
  .modal { width: 95%; max-width: 95%; }

  /* Cegah konten tumpah keluar card di mobile */
  .card { overflow: hidden; }
  .card-body { overflow-x: hidden; }

  /* Accordion card-body padding lebih rapat */
  .accordion-content .card-body,
  .accordion-content > div { padding: 14px 12px; }

  /* Form group dengan flex layout → wrap */
  .form-group [style*="display:flex"],
  .form-group [style*="display: flex"] { flex-wrap: wrap; }

  /* cfg-seo-grid: preview panel menjadi tidak terlalu tinggi */
  .cfg-seo-grid > div:last-child { min-height: auto; }

  /* Tombol save/cancel di bawah accordion tetap full-width */
  .accordion-save-bar { flex-wrap: wrap; gap: 8px; }
  .accordion-save-bar button { flex: 1; min-width: 120px; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 10px; gap: 6px; }
  .topbar-search { display: none; }

  .page-content { padding: 10px; }
  .grid-4 { grid-template-columns: 1fr; gap: 8px; }
  .grid-3 { grid-template-columns: 1fr; gap: 8px; }
  .grid-2 { grid-template-columns: 1fr; gap: 8px; }
  .pm-stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 18px; }
  .notif-btn  { display: none; }
  .welcome-title  { font-size: 18px; }
  .welcome-banner { padding: 16px; }
  .page-title    { font-size: 16px; }
  .page-subtitle { font-size: 12px; }
  .tab-btn { padding: 8px 10px; font-size: 11px; }
  .toast-container { right: 10px; left: 10px; }
  .toast { min-width: unset; max-width: 100%; }
  .pm-filter-row { flex-direction: column; }
  .pm-filter-row > * { width: 100%; }
  /* Kustomisasi responsive */
  .form-grid-layout { grid-template-columns: 1fr !important; }
  .fs-form-grid { grid-template-columns: 1fr !important; }
  .col-md-4, .col-md-6, .col-md-8 { width: 100% !important; }
}

/* ============================================================
   UTILITY CLASSES — Bootstrap-compatible aliases
   Dibutuhkan oleh halaman Kustomisasi (Flash Sale, Widget, dll)
   ============================================================ */

/* --- Flexbox --- */
.d-flex             { display: flex !important; }
.d-block            { display: block !important; }
.d-none             { display: none !important; }
.d-inline-flex      { display: inline-flex !important; }
.flex-column        { flex-direction: column !important; }
.flex-row           { flex-direction: row !important; }
.flex-wrap          { flex-wrap: wrap !important; }
.flex-1             { flex: 1 !important; }
.align-items-center { align-items: center !important; }
.align-items-start  { align-items: flex-start !important; }
.align-items-end    { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end     { justify-content: flex-end !important; }
.justify-content-center  { justify-content: center !important; }
.justify-content-start   { justify-content: flex-start !important; }
.flex-shrink-0      { flex-shrink: 0; }

/* --- Gap --- */
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 24px !important; }
.g-1   { gap: 4px !important; }
.g-2   { gap: 8px !important; }
.g-3   { gap: 12px !important; }
.g-4   { gap: 16px !important; }
.g-5   { gap: 24px !important; }

/* --- Margin --- */
.mb-0  { margin-bottom: 0 !important; }
.mb-1  { margin-bottom: 4px !important; }
.mb-2  { margin-bottom: 8px !important; }
.mb-3  { margin-bottom: 12px !important; }
.mb-4  { margin-bottom: 16px !important; }
.mb-5  { margin-bottom: 24px !important; }
.mt-0  { margin-top: 0 !important; }
.mt-1  { margin-top: 4px !important; }
.mt-2  { margin-top: 8px !important; }
.mt-3  { margin-top: 12px !important; }
.mt-4  { margin-top: 16px !important; }
.mt-5  { margin-top: 24px !important; }
.mr-1  { margin-right: 4px !important; }
.mr-2  { margin-right: 8px !important; }
.mr-3  { margin-right: 12px !important; }
.ml-1  { margin-left: 4px !important; }
.ml-2  { margin-left: 8px !important; }
.ml-auto { margin-left: auto !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* --- Padding --- */
.p-0   { padding: 0 !important; }
.p-1   { padding: 4px !important; }
.p-2   { padding: 8px !important; }
.p-3   { padding: 12px !important; }
.p-4   { padding: 16px !important; }
.p-5   { padding: 24px !important; }
.px-3  { padding-left: 12px !important; padding-right: 12px !important; }
.py-2  { padding-top: 8px !important; padding-bottom: 8px !important; }
.py-3  { padding-top: 12px !important; padding-bottom: 12px !important; }
.pl-4  { padding-left: 16px !important; }

/* --- Grid System (12 col) --- */
.row {
  display: flex !important;
  flex-wrap: wrap !important;
  margin-left: -8px !important;
  margin-right: -8px !important;
}
.row > [class*="col-"] {
  padding-left: 8px !important;
  padding-right: 8px !important;
  box-sizing: border-box;
}
.col-12  { width: 100%; }
.col-md-2 { width: 16.666%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.333%; }
.col-md-5 { width: 41.666%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.666%; }
.col-md-9 { width: 75%; }
.col-md-10 { width: 83.333%; }
.col-md-12 { width: 100%; }
.col-lg-4 { width: 33.333%; }

/* --- Typography --- */
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-left    { text-align: left !important; }
.text-sm      { font-size: 12px !important; }
.text-xs      { font-size: 11px !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--error) !important; }
.text-accent  { color: var(--accent-light) !important; }
.font-bold    { font-weight: 700 !important; }
.font-semibold { font-weight: 600 !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Sizing --- */
.w-100   { width: 100% !important; }
.w-50    { width: 50% !important; }
.h-100   { height: 100% !important; }

/* --- Border & Radius --- */
.rounded     { border-radius: var(--radius) !important; }
.rounded-full { border-radius: 9999px !important; }

/* --- Background --- */
.bg-elevated { background: var(--bg-elevated) !important; }
.bg-card     { background: var(--bg-card) !important; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer !important; }

/* --- Card body shorthand --- */
.card-body { padding: 16px; }

/* --- Toggle Switch (for checkbox toggles in forms) --- */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--text-muted); border-radius: 24px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* --- Responsive breakpoints for col-md-* --- */
@media (max-width: 768px) {
  .col-md-2, .col-md-3, .col-md-4,
  .col-md-5, .col-md-6, .col-md-8,
  .col-md-9, .col-md-10, .col-lg-4 {
    width: 100%;
  }
  .row { gap: 0; }
}

/* ============================================================
   ADMIN CONFIG — RESPONSIVE GRID CLASSES
   ============================================================ */

/* Grid children wajib min-width:0 agar tidak overflow container */
.cfg-grid-2 > *,
.cfg-grid-3 > *,
.cfg-grid-2-1 > *,
.cfg-seo-grid > * { min-width: 0; box-sizing: border-box; }

/* Grid accordion content: selalu bounded */
[id^="acc-content-"] {
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* 2-kolom (email+phone, sosmed) */
.cfg-grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 2fr+1fr (form + preview panel) */
.cfg-grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }

/* 3-kolom */
.cfg-grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* SEO grid */
.cfg-seo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }

.cfg-flex-logo { display: flex; gap: 24px; }
.cfg-flex-logo > div { flex: 1; min-width: 0; }

/* Benefit list item */
.benefit-item { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.benefit-item-info { flex: 1; min-width: 0; }
.benefit-item-info .bi-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.benefit-item-info .bi-desc  { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.benefit-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ── ≤ 900px: 1 kolom untuk semua form grids ─────────────── */
@media (max-width: 900px) {
  .cfg-grid-2,
  .cfg-grid-2-1,
  .cfg-seo-grid { grid-template-columns: 1fr !important; }
  .cfg-grid-3   { grid-template-columns: 1fr 1fr !important; }

  .cfg-preview-pane { display: none !important; }
  .cfg-flex-logo    { flex-direction: column; }
}

/* ── ≤ 540px: 3-col juga 1 kolom ───────────────────────────  */
@media (max-width: 540px) {
  .cfg-grid-3 { grid-template-columns: 1fr !important; }
}

/* ── ≤ 600px: benefit items & accordion buttons ─────────── */
@media (max-width: 600px) {
  .benefit-item   { flex-wrap: wrap; align-items: flex-start; }
  .benefit-item-info .bi-title,
  .benefit-item-info .bi-desc { white-space: normal; }
  .benefit-item-actions { width: 100%; justify-content: flex-end; margin-top: 6px; }

  [id^="acc-content-"] > div:last-child { flex-wrap: wrap; }
  [id^="acc-content-"] > div:last-child button { flex: 1; min-width: 120px; }
}

