/* sidebar override di atas index.css referensi */
body{display:flex;min-width:0;overflow-x:hidden}
.sidebar{width:220px;flex-shrink:0;position:sticky;top:0;height:100vh;overflow-y:auto;background:rgba(10,15,26,.9);border-right:1px solid var(--border-color);padding:1rem .6rem}
.app-container{flex:1;max-width:none;width:100%;min-width:0;box-sizing:border-box}
.dashboard-content{min-width:0}
.glass-panel,.product-section,.chart-section,.kpi-grid{min-width:0}
.side-label{font-size:.72rem;letter-spacing:.08em;font-weight:700;color:var(--text-muted);text-transform:uppercase;padding:1rem .8rem .4rem}
.side-link{display:flex;align-items:center;gap:.65rem;padding:.55rem .8rem;border-radius:8px;font-size:.84rem;font-weight:500;color:var(--text-muted);text-decoration:none;transition:all .15s ease}
.side-link:hover{background:rgba(255,255,255,.05);color:#fff}
.side-link.active{background:rgba(255,255,255,.08);color:#fff;font-weight:600;box-shadow:none;border:1px solid rgba(255,255,255,.12)}
.side-link.maint{color:var(--text-dim)}
.hidden{display:none !important}
[data-theme="light"] .sidebar{background:rgba(255,255,255,.9)}
/* Brand modal & overlay */
.modal-overlay{position:fixed;inset:0;z-index:9999;background:rgba(5,9,18,.75);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);display:flex;align-items:center;justify-content:center;padding:1rem}
.brand-modal{width:100%;max-width:440px;background:#0f172a;border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:1.5rem;box-shadow:var(--shadow-lg);animation:modalIn .15s ease-out}
@keyframes modalIn{from{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}
.brand-modal h2{font-size:1.15rem;font-weight:700;color:#fff;margin-bottom:.75rem;letter-spacing:-.3px}
.brand-modal p{font-size:.85rem;color:#94a3b8;line-height:1.5;margin-bottom:1.25rem}
.brand-modal select,.brand-modal input{width:100%;height:40px;padding:0 .9rem;background:#1e293b;border:1px solid rgba(255,255,255,.12);border-radius:8px;color:#fff;font:500 .85rem var(--font-main);outline:none;margin-bottom:1.25rem;transition:border-color .15s}
.brand-modal select:focus,.brand-modal input:focus{border-color:#38bdf8}
.brand-modal .modal-actions{display:flex;justify-content:flex-end;gap:.6rem}
.brand-modal .modal-actions button{height:36px;padding:0 1.1rem;border-radius:8px;font:600 .82rem var(--font-main);cursor:pointer;border:1px solid transparent;transition:all .15s}
.brand-modal #brandCancel{background:transparent;border-color:rgba(255,255,255,.1);color:#94a3b8}
.brand-modal #brandCancel:hover{background:rgba(255,255,255,.05);color:#fff}
.brand-modal #brandConfirm{background:#0284c7;color:#fff}
.brand-modal #brandConfirm:hover{background:#0369a1}
.brand-modal #brandConfirm.danger-btn{background:#e11d48;color:#fff;border:none}
.brand-modal #brandConfirm.danger-btn:hover{background:#be123c}

/* Light mode for modal */
[data-theme="light"] .brand-modal{background:#ffffff;border-color:#e2e8f0;box-shadow:0 20px 25px -5px rgba(0,0,0,.1)}
[data-theme="light"] .brand-modal h2{color:#0f172a}
[data-theme="light"] .brand-modal p{color:#64748b}
[data-theme="light"] .brand-modal select,[data-theme="light"] .brand-modal input{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
[data-theme="light"] .brand-modal #brandCancel{border-color:#cbd5e1;color:#64748b}

.brand-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-control select {
  height: 38px;
  padding: 0 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
}

.brand-actions button {
  height: 38px;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap !important;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.brand-actions button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-actions .danger-btn {
  border-color: rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.brand-actions .danger-btn:hover {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.6);
}
.help-tip{position:relative;cursor:help;color:var(--text-muted);font-size:.72rem;margin-left:.25rem}
.help-tip::after{content:attr(data-tip);position:absolute;z-index:20;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%);width:240px;padding:8px 10px;border:1px solid var(--border-color);border-radius:7px;background:#111827;color:#f3f4f6;font-size:.72rem;line-height:1.45;font-weight:500;text-align:left;white-space:normal;opacity:0;pointer-events:none;transition:opacity .15s}
.help-tip::before{content:'';position:absolute;z-index:21;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%);border:5px solid transparent;border-top-color:#111827;opacity:0;pointer-events:none}
.help-tip:hover::after,.help-tip:hover::before,.help-tip:focus::after,.help-tip:focus::before{opacity:1}

/* ========== DATE RANGE SELECTOR & SLIDER STYLES ========== */
.month-tabs-container {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  margin-bottom: 0.85rem !important;
  width: 100% !important;
}

.date-filter-panel {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1rem;
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 1.25rem;
}

.table-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  box-sizing: border-box !important;
}

.dropdown-controls-group {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.channel-select-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: 12px;
  height: 44px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
}

.channel-select-box select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  padding: 0.35rem 1.8rem 0.35rem 0.65rem;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55rem center;
  background-size: 0.85rem;
  min-width: 180px;
  transition: border-color 0.2s;
}

.channel-select-box select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.preset-buttons {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.preset-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: 600 0.76rem var(--font-main);
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.preset-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.preset-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.date-divider-v {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.date-manual-inputs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.date-input-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 500;
}

.date-input-item input[type="date"] {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  color: #fff;
  padding: 0.32rem 0.5rem;
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
  color-scheme: dark;
}

.date-input-item input[type="date"]:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.date-slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 240px;
  flex: 1 1 auto;
  padding: 0 0.5rem;
}

.dual-slider-track {
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  margin: 8px 0;
}

.slider-highlight-bar {
  position: absolute;
  height: 100%;
  background: #0284c7;
  border-radius: 3px;
  pointer-events: none;
}

.dual-slider-track input[type="range"] {
  position: absolute;
  left: 0;
  top: -6px;
  width: 100%;
  height: 18px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  margin: 0;
}

.dual-slider-track input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: grab;
  transition: transform 0.1s;
}

.dual-slider-track input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.dual-slider-track input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.slider-info-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.slider-badge-pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1px 7px;
  border-radius: 6px;
  font-weight: 600;
}

/* ========== STAGED UPLOAD PREVIEW STYLES ========== */
.staged-preview-card {
  margin-top: 1.25rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 14px;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: modalIn 0.2s ease-out;
}

.staged-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.staged-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-clear-staged {
  background: transparent;
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clear-staged:hover {
  background: rgba(248, 113, 113, 0.15);
}

.staged-meta-box {
  display: flex;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.staged-meta-box b {
  color: var(--text-dim);
}

.staged-meta-box span {
  color: #fff;
  font-weight: 600;
  margin-left: 0.3rem;
}

.staged-file-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding-right: 0.25rem;
}

.staged-file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  color: #e2e8f0;
}

.staged-file-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staged-file-size {
  color: var(--text-dim);
  font-size: 0.72rem;
}

.btn-remove-file {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-remove-file:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15);
}

.staged-action-bar {
  display: flex;
  justify-content: flex-end;
}

.btn-upload-submit {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-upload-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  opacity: 0.95;
}

.btn-upload-submit:active {
  transform: translateY(0);
}

/* ========== DAILY TREND COMPONENT STYLES ========== */
.trend-card-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.trend-card {
  padding: 1.5rem;
  border-radius: 16px;
  position: relative;
}

.trend-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.trend-title-area h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trend-title-area p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.trend-metric-switcher {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.3rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.trend-metric-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: 600 0.78rem var(--font-main);
  padding: 0.4rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.trend-metric-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.trend-metric-btn.active {
  color: #fff;
  background: var(--primary-gradient);
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.trend-badges-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.trend-badge-card {
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.trend-badge-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trend-badge-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.trend-badge-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trend-chart-box {
  height: 360px;
  position: relative;
  width: 100%;
}

/* Klasifikasi Badge & Column Polish */
.cls-badge-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.cls-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.cls-help {
  font-size: 0.72rem;
  color: var(--text-dim);
  opacity: 0.75;
  transition: opacity 0.15s;
  cursor: help;
}

.cls-help:hover {
  opacity: 1;
  color: #fff;
}

/* Kolom tabel presisi */
/* Date Filter Buttons */
.btn-filter-apply {
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.3);
}

.btn-filter-apply:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-filter-reset {
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-filter-reset:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Brand Table Badge */
.brand-table-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Center column headers & cells for Brand & Klasifikasi */
.product-table th[data-sort="brand"],
.product-table td:nth-child(3) {
  text-align: center !important;
}

.product-table th[data-sort="cls"],
.product-table td:nth-child(4) {
  text-align: center !important;
}

.kpi-value {
  font-size: 1.45rem !important;
  white-space: nowrap !important;
}

/* Full Width Subcards in Accordion */
.detail-row td {
  padding: 0.75rem 0 !important;
  width: 100% !important;
}

.detail-container {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}

.detail-content {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 1rem 1rem 1.25rem 1.25rem !important;
}

.detail-grid {
  display: grid !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
  gap: 0.85rem !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.detail-subcard {
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

/* Border Aksen Warna Subcard Saluran */
.detail-subcard.seller-live {
  border-top: 3px solid #34d399 !important;
  background: rgba(52, 211, 153, 0.04) !important;
}
.detail-subcard.seller-video {
  border-top: 3px solid #38bdf8 !important;
  background: rgba(56, 189, 248, 0.04) !important;
}
.detail-subcard.seller-card {
  border-top: 3px solid #818cf8 !important;
  background: rgba(129, 140, 248, 0.04) !important;
}
.detail-subcard.affiliate-live {
  border-top: 3px solid #fbbf24 !important;
  background: rgba(251, 191, 36, 0.04) !important;
}
.detail-subcard.affiliate-video {
  border-top: 3px solid #fb923c !important;
  background: rgba(251, 146, 60, 0.04) !important;
}
.detail-subcard.affiliate-showcase {
  border-top: 3px solid #f472b6 !important;
  background: rgba(244, 114, 182, 0.04) !important;
}

/* Funnel Pill Badge */
.funnel-pill-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.product-table th, .product-table td {
  vertical-align: middle;
  padding: 0.7rem 0.45rem !important;
}

.product-table th {
  font-size: 0.72rem !important;
  letter-spacing: 0.3px !important;
}

.product-table td {
  font-size: 0.8rem !important;
}

.product-name-cell {
  max-width: 240px !important;
}

/* ==============================================================================
   META ADS & SETTINGS COMPONENT STYLES
   ============================================================================== */
.settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-radius: 14px;
}

.settings-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
}

.settings-header p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.settings-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--accent-cyan);
  border-radius: 9999px;
}

.integration-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.25rem;
}

.integration-card {
  padding: 1.5rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.integration-card.coming-soon {
  opacity: 0.7;
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.platform-identity {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.platform-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

.platform-identity h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.platform-identity p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.connection-status-pill {
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.connection-status-pill.connected {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: #34d399;
}

.connection-status-pill.disconnected {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.active-connection-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.active-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.active-info-row .label {
  color: var(--text-dim);
}

.active-btn-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-goto-ads {
  flex: 1;
  padding: 0.45rem 0.85rem;
  background: #0284c7;
  color: #fff;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-goto-ads:hover {
  background: #0369a1;
}

.btn-disconnect {
  padding: 0.45rem 0.85rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fb7185;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-disconnect:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
}

.integration-form-section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.25rem;
}

.form-group-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group-row label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-dim);
}

.form-group-row input, .form-group-row select {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: #fff;
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.8rem;
  outline: none;
}

.btn-verify {
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-save-conn {
  width: 100%;
  padding: 0.55rem;
  background: #0284c7;
  color: #fff;
  border: 1px solid #0369a1;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-save-conn:hover {
  background: #0369a1;
}

.help-text-box {
  font-size: 0.74rem;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.65rem;
  line-height: 1.45;
}

/* ADS TOP HEADER */
.ads-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 14px;
  margin-bottom: 1.5rem;
}

.ads-header-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.ads-platform-pill.meta {
  padding: 0.25rem 0.65rem;
  background: rgba(2, 132, 199, 0.15);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #38bdf8;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.ads-acc-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.ads-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sync-time-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.btn-sync-ads {
  padding: 0.4rem 0.85rem;
  background: #0284c7;
  border: 1px solid #0369a1;
  color: #fff;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-sync-ads:hover {
  background: #0369a1;
}

.btn-gear-settings {
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
}

.status-badge.active {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.status-badge.paused {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
}

.obj-badge {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: monospace;
}

/* ==========================================================================
   NON-DESTRUCTIVE RESPONSIVE STYLES
   Scope terisolasi: hanya aktif di layar tablet & mobile (<= 1024px & <= 768px).
   Desktop (> 1024px) 100% menggunakan styling bawaan tanpa terpengaruh.
   ========================================================================== */

/* 1. TABLET & LAPTOP RINGKAS (<= 1024px) */
@media (max-width: 1024px) {
  .dashboard-header {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
  }
  
  .header-right {
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    width: 100%;
  }

  .month-tabs-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .date-filter-panel {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .channel-inline-box {
    margin-left: auto;
  }

  .date-slider-container {
    flex: 1;
    min-width: 200px;
  }

  .trend-badges-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .kpi-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* 2. MOBILE & SMARTPHONE (<= 768px) */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
  }

  .sidebar .side-label {
    display: none; /* Sembunyikan label kategori di bar mobile */
  }

  .sidebar .side-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }

  .sidebar > div:first-child {
    width: 100%;
    padding: 0.2rem 0 0.5rem !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .app-container {
    width: 100%;
    min-width: 0;
    padding: 0.75rem;
  }

  .brand-control {
    flex-wrap: wrap;
    width: 100%;
  }

  .brand-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .date-filter-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.75rem;
    flex-wrap: wrap;
  }

  .channel-inline-box {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .channel-inline-box select {
    width: auto;
    flex: 1;
  }

  .preset-buttons {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 0.25rem;
  }

  .date-divider-v {
    display: none;
  }

  .date-manual-inputs {
    justify-content: space-between;
    width: 100%;
  }

  .date-input-item input[type="date"] {
    width: 130px;
    font-size: 0.75rem;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem;
  }

  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.25rem !important;
  }

  .chart-tab-controls {
    overflow-x: auto;
    white-space: nowrap;
    width: 100%;
    justify-content: flex-start;
  }

  .trend-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .trend-metric-switcher {
    overflow-x: auto;
    width: 100%;
    justify-content: flex-start;
  }

  .trend-badges-row {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .trend-chart-box {
    height: 280px;
  }

  /* Table horizontal scroll container safe-guard */
  .table-container {
    width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  .product-table {
    min-width: 720px; /* Jaga agar kolom tabel tetap terbaca jelas saat di-scroll */
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .filter-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .search-box, .filter-box {
    width: 100%;
  }

  .search-box input, .filter-box select {
    width: 100% !important;
  }

  .upload-form-grid {
    grid-template-columns: 1fr !important;
  }

  .upload-mode-switcher {
    flex-direction: column;
  }
}



