:root{
  --bg:#0b0f14;--card:#10151b;--muted:#a6b0bf;--text:#e6edf3;
  --accent:#22c55e;--accent-2:#3b82f6;--border:#1e2630;--shadow:0 6px 20px rgba(0,0,0,.35);
}
*{box-sizing:border-box}html,body{margin:0;padding:0}
body{background:linear-gradient(180deg,#0b0f14,#0f1520);color:var(--text);font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;line-height:1.45;min-height:100vh;display:flex;flex-direction:column}
.container{max-width:1000px;margin:0 auto;padding:16px}
.topbar{position:sticky;top:0;z-index:30;background:rgba(11,15,20,.85);backdrop-filter:blur(10px);border-bottom:1px solid var(--border)}
.topbar .container{display:flex;align-items:center;gap:12px}
.brand{display:flex;align-items:center;gap:10px}
.logo img{width:42px;height:42px;border-radius:10px;object-fit:cover}
.titles h1{margin:0;font-size:18px}.titles p{margin:0;color:var(--muted);font-size:12px}
.search-wrap{margin:16px 0 6px}
#search{width:100%;padding:14px 16px;border-radius:12px;border:1px solid var(--border);background:#0d131b;color:var(--text);outline:none;font-size:15px}
#search::placeholder{color:#7f8a99}
.apps-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px} /* paksa 2 kolom di semua ukuran */
.card{display:flex;gap:12px;padding:12px;background:var(--card);border:1px solid var(--border);border-radius:16px;text-decoration:none;color:var(--text);box-shadow:var(--shadow);transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;width:100%;min-width:0}
.card:hover{transform:translateY(-2px);border-color:#213042}
.card .icon-wrap{width:64px;height:64px;flex:0 0 64px;border-radius:14px;background:#0b1118;display:grid;place-items:center;overflow:hidden;border:1px solid #1b2330}
.card .icon-wrap img{width:100%;height:100%;object-fit:cover;display:block}
.card .meta{min-width:0}
.card .meta h3{margin:0 0 4px;font-size:16px;line-height:1.2;overflow-wrap:anywhere}
.card .meta .url{margin:0;color:var(--muted);font-size:12px;overflow-wrap:anywhere}
.card .meta .sub{margin:6px 0 0;color:#7aa4a1;font-size:12px}
.empty{padding:28px;text-align:center;color:var(--muted)}
.btn{display:inline-block;background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#021018;text-decoration:none;padding:10px 14px;border-radius:12px;font-weight:700;border:0;cursor:pointer;box-shadow:var(--shadow)}
.btn.outline{background:transparent;color:var(--text);border:1px solid var(--border)}.btn.sm{padding:6px 10px;font-size:12px;border-radius:8px}
.card-panel{background:var(--card);border:1px solid var(--border);border-radius:16px;padding:16px;margin:16px 0;box-shadow:var(--shadow)}.card-panel h2{margin-top:0}.card-panel input,.card-panel select{width:100%;padding:12px;border-radius:10px;border:1px solid var(--border);background:#0d131b;color:var(--text)}
.alert{padding:10px 12px;border:1px solid #3a2a2a;background:#1a1010;color:#ffb4b4;border-radius:10px}.hint{color:var(--muted);font-size:12px}
.footer{margin-top:auto;border-top:1px solid var(--border);background:#0b0f14}.footer .container{padding:18px;text-align:center;color:var(--muted);font-size:13px}
/* Sidebar */
.sidebar{position:fixed;top:0;left:-260px;width:240px;height:100%;background:var(--card);box-shadow:2px 0 10px rgba(0,0,0,.4);transition:left .3s ease;z-index:9999;padding:60px 20px 20px}
.sidebar.active{left:0}
.sidebar nav a{display:block;color:var(--text);font-weight:600;text-decoration:none;font-size:16px;padding:8px;border-radius:8px;transition:background .2s}
.sidebar nav a:hover,.sidebar nav a.active{background:var(--accent);color:#001a16}
#overlay{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.4);z-index:9998}
#overlay.active{display:block;backdrop-filter:blur(2px);transition:backdrop-filter .3s ease}
/* Floating CS Button */
.cs-wa-btn{position:fixed;left:18px;bottom:18px;width:64px;height:64px;border-radius:16px;overflow:hidden;z-index:9999;box-shadow:0 6px 18px rgba(0,0,0,.25)}
.cs-wa-btn img{width:100%;height:100%;object-fit:cover;display:block;border-radius:16px}
@media (max-width:520px){.cs-wa-btn{width:56px;height:56px}}
.sidebar nav a.active {
  background: var(--accent);
  color: #001a16;
}
/* Biar judul aplikasi bisa dua baris maksimal */
.card .meta h3 {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* maksimal 2 baris */
  -webkit-box-orient: vertical;
}

/* URL juga rapi satu baris aja */
.card .meta .url {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* ===========================
   ADMIN: grid 1 kolom
   =========================== */
.admin-page .apps-grid.admin-grid {
    grid-template-columns: 1fr !important;
}

.admin-page .admin-item {
    flex-direction: row;
    width: 100%;
}
/* 🔔 Tombol Pesan */
.msg-btn {
    position: relative;
    background: #1b2533;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    border: 1px solid var(--border);
    transition: 0.2s;
}
.msg-btn:hover {
    background: #263345;
}

.msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4d4d;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 50%;
    font-weight: 700;
}

/* 🔔 Popup Pesan */
.msg-popup {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    background: #111720;
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    display: none;
    z-index: 9999;
    box-shadow: var(--shadow);
}

.msg-popup h3 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.msg-item {
    margin-top: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #28303a;
}

.msg-item:last-child {
    border-bottom: none;
}

.msg-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.msg-detail {
    font-size: 13px;
    color: #b1bac8;
}

.msg-link {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: #3b82f6;
    text-decoration: none;
}
.msg-link:hover {
    text-decoration: underline;
}
/* Perbaikan posisi tombol Pesan agar SEJEJAR dengan tombol ☰ */
.topbar .actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.msg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-width: 38px;
    background: #1b2533;
    border: 1px solid var(--border);
    padding: 0 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
}

/* Pastikan tidak meloncat ke atas */
#menu-btn.btn.outline {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Animasi bel goyang (shake) */
@keyframes bell-shake {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-12deg); }
    50% { transform: rotate(12deg); }
    75% { transform: rotate(-8deg); }
    100% { transform: rotate(0deg); }
}

/* Animasi pulse (denyut) */
@keyframes bell-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
    70% { box-shadow: 0 0 0 12px rgba(34,197,94,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

/* Terapkan animasi ke tombol pesan */
.msg-btn {
    animation: bell-shake 1s ease-in-out infinite,
               bell-pulse 1.8s ease-out infinite;
    border-color: var(--accent);
}
