@import 'probabilitas.css';

:root {
    --brand-dark: #023E8A;   /* sebelumnya #0A2E52 */
    --brand-mid: #0081AB;    /* sebelumnya #14508C */
    --brand-light: #4FC3E0;  /* sebelumnya #3E82C4 — saya sesuaikan biar masih 1 keluarga warna */
    --header-color: #1B2559;
    --accent-yellow: #FFC629;
    --status-green: #2E9E5B;
    --status-amber: #E8A317;
    --status-red: #C0392B;
    --bg-page: #F4F6FB;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6,
.app-page-title,
.section-header-bar h2,
.surface-card h2,
.dsh-welcome-title,
.section-title {
    color: #1B2559 !important;
}

.section-header-bar {
    background: #FFFFFF !important;
    border-bottom: 1px solid #F1F5F9 !important;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== Layout Shell ===== */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.alert {
    margin-bottom: 16px;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: rgba(46, 158, 91, 0.1);
    border-color: rgba(46, 158, 91, 0.3);
    color: var(--status-green);
}

.alert-error {
    background-color: rgba(192, 57, 43, 0.1);
    border-color: rgba(192, 57, 43, 0.3);
    color: var(--status-red);
}

/* ===== Sidebar ===== */

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background-color: var(--accent-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo-icon i {
    width: 20px;
    height: 20px;
    color: var(--brand-dark);
}

.sidebar-logo-text .title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
}

.sidebar-logo-text .subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
    margin: 0;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.sidebar-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-yellow);
    padding-left: 8px;
}

.sidebar-link i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-group-toggle .chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.15s ease;
}

.sidebar-group-toggle.open .chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    margin-left: 24px;
    margin-top: 4px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-sublink {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

.sidebar-sublink:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-sublink.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 500;
    border-left: 4px solid var(--accent-yellow);
    margin-left: -13px;
    padding-left: 8px;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout-form button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    background: none;
    border: none;
    cursor: pointer;
}

.sidebar-logout-form button:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-logout-form i {
    width: 16px;
    height: 16px;
}

/* ===== Topbar ===== */

.topbar {
    background-color: #fff;
    border-bottom: 1px solid #f1f1f1;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-breadcrumb {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0 0 2px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-search {
    position: relative;
}

.topbar-search input {
    padding: 8px 16px 8px 36px;
    font-size: 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: var(--bg-page);
    width: 260px;
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--brand-light);
    box-shadow: 0 0 0 2px rgba(62, 130, 196, 0.2);
}

.topbar-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.topbar-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.topbar-icon-btn:hover {
    background-color: var(--bg-page);
}

.topbar-icon-btn i {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.topbar-notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-red);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
    border-left: 1px solid #e2e8f0;
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--brand-mid);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.topbar-user-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}

.topbar-user-role {
    font-size: 12px;
    margin: 0;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .topbar-search { display: none; }
    .topbar-user-name, .topbar-user-role { display: none; }
}

