
/* ==========================================================================
   Dashboard components: shell, charts, tables, filters
   ========================================================================== */
.sidebar-brand { padding: 4px 8px 14px; }
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--r-sm);
  background: var(--bg-soft); border: 1px solid var(--line-2); margin-bottom: 10px;
}
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 13.8px; font-weight: 620; color: var(--ink-2); transition: .16s;
}
.sidebar-nav a svg { width: 18px; height: 18px; flex: none; color: #7A8C82; }
.sidebar-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.sidebar-nav a.is-active { background: var(--green-100); color: var(--green-700); font-weight: 750; }
.sidebar-nav a.is-active svg { color: var(--green); }
.sidebar-sep { height: 1px; background: var(--line-2); margin: 10px 6px; }
.sidebar-foot { margin-top: auto; padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }

.dash-topbar {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.dash-topbar .tb-title { font-weight: 750; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-topbar .btn-icon { width: 38px; height: 38px; min-height: 38px; flex: none; }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(7,48,30,.42); z-index: 59; }
.sidebar-backdrop.is-open { display: block; }

@media (max-width: 899px) {
  .sidebar {
    display: flex; position: fixed; left: 0; top: 0; bottom: 0; z-index: 60; width: 282px;
    transform: translateX(-102%); transition: transform .26s cubic-bezier(.4,0,.2,1);
    height: 100vh; padding-top: 18px; box-shadow: 0 0 40px rgba(7,48,30,.2); overflow-y: auto;
  }
  .sidebar.is-open { transform: none; }
}
@media (min-width: 900px) {
  .dash { grid-template-columns: 264px minmax(0,1fr); }
  .sidebar { display: flex; }
  .dash-topbar { display: none; }
  .dash-main { padding: 26px 28px 60px; }
  .dash-head h1 { font-size: 27px; }
}

/* Charts */
.bars { display: flex; align-items: flex-end; gap: 6px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bar {
  width: 100%; max-width: 36px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, var(--green), var(--green-700));
  transition: height .5s cubic-bezier(.4,0,.2,1);
}
.bar-col:hover .bar { background: linear-gradient(180deg, var(--yellow-600), var(--yellow)); }
.bar-lbl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; }
.legend .li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .amt { margin-left: auto; font-weight: 750; font-variant-numeric: tabular-nums; }

.row-2 { display: grid; gap: 16px; }
@media (min-width: 800px) { .row-2 { grid-template-columns: 1.5fr 1fr; } }

/* Filter bar + pager */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-bar .input, .filter-bar .select { min-height: 38px; }
.filter-bar .label { font-size: 11.5px; margin-bottom: 4px; }
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px; border-top: 1px solid var(--line-2);
}
.page-btn {
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
}
.page-btn:hover:not(:disabled) { border-color: var(--green-300, #7CC4A2); color: var(--green-700); }
.page-btn.is-active { background: var(--green); border-color: var(--green); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Progress alias used in tables */
.progress > .progress-bar {
  display: block; height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--green), var(--green-500));
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* small utilities */
.ta-r { text-align: right; }
.mt-4 { margin-top: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-14 { margin-bottom: 14px; }
.gap-10 { gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Checkout bank options */
.bank-opt { display: block; cursor: pointer; position: relative; }
.bank-opt input { position: absolute; opacity: 0; pointer-events: none; }
.bank-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border: 1.5px solid var(--line);
  border-radius: var(--r); background: #fff; transition: .16s;
}
.bank-opt input:checked + .bank-card { border-color: var(--green); background: var(--green-50); box-shadow: 0 0 0 3px rgba(14,122,75,.09); }
.bank-card .bank-logo {
  width: 46px; height: 32px; border-radius: 6px; background: var(--bg-soft); display: grid; place-items: center;
  font-size: 10.5px; font-weight: 800; color: var(--green-800); flex: none;
}
.bank-card .bank-logo.bank-logo-img { width: 54px; height: 34px; background: #fff; border: 1px solid var(--line); padding: 4px 6px; box-sizing: border-box; overflow: hidden; }
.bank-card .bank-logo.bank-logo-img img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.bank-card .bank-info { min-width: 0; }
.bank-card .bank-name { font-size: 13.5px; font-weight: 700; }
.bank-card .bank-num { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Print-friendly report */
@media print {
  .sidebar, .dash-topbar, .filter-bar, .btn, .sidebar-backdrop, .toast-wrap { display: none !important; }
  .dash { display: block; background: #fff; }
  .dash-main { padding: 0; }
  .panel { break-inside: avoid; border: 1px solid #ddd; box-shadow: none; }
  body { background: #fff; }
}


/* ==========================================================================
   Media library, unggah gambar, dan embed YouTube (dashboard admin)
   ========================================================================== */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.media-grid-admin { padding: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

.media-cell, .media-card {
  display: flex; flex-direction: column; text-align: left; width: 100%;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.media-cell:hover, .media-card:hover { border-color: var(--green); box-shadow: 0 6px 18px rgba(10, 60, 40, .08); }
.media-cell-thumb, .media-card-thumb {
  display: block; aspect-ratio: 4 / 3; background: var(--green-50); overflow: hidden;
}
.media-cell-thumb img, .media-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-cell-name { padding: 7px 9px; font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-body { padding: 10px 12px 12px; }
.media-card-title { font-size: 13px; font-weight: 650; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.media-file {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--green-700);
}

.media-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 28px 18px; border: 2px dashed var(--line); border-radius: 14px;
  background: var(--green-50); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--green); background: var(--green-100); }
.dropzone .dz-ic { color: var(--green); }

.upload-bar { height: 6px; border-radius: 99px; background: var(--green-100); overflow: hidden; margin-top: 10px; }
.upload-bar > span { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

.imgfield { display: flex; gap: 12px; align-items: flex-start; }
.imgfield-preview {
  width: 148px; aspect-ratio: 4 / 3; flex: none; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line); background: var(--green-50); display: grid; place-items: center;
}
.imgfield-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.imgfield-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; }
.imgfield-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.yt-preview {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 14px;
  padding: 10px; border-radius: 11px; background: var(--green-50); border: 1px solid var(--line);
}
.yt-preview img { width: 128px; height: 72px; object-fit: cover; border-radius: 8px; display: block; }
.yt-embed { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.file-list { display: grid; gap: 6px; }
.file-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--green-50); font-size: 12.5px; }
.file-ic { display: inline-flex; color: var(--green); flex: none; }

/* Picker media dibuka di atas modal form: overlay bertingkat */
.modal-backdrop.modal-stack { z-index: 140; }
