/* ===== Admin theme (CoreUI-inspired) ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary:#321fdb; --primary-d:#2a1ab8;
  --info:#3399ff; --success:#2eb85c; --warning:#f9b115; --danger:#e55353; --dark:#4f5d73;
  --sidebar:#2c384a; --sidebar-2:#303c54; --sidebar-brand:#212333;
  --body:#ebedef; --border:#d8dbe0; --text:#3c4b64; --muted:#8a93a2; --card:#fff;
}
body {
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--body); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
h1,h2,h3 { font-weight: 600; }

/* Layout */
.wrap { display: flex; min-height: 100vh; }
.sidebar { width: 256px; background: var(--sidebar); position: fixed; inset: 0 auto 0 0; overflow-y: auto; }
.brand { padding: 0 16px; height: 56px; display: flex; align-items: center; gap: 10px; background: var(--sidebar-brand); color: #fff; font-weight: 600; font-size: 15px; }
.brand small { display:block; font-weight:400; font-size:10px; color:#8a93a2; }
.menu { list-style: none; padding: 12px 0; }
.menu li { margin: 1px 0; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: rgba(255,255,255,.6); font-size: 14px; transition: all .15s; border-left: 3px solid transparent; }
.menu a:hover { color: #fff; background: rgba(255,255,255,.05); }
.menu a.active { color: #fff; background: rgba(255,255,255,.05); border-left-color: var(--primary); }
.menu .ico { width: 20px; text-align: center; font-size: 15px; opacity:.85; }

.main { flex: 1; margin-left: 256px; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); height: 56px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 500; }
.topbar h1 { font-size: 16px; color: var(--text); font-weight: 500; }
.topbar .user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.topbar .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 600; font-size: 14px; }
.topbar .user b { color: var(--text); }
.content { padding: 24px; }

/* Stat widgets (solid color, CoreUI style) */
.stats { display: grid; grid-template-columns: repeat(auto-fill,minmax(210px,1fr)); gap: 22px; margin-bottom: 24px; }
.stat { border-radius: 6px; padding: 16px 18px; color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,21,.08); }
.stat .ic { position: absolute; right: 10px; top: 8px; font-size: 40px; opacity: .22; }
.stat .n { font-size: 26px; font-weight: 700; line-height: 1.1; z-index: 1; }
.stat .l { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .9; margin-top: 3px; z-index: 1; }
.stat.c-primary { background: linear-gradient(45deg,#2a1ab8,#321fdb); }
.stat.c-info    { background: linear-gradient(45deg,#2982cc,#3399ff); }
.stat.c-success { background: linear-gradient(45deg,#1b9e3e,#2eb85c); }
.stat.c-warning { background: linear-gradient(45deg,#f6960b,#f9b115); }
.stat.c-danger  { background: linear-gradient(45deg,#d93737,#e55353); }
.stat.c-dark    { background: linear-gradient(45deg,#3a4453,#4f5d73); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 24px; }
.card .hd { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 15px; background: rgba(0,0,21,.02); border-radius: 6px 6px 0 0; }
.card .hd .muted { font-weight: 400; }
.card .bd { padding: 18px; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--border); }
tbody tr:hover td { background: #f0f4f7; }
tbody tr:last-child td { border-bottom: none; }

/* Badge */
.badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; color:#fff; }
.b-pending { background: var(--warning); color:#2a2100; }
.b-diterima { background: var(--success); }
.b-selesai { background: var(--info); }
.b-ditolak { background: var(--danger); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; border: 1px solid transparent; cursor: pointer; font-size: 13px; font-weight: 500; transition: all .15s; font-family: inherit; line-height: 1.4; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); }
.btn-gold, .btn-warning { background: var(--warning); color: #2a2100; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #d93737; }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: #f0f4f7; }

/* Forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #b1b7c1; border-radius: 6px; font-size: 14px; font-family: inherit; color: var(--text); background:#fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #7ea9b8; box-shadow: 0 0 0 3px rgba(50,31,219,.18); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.actions { display: flex; gap: 6px; align-items: center; }
.actions form { display: inline; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input[type=text] { flex: 1; min-width: 200px; padding: 9px 12px; border: 1px solid #b1b7c1; border-radius: 6px; font-size: 14px; }
.toolbar input[type=text]:focus { outline:none; border-color: #7ea9b8; box-shadow: 0 0 0 3px rgba(50,31,219,.18); }
.toolbar select, .toolbar input[type=date] { padding: 8px 10px; border: 1px solid #b1b7c1; border-radius: 6px; font-size: 13px; background:#fff; }
.toolbar .tf { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }

/* Pagination */
.pager { display: flex; gap: 2px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.pg { padding: 7px 13px; border: 1px solid var(--border); font-size: 13px; color: var(--primary); background:#fff; }
.pg:first-child { border-radius: 6px 0 0 6px; } .pg:last-child { border-radius: 0 6px 6px 0; }
.pg:hover { background: #f0f4f7; }
.pg.cur { background: var(--primary); color: #fff; border-color: var(--primary); }
.pg.off { color: var(--muted); pointer-events: none; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,21,.5); display: none; align-items: flex-start; justify-content: center; z-index: 2000; padding: 40px 16px; overflow-y: auto; }
.modal-bg.show { display: flex; }
.modal { background: #fff; border-radius: 6px; width: 600px; max-width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); animation: pop .15s ease; }
.modal-hd { padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--text); font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.modal-hd .x { cursor: pointer; font-size: 24px; color: var(--muted); line-height: 1; }
.modal-hd .x:hover { color: var(--danger); }
.modal-bd { padding: 20px; }
@keyframes pop { from{transform:translateY(-12px);opacity:0} to{transform:none;opacity:1} }

/* Map */
#map { height: 470px; border-radius: 6px; border: 1px solid var(--border); z-index: 1; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--body); padding: 20px; }
.login-box { background: #fff; padding: 36px; border-radius: 6px; width: 380px; border: 1px solid var(--border); box-shadow: 0 4px 20px rgba(0,0,21,.1); }
.login-box .logo { width: 56px; height: 56px; border-radius: 8px; display:grid; place-items:center; font-size:28px; background: var(--primary); margin-bottom: 16px; color:#fff; }
.login-box h2 { color: var(--text); margin-bottom: 4px; font-size: 22px; }
.login-box p { color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.alert { background:#fdeaea; color: #a12626; padding: 11px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; border:1px solid #f5c2c2; }
.alert.ok { background:#e7f6ec; color: #1b7e3c; border-color:#b6e2c4; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 18px; }
.gallery-grid .g { background:#fff; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: box-shadow .15s; }
.gallery-grid .g:hover { box-shadow: 0 4px 14px rgba(0,0,21,.12); }
.gallery-grid .g img { width: 100%; height: 120px; object-fit: cover; display: block; background:#e0e0e0; }
.gallery-grid .g .cap { padding: 9px 11px; font-size: 12px; }
.muted { color: var(--muted); font-size: 12px; }

/* Media grid (galeri detail) */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); gap: 16px; }
.media-item { background:#fff; border:1px solid var(--border); border-radius: 8px; overflow: hidden; position: relative; }
.media-item .thumb { position: relative; height: 130px; cursor: pointer; background:#e9edf0; }
.media-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 40px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.media-item .chk { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; z-index: 3; cursor: pointer; accent-color: var(--primary); }
.media-item .cap { padding: 8px 10px; font-size: 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.media-item .dl { cursor: pointer; color: var(--primary); font-size: 16px; }
.media-item.sel { outline: 3px solid var(--primary); }

/* Lightbox modal */
.lb { position: fixed; inset: 0; background: rgba(0,0,10,.9); display: none; align-items: center; justify-content: center; z-index: 3000; }
.lb.show { display: flex; }
.lb-content { max-width: 92vw; max-height: 88vh; }
.lb-content img, .lb-content video { max-width: 92vw; max-height: 88vh; border-radius: 8px; display: block; }
.lb-close { position: absolute; top: 16px; right: 24px; font-size: 40px; color: #fff; cursor: pointer; line-height: 1; }

/* Download progress bar */
.dlbar { display: none; align-items: center; gap: 12px; background:#eef3ec; border:1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.dlbar.show { display: flex; }
.dlbar .spin { width: 18px; height: 18px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
.dlbar .track { flex: 1; height: 8px; background: #d8dbe0; border-radius: 4px; overflow: hidden; }
.dlbar .fill { height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.dlbar .txt { font-size: 12px; color: var(--text); white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px){
  .sidebar{ width: 54px; } .brand small, .menu a span{ display:none;} .brand{font-size:0;padding:0;justify-content:center;}
  .main{ margin-left:54px;} .row2{grid-template-columns:1fr;} .content{padding:16px;}
}