/* ===== Card & Table umum ===== */

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.summary-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.summary-card-value {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.summary-card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.alert-banner-warning {
    background: rgba(232, 163, 23, 0.1);
    border: 1px solid rgba(232, 163, 23, 0.3);
    border-radius: 10px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    color: var(--status-amber);
    font-size: 14px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.btn-warning {
    background: var(--accent-yellow);
    color: var(--brand-dark);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.btn-outline {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 10px 18px;
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-amber { background: rgba(232,163,23,0.15); color: var(--status-amber); }
.badge-green { background: rgba(46,158,91,0.15); color: var(--status-green); }
.badge-gray  { background: #e2e8f0; color: var(--text-secondary); }

.toggle-switch {
    width: 40px; height: 22px;
    border-radius: 999px;
    background: #cbd5e1;
    border: none;
    position: relative;
    cursor: pointer;
}
.toggle-switch.on { background: var(--status-green); }
.toggle-knob {
    position: absolute;
    top: 2px; left: 2px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #fff;
    transition: left 0.15s ease;
}
.toggle-switch.on .toggle-knob { left: 20px; }

.avatar-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-yellow);
    color: var(--brand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700;
}

.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    align-items: center; justify-content: center;
    z-index: 50;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
}
.modal-box label { display:block; font-size:13px; font-weight:500; margin:12px 0 4px; }
.modal-box input, .modal-box select {
    width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; font-size: 14px;
}

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align:left; font-size:13px; color:var(--text-secondary); padding:12px 20px; border-bottom:1px solid #f1f5f9; }
.data-table td { padding:14px 20px; border-bottom:1px solid #f8fafc; font-size:14px; }

.input-search {
    width: 100%; max-width: 320px;
    padding: 10px 16px; border-radius: 8px; border: 1px solid #e2e8f0; margin-bottom: 16px;
}

.link-btn { background:none; border:none; color: var(--brand-light); font-size:13px; cursor:pointer; padding:0; margin-left:8px; }
.icon-btn-edit { background: rgba(255,198,41,0.15); border:none; border-radius:6px; width:32px; height:32px; cursor:pointer; }

.tab-btn {
    flex: 1; padding: 10px; background: none; border: none; border-bottom: 2px solid transparent;
    font-size: 14px; font-weight: 500; color: var(--text-secondary); cursor: pointer;
}
.tab-btn.active { color: var(--brand-mid); border-bottom-color: var(--brand-mid); }


/* ===== Dashboard: Kalender & Jadwal ===== */

.calendar-widget { display: flex; flex-direction: column; }
.calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.calendar-nav-btn { background: var(--bg-page); border: 1px solid #e2e8f0; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; }
.calendar-today-btn { background: var(--bg-page); border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar-day-label { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 8px 0; }
.calendar-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 13px; position: relative; }
.calendar-cell.today { background: var(--brand-light); color: #fff; font-weight: 700; }
.calendar-cell.has-event::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand-mid); }
.calendar-cell.today.has-event::after { background: #fff; }

.jadwal-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 8px; background: var(--bg-page); border-left: 4px solid var(--status-green); margin-bottom: 8px; }
.jadwal-item.besok { border-left-color: var(--status-amber); }
.jadwal-time { font-weight: 700; color: var(--brand-mid); font-size: 14px; width: 52px; flex-shrink: 0; }
.jadwal-info p { margin: 0; }
.jadwal-title { font-weight: 600; font-size: 14px; }
.jadwal-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px !important; }

/* ===== Card ikon berwarna (summary card gaya baru) ===== */

.summary-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.summary-card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.icon-blue   { background: rgba(2,62,138,0.1); color: var(--brand-dark); }
.icon-green  { background: rgba(46,158,91,0.12); color: var(--status-green); }
.icon-amber  { background: rgba(232,163,23,0.12); color: var(--status-amber); }
.icon-red    { background: rgba(192,57,43,0.12); color: var(--status-red); }

.summary-card-trend { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; display: inline-block; margin-top: 8px; }
.trend-up { background: rgba(46,158,91,0.12); color: var(--status-green); }
.trend-down { background: rgba(192,57,43,0.12); color: var(--status-red); }
.trend-neutral { background: #e2e8f0; color: var(--text-secondary); }

/* ===== Badge Potensi (Top Kandidat) ===== */

.badge-potensi-sangat-tinggi { background: rgba(46,158,91,0.12); color: var(--status-green); }
.badge-potensi-tinggi { background: rgba(232,163,23,0.12); color: var(--status-amber); }
.badge-potensi-sedang { background: #e2e8f0; color: var(--text-secondary); }

/* ===== Progress bar skor ===== */

.progress-bar-wrap { display: flex; align-items: center; gap: 8px; }
.progress-bar-track { flex: 1; height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; min-width: 60px; }
.progress-bar-fill { height: 100%; border-radius: 999px; background: var(--status-green); }
.progress-bar-fill.amber { background: var(--status-amber); }
.progress-bar-fill.red { background: var(--status-red); }
.progress-bar-value { font-weight: 700; font-size: 13px; width: 28px; text-align: right; }

/* ===== Role badge (Manajemen User) ===== */

.badge-role-super_admin { background: rgba(2,62,138,0.12); color: var(--brand-dark); }
.badge-role-pemasaran { background: rgba(0,129,171,0.12); color: var(--brand-mid); }
.badge-role-pengelola { background: rgba(46,158,91,0.12); color: var(--status-green); }
.badge-role-manajemen { background: #e2e8f0; color: var(--text-secondary); }

.import-dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 32px; text-align: center; color: var(--text-secondary); cursor: pointer; }
.import-dropzone:hover { border-color: var(--brand-light); background: rgba(0,129,171,0.03); }


/* ===== DESIGN REFRESH ===== */

/* Card ringkasan dengan ikon */
.summary-card {
    border-radius: 14px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.04);
    border: 1px solid #f1f5f9;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.summary-card:hover { box-shadow: 0 4px 8px rgba(15,23,42,0.06), 0 12px 24px rgba(15,23,42,0.08); transform: translateY(-1px); }

.summary-card-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.summary-card-icon i { width: 20px; height: 20px; }

.summary-card-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.summary-card-label { font-size: 12.5px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }

/* Section header dengan aksen ikon */
.section-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 4px;
}
.section-header-icon {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-mid));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.section-header-icon i { width: 15px; height: 15px; color: #fff; }
.section-header h2 { margin: 0; font-size: 16px; font-weight: 600; }

/* Container tabel yang lebih "elevated" */
.table-container {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 12px rgba(15,23,42,0.04);
    overflow: hidden;
}

/* Filter bar dengan ikon di tiap field */
.filter-bar { padding: 18px 22px; border-bottom: 1px solid #f1f5f9; background: #fbfcfd; }
.filter-field { position: relative; display: inline-flex; align-items: center; }
.filter-field i {
    position: absolute; left: 12px;
    width: 15px; height: 15px;
    color: var(--text-secondary);
    pointer-events: none;
}
.filter-field select,
.filter-field input {
    padding-left: 34px !important;
}
.filter-select {
    padding: 9px 14px 9px 34px;
    border-radius: 9px;
    border: 1px solid #e2e8f0;
    font-size: 13.5px;
    color: var(--text-primary);
    background: #fff;
    cursor: pointer;
    min-width: 150px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748B' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.filter-select:focus, .input-search:focus { outline: none; border-color: var(--brand-mid); box-shadow: 0 0 0 3px rgba(0,129,171,0.1); }
.input-search { border-radius: 9px; font-size: 13.5px; }

/* Table: header lebih tegas, isi lebih lega */
.data-table thead th {
    background: #fbfcfd;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 14px 20px;
    border-bottom: 1px solid #eef1f5;
}
.data-table td { padding: 16px 20px; font-size: 13.5px; border-bottom: 1px solid #f6f8fa; }
.data-table tbody tr:hover { background: rgba(0,129,171,0.035); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Tombol: shadow tipis + lift saat hover */
.btn-primary {
    box-shadow: 0 1px 2px rgba(2,62,138,0.15), 0 2px 8px rgba(2,62,138,0.15);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    font-size: 13.5px;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(2,62,138,0.2), 0 6px 14px rgba(2,62,138,0.2); }
.btn-outline {
    font-size: 13.5px;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-outline:hover { background: var(--bg-page); border-color: #cbd5e1; }
.btn-warning { box-shadow: 0 2px 6px rgba(255,198,41,0.35); }

/* Badge lebih rapi */
.badge { font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; padding: 4px 11px; }

/* Empty state ikon */
.empty-state {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-secondary);
}
.empty-state i { width: 36px; height: 36px; color: #cbd5e1; margin-bottom: 12px; }
.empty-state p { margin: 0; font-size: 13.5px; }

/* Alert & banner lebih halus */
.alert, .alert-banner-warning { border-radius: 10px; font-size: 13.5px; }
.alert-banner-warning { box-shadow: 0 1px 2px rgba(232,163,23,0.08); }

/* Page header */
.page-header-actions { margin-bottom: 24px; }
.page-subtitle { font-size: 13.5px; }

/* Reset link kecil */
.link-btn { font-weight: 600; }