/* ============================================================
   viKPen - Single Clean Dashboard Stylesheet
   ALL-IN-ONE: Sidebar + Dashboard Simple
   ============================================================ */

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 270px; z-index: 1000;
    background: rgba(5,5,18,0.97);
    border-right: 1px solid rgba(0,210,255,0.04);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    overflow-y: auto; overflow-x: hidden;
    transition: width 0.2s ease, transform 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 2px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0,210,255,0.06); border-radius: 2px; }

.sidebar-header { padding: 12px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid rgba(0,210,255,0.03); min-height: 52px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.logo-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg,#00d4ff,#8b3ff7); border-radius: 7px; font-size: 0.9rem; color: #fff; flex-shrink: 0; }
.logo-text { white-space: nowrap; }
.logo-text h4 { font-size: 0.85rem; font-weight: 700; color: #e4e8ff; margin: 0; line-height: 1.2; }
.logo-text small { font-size: 0.55rem; color: #5a5a88; text-transform: uppercase; letter-spacing: 1px; }

.sidebar-toggle { width: 28px; height: 28px; display: none; align-items: center; justify-content: center; background: rgba(0,210,255,0.03); border: 1px solid rgba(0,210,255,0.05); border-radius: 6px; color: #5a5a88; cursor: pointer; font-size: 0.7rem; }

.sidebar-user { padding: 10px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(0,210,255,0.03); min-height: 52px; }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(0,210,255,0.06); flex-shrink: 0; position: relative; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.status-dot { position: absolute; bottom: -1px; right: -1px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid rgba(5,5,18,0.97); }
.status-dot.online { background: #00ff95; }
.user-info { overflow: hidden; }
.user-info h6 { font-size: 0.75rem; font-weight: 600; color: #e4e8ff; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .badge-role { font-size: 0.5rem; padding: 1px 6px; border-radius: 3px; }
.badge-superadmin { background: linear-gradient(135deg,#ff3be8,#8b3ff7); color:#fff; }
.badge-admin { background: linear-gradient(135deg,#00d4ff,#8b3ff7); color:#fff; }

.sidebar-menu { flex: 1; overflow-y: auto; padding: 6px 0; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 1px; color: #5a5a88; padding: 10px 14px 4px; font-weight: 600; }
.nav-divider { height: 1px; background: rgba(0,210,255,0.02); margin: 4px 14px; }
.nav-item { margin: 1px 6px; border-radius: 6px; }
.nav-item:hover { background: rgba(0,210,255,0.025); }
.nav-item.active { background: rgba(0,210,255,0.05); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; color: #6868a0; text-decoration: none; font-size: 0.75rem; font-weight: 500; border-radius: 6px; }
.nav-link i { width: 18px; text-align: center; font-size: 0.78rem; }
.nav-item:hover .nav-link { color: #9090c0; }
.nav-item.active .nav-link { color: #00d4ff; }
.nav-item.active .nav-link i { color: #00d4ff; }
.logout-link { color: #ff6b35 !important; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 999; }

/* ============================================================
   WRAPPER & MAIN
   ============================================================ */
#app-wrapper {
    margin-left: 270px;
    min-height: 100vh;
    position: relative; z-index: 1;
}
.main-content { padding: 20px 24px; }

/* ============================================================
   HEADER
   ============================================================ */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-title { font-weight: 700; font-size: 1.25rem; color: #e4e8ff; letter-spacing: -0.3px; }
.page-title span { background: linear-gradient(135deg,#00d4ff,#8b3ff7); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-subtitle { color: #7878a8; font-size: 0.78rem; margin-top: 1px; }
.page-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; background: rgba(0,210,255,0.04); border: 1px solid rgba(0,210,255,0.06); border-radius: 20px; font-size: 0.68rem; color: #00d4ff; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; margin-bottom: 20px; }
.stat-card { padding: 14px 16px; background: rgba(14,14,32,0.6); border: 1px solid rgba(0,210,255,0.07); border-radius: 12px; backdrop-filter: blur(6px); transition: 0.18s ease; position: relative; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(135deg,#00d4ff,#8b3ff7); opacity: 0.35; }
.stat-card:hover { background: rgba(18,18,40,0.85); border-color: rgba(0,210,255,0.1); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,210,255,0.03); }

.stat-icon { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 0.85rem; margin-bottom: 8px; }
.stat-icon.cyan { background: rgba(0,210,255,0.08); color: #00d4ff; }
.stat-icon.purple { background: rgba(139,63,247,0.08); color: #8b3ff7; }
.stat-icon.green { background: rgba(0,255,149,0.08); color: #00ff95; }
.stat-icon.orange { background: rgba(255,107,53,0.08); color: #ff6b35; }
.stat-icon.pink { background: rgba(255,59,232,0.08); color: #ff3be8; }
.stat-icon.gold { background: rgba(255,230,0,0.08); color: #ffe600; }

.stat-value { font-weight: 700; font-size: 1.4rem; line-height: 1.2; margin-bottom: 2px; }
.stat-label { color: #7878a8; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500; }

/* ============================================================
   CARDS
   ============================================================ */
.card { background: rgba(14,14,32,0.6); border: 1px solid rgba(0,210,255,0.07); border-radius: 12px; backdrop-filter: blur(6px); box-shadow: 0 2px 10px rgba(0,0,0,0.2); margin-bottom: 16px; overflow: hidden; }
.card:hover { border-color: rgba(0,210,255,0.08); }
.card-header { padding: 12px 16px; border-bottom: 1px solid rgba(0,210,255,0.035); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.card-header h5 { font-weight: 600; font-size: 0.82rem; color: #e4e8ff; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 14px 16px; }

/* ============================================================
   TABLE
   ============================================================ */
.table-wrap { overflow-x: auto; margin: 0 -16px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.table th { padding: 9px 14px; text-align: left; font-weight: 600; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.4px; color: #7878a8; border-bottom: 1px solid rgba(0,210,255,0.03); background: rgba(0,210,255,0.01); white-space: nowrap; }
.table td { padding: 8px 14px; border-bottom: 1px solid rgba(255,255,255,0.01); color: #e4e8ff; white-space: nowrap; }
.table tr:hover td { background: rgba(0,210,255,0.01); }

/* ============================================================
   BADGES
   ============================================================ */
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 4px; font-size: 0.62rem; font-weight: 500; }
.badge-active,.badge-lunas,.badge-selesai,.badge-diantar { background: rgba(0,255,149,0.08); color: #00ff95; }
.badge-inactive,.badge-deleted { background: rgba(90,90,138,0.08); color: #5a5a88; }
.badge-pending,.badge-belum_lunas,.badge-cicil { background: rgba(255,230,0,0.08); color: #ffe600; }
.badge-suspend,.badge-suspended,.badge-dibatalkan,.badge-batal { background: rgba(255,107,53,0.08); color: #ff6b35; }
.badge-blocked,.badge-retired { background: rgba(255,34,85,0.08); color: #ff2255; }
.badge-diproses,.badge-maintenance { background: rgba(0,210,255,0.08); color: #00d4ff; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border: none; border-radius: 8px; font-family: 'Inter',sans-serif; font-size: 0.75rem; font-weight: 500; cursor: pointer; transition: 0.18s ease; text-decoration: none; }
.btn-primary { background: linear-gradient(135deg,#00d4ff,#8b3ff7); color: #fff; box-shadow: 0 2px 6px rgba(0,210,255,0.12); }
.btn-primary:hover { box-shadow: 0 4px 12px rgba(0,210,255,0.2); transform: translateY(-1px); color: #fff; }
.btn-outline { background: transparent; color: #00d4ff; border: 1px solid rgba(0,210,255,0.1); }
.btn-outline:hover { background: rgba(0,210,255,0.04); border-color: rgba(0,210,255,0.18); }
.btn-secondary { background: rgba(90,90,138,0.15); color: #e4e8ff; border: none; }
.btn-sm { padding: 4px 9px; font-size: 0.68rem; border-radius: 6px; }
.btn-danger { color: #ff6b35; border-color: rgba(255,107,53,0.1); }
.btn-danger:hover { background: rgba(255,107,53,0.05); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.search-bar input,.search-bar select { padding: 8px 12px; background: rgba(14,14,32,0.4); border: 1px solid rgba(0,210,255,0.06); border-radius: 8px; color: #e4e8ff; font-family: 'Inter',sans-serif; font-size: 0.78rem; outline: none; }
.search-bar input:focus,.search-bar select:focus { border-color: rgba(0,210,255,0.12); }
.search-bar input { flex: 1; min-width: 180px; }
.search-bar input::placeholder { color: #7878a8; opacity: 0.35; }
.search-bar select { cursor: pointer; min-width: 120px; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pages { display: flex; gap: 4px; padding: 12px 16px; justify-content: center; }
.page-link { display: flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 7px; background: rgba(14,14,32,0.4); border: 1px solid rgba(0,210,255,0.03); border-radius: 6px; color: #7878a8; font-size: 0.72rem; cursor: pointer; text-decoration: none; }
.page-link:hover { border-color: rgba(0,210,255,0.08); color: #00d4ff; }
.page-item.active .page-link { background: linear-gradient(135deg,#00d4ff,#8b3ff7); color: #fff; border-color: transparent; }

/* ============================================================
   FLASH / ALERT
   ============================================================ */
.flash { padding: 9px 13px; border-radius: 8px; font-size: 0.78rem; display: flex; align-items: center; gap: 7px; margin-bottom: 16px; border: 1px solid transparent; }
.flash-success { background: rgba(0,255,149,0.04); border-color: rgba(0,255,149,0.06); color: #00ff95; }
.flash-error { background: rgba(255,107,53,0.04); border-color: rgba(255,107,53,0.06); color: #ff6b35; }
.flash-info { background: rgba(0,210,255,0.04); border-color: rgba(0,210,255,0.06); color: #00d4ff; }

/* ============================================================
   FORM
   ============================================================ */
.form-group { margin-bottom: 12px; }
.form-label { font-size: 0.72rem; color: #7878a8; margin-bottom: 3px; display: block; }
.form-control { width: 100%; padding: 8px 11px; background: rgba(14,14,32,0.4); border: 1px solid rgba(0,210,255,0.06); border-radius: 8px; color: #e4e8ff; font-size: 0.8rem; font-family: 'Inter',sans-serif; outline: none; box-sizing: border-box; }
.form-control:focus { border-color: rgba(0,210,255,0.12); }
.form-control::placeholder { color: #7878a8; opacity: 0.3; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 55px; }

/* ============================================================
   EMPTY
   ============================================================ */
.empty { text-align: center; padding: 35px 20px; color: #7878a8; }
.empty i { font-size: 1.8rem; opacity: 0.15; margin-bottom: 8px; display: block; }
.empty h4 { font-size: 0.9rem; color: #e4e8ff; margin-bottom: 3px; }
.empty p { font-size: 0.75rem; }

/* ============================================================
   MODAL (via Bootstrap)
   ============================================================ */
.modal-content { background: rgba(10,10,24,0.96) !important; border: 1px solid rgba(0,210,255,0.06) !important; border-radius: 12px !important; backdrop-filter: blur(12px); }
.modal-header,.modal-footer { border-color: rgba(0,210,255,0.03) !important; }

/* ============================================================
   TABLES IN OLD PAGES (compat)
   ============================================================ */
.table th { color: #7878a8; border-bottom-color: rgba(0,210,255,0.03); }
.table td { color: #e4e8ff; border-bottom-color: rgba(255,255,255,0.01); }

/* ============================================================
   MOBILE - Sidebar hidden, toggle with class open
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: 270px !important; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex !important; }
    .sidebar-overlay.hidden { display: none; }
    .sidebar-overlay:not(.hidden) { display: block; }
    #app-wrapper { margin-left: 0 !important; }
    .main-content { padding: 16px; }
}
