/* Panel admin CMS Kabupaten Buton */
:root{
  --sidebar:#0f2450;
  --sidebar-hover:#17316b;
  --sidebar-active:#1d4ed8;
  --accent:#f5b301;
  --ink:#1f2937;
}

body.admin-page{background:#f1f5f9;color:var(--ink);font-family:"Segoe UI",Roboto,Arial,sans-serif;font-size:.92rem}

.admin-shell{display:flex;min-height:100vh}

/* Sidebar */
.admin-sidebar{width:250px;background:var(--sidebar);color:#cbd5e1;display:flex;flex-direction:column;position:fixed;top:0;bottom:0;left:0;z-index:1040;transition:.25s}
.sidebar-brand{display:flex;align-items:center;gap:.6rem;padding:1rem 1.1rem;border-bottom:1px solid rgba(255,255,255,.08);color:#fff;font-weight:700;font-size:.95rem;line-height:1.2}
.sidebar-nav{flex:1;overflow-y:auto;padding:.75rem .6rem}
.sidebar-group{text-transform:uppercase;font-size:.68rem;letter-spacing:.14em;color:#7f9cc9;margin:1rem .6rem .4rem}
.sidebar-nav a{display:flex;align-items:center;gap:.7rem;padding:.55rem .7rem;border-radius:.5rem;color:#cbd5e1;text-decoration:none;font-weight:500;margin-bottom:.15rem;transition:.15s}
.sidebar-nav a i{width:18px;text-align:center;font-size:.92rem}
.sidebar-nav a:hover{background:rgba(255,255,255,.08);color:#fff}
.sidebar-nav a.active{background:var(--sidebar-active);color:#fff;box-shadow:0 4px 12px rgba(29,78,216,.35)}
.sidebar-footer{padding:.9rem 1.1rem;border-top:1px solid rgba(255,255,255,.08)}
.sidebar-footer a{color:#93b4e6;text-decoration:none;font-size:.85rem}
.sidebar-footer a:hover{color:#fff}

/* Main */
.admin-main{flex:1;margin-left:250px;display:flex;flex-direction:column;min-width:0}
.admin-topbar{background:#fff;border-bottom:1px solid #e2e8f0;padding:.6rem 1.25rem;display:flex;align-items:center;gap:1rem;position:sticky;top:0;z-index:1030}
.admin-content{padding:1.5rem}

/* Kartu & tabel */
.card{border:0;box-shadow:0 1px 3px rgba(15,23,42,.06);border-radius:.7rem}
.card-header{background:#fff;border-bottom:1px solid #eef2f7;font-weight:700;border-radius:.7rem .7rem 0 0!important}
.table thead th{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:#64748b;background:#f8fafc}
.table-hover tbody tr:hover{background:#f8fbff}
.avatar-sm{width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:#e2e8f0;color:#475569}

.stat-card{border:0;border-radius:.8rem;box-shadow:0 1px 3px rgba(15,23,42,.08);overflow:hidden}
.stat-card .stat-icon{width:56px;height:56px;border-radius:.8rem;display:flex;align-items:center;justify-content:center;font-size:1.35rem}
.stat-card .stat-value{font-size:1.5rem;font-weight:800;line-height:1.1}
.stat-card .stat-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.07em;color:#94a3b8}

.page-title{font-weight:800;color:#0f172a;margin-bottom:.15rem}
.page-subtitle{color:#64748b;font-size:.9rem;margin-bottom:1.25rem}
.toolbar{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;justify-content:space-between;margin-bottom:1rem}

.btn-primary{background:#1d4ed8;border-color:#1d4ed8}
.btn-primary:hover,.btn-primary:focus{background:#1e40af;border-color:#1e40af}

/* Palet status seragam lintas modul (rekomendasi butir 19):
   Terbit/Aktif=hijau, Draf/Nonaktif=abu, Terjadwal=biru, Sampah/Gagal=merah */
.badge-active{background:#dcfce7;color:#166534}
.badge-draft{background:#e5e7eb;color:#374151}
.badge-scheduled{background:#dbeafe;color:#1e40af}
.badge-inactive{background:#fee2e2;color:#991b1b}

.icon-btn{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:.45rem;border:1px solid #e2e8f0;background:#fff;color:#475569;text-decoration:none}
.icon-btn:hover{background:#f1f5f9;color:#1d4ed8}
.icon-btn.danger:hover{background:#fee2e2;color:#b91c1c;border-color:#fecaca}

.thumb{width:56px;height:40px;object-fit:cover;border-radius:.35rem;background:#e2e8f0}

/* Form */
.form-label{font-weight:600;font-size:.85rem;color:#334155}
.form-control,.form-select{border-radius:.45rem;font-size:.92rem}
.form-control:focus,.form-select:focus{border-color:#93c5fd;box-shadow:0 0 0 .18rem rgba(59,130,246,.15)}
.required-star{color:#dc2626}

/* Responsif */
@media (max-width: 991.98px){
  .admin-sidebar{transform:translateX(-100%)}
  .admin-sidebar.show{transform:translateX(0)}
  .admin-main{margin-left:0}
}

/* =========================================================================
   Rekomendasi tampilan panel (docs/rekomendasi-panel-admin.md)
   ========================================================================= */

/* --- Kartu identitas situs aktif di kepala sidebar (butir 1) --- */
.site-card{display:block;padding:.85rem .95rem}
.site-card-row{display:flex;align-items:center;gap:.55rem;min-width:0}
.site-card-name{font-weight:700;font-size:.9rem;line-height:1.25;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.site-card-domain{display:block;font-size:.73rem;color:#93b4e6;text-decoration:none;word-break:break-all;margin-top:.25rem}
.site-card-domain:hover{color:#fff}
.site-card-tags{display:flex;flex-wrap:wrap;gap:.3rem;margin-top:.45rem}
.site-card-tags span{font-size:.64rem;background:rgba(255,255,255,.1);color:#cbd5e1;padding:.1rem .5rem;border-radius:999px;letter-spacing:.03em}
.site-card-open{display:inline-flex;align-items:center;gap:.4rem;margin-top:.6rem;font-size:.78rem;font-weight:600;color:#fcd34d;text-decoration:none}
.site-card-open:hover{color:#fde68a}

/* --- Sub-bagian menu Konten (butir 6-7) --- */
.sidebar-sub{margin-bottom:.1rem}
.sidebar-sub-head{display:flex;align-items:center;justify-content:space-between;width:100%;background:none;border:0;color:#7f9cc9;font-size:.67rem;text-transform:uppercase;letter-spacing:.12em;padding:.6rem .7rem .25rem;cursor:pointer;transition:color .15s}
.sidebar-sub-head:hover{color:#cbd5e1}
.sidebar-sub-head i{font-size:.58rem;transition:transform .2s}
.sidebar-sub.open>.sidebar-sub-head i{transform:rotate(180deg)}
.sidebar-sub-items{display:none}
.sidebar-sub.open>.sidebar-sub-items{display:block}
.sidebar-nav a .side-badge{margin-left:auto;background:#f5b301;color:#3b2f00;font-size:.65rem;font-weight:800;padding:.05rem .42rem;border-radius:999px;min-width:18px;text-align:center;line-height:1.35}

/* --- Breadcrumb (butir 18) --- */
.crumbbar{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;font-size:.82rem;margin-bottom:.9rem;color:#64748b}
.crumbbar a{color:#1d4ed8;text-decoration:none}
.crumbbar a:hover{text-decoration:underline;color:#1e40af}
.crumbbar .crumb-current{color:#0f172a;font-weight:600}
.crumbbar .crumb-sep{color:#94a3b8;font-size:.55rem}

/* --- Pita konteks lingkup superadmin (butir 2) --- */
.scope-strip{background:#fef9c3;color:#713f12;border:1px solid #fde68a;border-radius:.5rem;padding:.5rem .85rem;font-size:.85rem;margin-bottom:.8rem}

/* --- Toast seragam (butir 17) --- */
#flashToasts .toast{border-radius:.6rem;overflow:hidden;box-shadow:0 10px 26px rgba(15,23,42,.22)}
.toast-body{display:flex;align-items:center;gap:.3rem;font-weight:600;font-size:.9rem}
.toast-success{background:#16a34a;color:#fff}
.toast-error{background:#dc2626;color:#fff}
.toast-warning{background:#d97706;color:#fff}

/* --- Empty state terpandu (butir 10) --- */
.empty-state{text-align:center;padding:2.6rem 1.5rem}
.empty-icon{width:64px;height:64px;margin:0 auto 1rem;border-radius:50%;background:#eef2f7;color:#94a3b8;display:flex;align-items:center;justify-content:center;font-size:1.5rem}
.empty-text{font-weight:700;color:#0f172a;font-size:1rem;max-width:520px;margin-left:auto;margin-right:auto}
.empty-hint{color:#64748b;font-size:.87rem;max-width:520px;margin-left:auto;margin-right:auto}

/* --- Tombol simpan menempel (butir 12) --- */
.form-actions{position:sticky;bottom:0;background:#fff;border-top:1px solid #e2e8f0;padding:.8rem 0 .9rem;margin-top:1.4rem;z-index:1020;box-shadow:0 -6px 16px rgba(15,23,42,.07)}

/* --- Pratinjau slug langsung (butir 13) --- */
.slug-live{display:flex;flex-wrap:wrap;gap:.45rem;align-items:center;margin-top:.4rem}
.slug-live[hidden]{display:none}
.slug-preview{background:#f1f5f9;color:#1d4ed8;padding:.1rem .45rem;border-radius:.3rem;word-break:break-all;font-size:.8rem}
.slug-status{font-weight:600;font-size:.78rem}
.slug-status.ok{color:#16a34a}
.slug-status.warn{color:#b45309}

/* --- Pemilih Media Library (butir 15) --- */
.media-pick-row{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.media-pick-info{display:inline-flex;align-items:center;gap:.5rem}
.media-pick-info[hidden]{display:none}
.media-pick-info .thumb{width:44px;height:32px}
#mediaPickerGrid .media-cell{cursor:pointer;border:2px solid transparent;border-radius:.5rem;overflow:hidden;background:#f1f5f9;padding:0;display:block;width:100%;text-align:center}
#mediaPickerGrid .media-cell:hover{border-color:#1d4ed8}
#mediaPickerGrid .media-cell img{width:100%;height:84px;object-fit:cover;display:block}
#mediaPickerGrid .media-cell span{display:block;font-size:.66rem;color:#64748b;padding:.25rem .3rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* --- Checklist kelengkapan situs (butir 3) --- */
.check-percent{font-size:1.7rem;font-weight:800;color:#16a34a;line-height:1}
.check-item{display:flex;align-items:center;gap:.7rem;padding:.55rem 0;border-bottom:1px dashed #e2e8f0}
.check-item:last-child{border-bottom:0}
.check-item .check-icon{width:22px;text-align:center;color:#cbd5e1;font-size:.95rem}
.check-item.ok .check-icon{color:#16a34a}
.check-label{font-weight:600;font-size:.88rem;color:#0f172a}
.check-hint{line-height:1.35}

/* --- Grafik kunjungan 14 hari (butir 4) --- */
.visit-chart{display:flex;align-items:flex-end;gap:.3rem;height:170px}
.vc-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;min-width:0}
.vc-bar-track{flex:1;width:100%;display:flex;align-items:flex-end;justify-content:center}
.vc-bar{width:70%;max-width:26px;background:linear-gradient(180deg,#3b82f6,#1d4ed8);border-radius:3px 3px 0 0;min-height:2px;transition:height .3s}
.vc-label{font-size:.55rem;color:#94a3b8;margin-top:.35rem;white-space:nowrap}

/* --- Mode kartu di layar kecil (butir 20) --- */
@media (max-width: 767.98px){
  .admin-content table.table thead{display:none}
  .admin-content table.table,
  .admin-content table.table tbody,
  .admin-content table.table tr,
  .admin-content table.table td{display:block;width:auto}
  .admin-content table.table tr{border:1px solid #e2e8f0;border-radius:.6rem;background:#fff;margin:0 0 .7rem;padding:.4rem .2rem;box-shadow:0 1px 2px rgba(15,23,42,.05)}
  .admin-content table.table td{display:flex;justify-content:space-between;align-items:center;gap:1rem;border:0;padding:.35rem .8rem;text-align:right;font-size:.87rem}
  .admin-content table.table td::before{content:attr(data-label);font-size:.68rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;font-weight:700;text-align:left;flex:0 0 auto}
  .admin-content table.table td.text-end{justify-content:space-between}
  .visit-chart{gap:.15rem;height:130px}
  .vc-label{font-size:.45rem}
}

/* --- Mode gelap (butir 21) --- */
[data-bs-theme="dark"] body.admin-page{background:#0b1220;color:#e2e8f0}
[data-bs-theme="dark"] .admin-topbar{background:#111a2e;border-color:#1e293b}
[data-bs-theme="dark"] .admin-topbar .dropdown-toggle{color:#e2e8f0!important}
[data-bs-theme="dark"] .card{background:#111a2e;box-shadow:none;border:1px solid #1e293b}
[data-bs-theme="dark"] .card-header{background:#111a2e;border-color:#1e293b;color:#e2e8f0}
[data-bs-theme="dark"] .card-footer{background:#0f172a;border-color:#1e293b}
[data-bs-theme="dark"] .page-title{color:#f1f5f9}
[data-bs-theme="dark"] .page-subtitle{color:#94a3b8}
[data-bs-theme="dark"] .table thead th{background:#0f172a;color:#94a3b8}
[data-bs-theme="dark"] .table td{border-color:#1e293b;color:#cbd5e1}
[data-bs-theme="dark"] .table-hover tbody tr:hover{background:#0f172a}
[data-bs-theme="dark"] .form-label{color:#cbd5e1}
[data-bs-theme="dark"] .form-actions{background:#111a2e;border-color:#1e293b;box-shadow:0 -6px 16px rgba(0,0,0,.35)}
[data-bs-theme="dark"] .icon-btn{background:#0f172a;border-color:#334155;color:#cbd5e1}
[data-bs-theme="dark"] .icon-btn:hover{background:#1e293b;color:#93c5fd}
[data-bs-theme="dark"] .avatar-sm{background:#1e293b;color:#cbd5e1}
[data-bs-theme="dark"] .crumbbar{color:#8ba0b8}
[data-bs-theme="dark"] .crumbbar a{color:#93c5fd}
[data-bs-theme="dark"] .crumbbar .crumb-current{color:#f1f5f9}
[data-bs-theme="dark"] .scope-strip{background:#3a2f06;color:#fcd34d;border-color:#715c0a}
[data-bs-theme="dark"] .empty-icon{background:#1e293b;color:#64748b}
[data-bs-theme="dark"] .empty-text{color:#f1f5f9}
[data-bs-theme="dark"] .empty-hint{color:#94a3b8}
[data-bs-theme="dark"] .slug-preview{background:#0f172a;color:#93c5fd}
[data-bs-theme="dark"] .check-label{color:#e2e8f0}
[data-bs-theme="dark"] .check-item{border-color:#1e293b}
[data-bs-theme="dark"] .check-hint,
[data-bs-theme="dark"] .check-item+.small.text-muted{color:#8ba0b8}
[data-bs-theme="dark"] .badge-active{background:#14532d;color:#86efac}
[data-bs-theme="dark"] .badge-draft{background:#334155;color:#cbd5e1}
[data-bs-theme="dark"] .badge-scheduled{background:#1e3a8a;color:#93c5fd}
[data-bs-theme="dark"] .badge-inactive{background:#7f1d1d;color:#fca5a5}
[data-bs-theme="dark"] .progress{background:#1e293b}
[data-bs-theme="dark"] .vc-bar{background:linear-gradient(180deg,#60a5fa,#2563eb)}
[data-bs-theme="dark"] .vc-label{color:#64748b}
[data-bs-theme="dark"] .dropdown-menu{background:#111a2e;border-color:#1e293b}
[data-bs-theme="dark"] .dropdown-item{color:#e2e8f0}
[data-bs-theme="dark"] .dropdown-item:hover{background:#1e293b;color:#fff}
[data-bs-theme="dark"] .dropdown-item-text{color:#8ba0b8!important}
[data-bs-theme="dark"] .list-group-item{background:#111a2e;color:#cbd5e1;border-color:#1e293b}
[data-bs-theme="dark"] .alert-danger{background:#3f1212;border-color:#7f1d1d;color:#fecaca}
[data-bs-theme="dark"] #mediaPickerGrid .media-cell{background:#0f172a}
[data-bs-theme="dark"] #mediaPickerGrid .media-cell span{color:#94a3b8}
[data-bs-theme="dark"] .thumb{background:#1e293b}
[data-bs-theme="dark"] .sidebar-footer a{color:#93b4e6}
@media (max-width: 767.98px){
  [data-bs-theme="dark"] .admin-content table.table tr{background:#111a2e;border-color:#1e293b}
  [data-bs-theme="dark"] .admin-content table.table td::before{color:#8ba0b8}
}
