/* ============================================================
   VEKSI.ID — Custom Stylesheet
   ============================================================ */

:root {
    --navy: #1A3A6E;
    --navy-dark: #142d57;
    --navy-light: #1e4480;
    --emerald: #2ECC8A;
    --emerald-dark: #25b377;
    --bg-light: #F4F6F9;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --danger: #E74C3C;
    --warning: #F39C12;
    --success: #27AE60;
    --border: #dee2e6;
    --sidebar-width: 255px;
    --topbar-height: 60px;
}

/* ---- Base ---- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    font-size: 0.9rem;
}

a { color: var(--navy); }
a:hover { color: var(--emerald-dark); }

/* ---- Sidebar ---- */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    background: var(--navy);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden;
}

#sidebar .sidebar-brand {
    padding: 18px 20px;
    background: var(--navy-dark);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--topbar-height);
    flex-shrink: 0;
    flex-grow: 0;
}

#sidebar .sidebar-brand .brand-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

#sidebar .sidebar-brand .brand-tagline {
    color: var(--emerald);
    font-size: 0.7rem;
    display: block;
    font-weight: 400;
}

#sidebar .sidebar-menu {
    padding: 12px 0;
    flex: 1 1 0;
    min-height: 0;        /* KUNCI: tanpa ini flex child tidak bisa scroll */
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar tipis di dalam menu */
#sidebar .sidebar-menu::-webkit-scrollbar { width: 3px; }
#sidebar .sidebar-menu::-webkit-scrollbar-track { background: transparent; }
#sidebar .sidebar-menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
#sidebar .sidebar-menu::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.35); }

#sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: var(--navy-dark);
    flex-shrink: 0;
    flex-grow: 0;
}

#sidebar .sidebar-footer .user-info {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

#sidebar .sidebar-footer .user-role {
    color: var(--emerald);
    font-size: 0.7rem;
}

#sidebar .menu-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 10px 20px 4px;
}

#sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 9px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    font-size: 0.875rem;
    border-radius: 0;
    white-space: nowrap;
}

#sidebar .nav-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

#sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--emerald);
}

#sidebar .nav-link.active {
    color: #fff;
    background: rgba(46,204,138,0.15);
    border-left-color: var(--emerald);
    font-weight: 600;
}

#sidebar .nav-link .badge {
    margin-left: auto;
    font-size: 0.65rem;
}

/* Menu terkunci — fitur belum tersedia di plan saat ini */
#sidebar .nav-link-upgrade {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.45);
    padding: 9px 20px;
    font-size: 0.9rem;
    text-decoration: none;
    border-left: 3px solid #F39C12;
    background: rgba(243,156,18,0.08);
    transition: background .15s;
}

#sidebar .nav-link-upgrade:hover {
    background: rgba(243,156,18,0.18);
    color: rgba(255,255,255,0.7);
}

#sidebar .nav-link-upgrade i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

#sidebar .nav-link-upgrade .badge {
    margin-left: auto;
    font-size: 0.65rem;
    flex-shrink: 0;
}

#sidebar .sidebar-submenu {
    background: rgba(0,0,0,0.15);
}

#sidebar .sidebar-submenu .nav-link {
    padding-left: 46px;
    font-size: 0.825rem;
}

#sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: var(--navy-dark);
    flex-shrink: 0;
}

#sidebar .sidebar-footer .user-info {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
}

#sidebar .sidebar-footer .user-role {
    color: var(--emerald);
    font-size: 0.7rem;
}

/* ---- Main Content ---- */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ---- Topbar ---- */
#topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

#topbar .page-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
    flex: 1;
}

#topbar .btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

#topbar .btn-toggle-sidebar:hover {
    background: var(--bg-light);
    color: var(--navy);
}

.notif-bell {
    position: relative;
    cursor: pointer;
}

.notif-bell .badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.6rem;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Content Area ---- */
.content-area {
    padding: 24px;
}

/* ---- KPI Cards ---- */
.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.kpi-card .kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.kpi-card .kpi-icon.navy { background: rgba(26,58,110,0.1); color: var(--navy); }
.kpi-card .kpi-icon.emerald { background: rgba(46,204,138,0.1); color: var(--emerald-dark); }
.kpi-card .kpi-icon.warning { background: rgba(243,156,18,0.1); color: var(--warning); }
.kpi-card .kpi-icon.danger { background: rgba(231,76,60,0.1); color: var(--danger); }

.kpi-card .kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.kpi-card .kpi-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    padding: 14px 18px;
    border-radius: 10px 10px 0 0 !important;
}

.card-header.navy {
    background: var(--navy);
    color: #fff;
}

/* ---- Tables ---- */
.table {
    font-size: 0.875rem;
}

.table thead th {
    background: var(--bg-light);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(26,58,110,0.03);
}

/* ---- Buttons ---- */
.btn-navy {
    background-color: var(--navy);
    color: #fff;
    border-color: var(--navy);
}

.btn-navy:hover {
    background-color: var(--navy-dark);
    color: #fff;
    border-color: var(--navy-dark);
}

.btn-emerald {
    background-color: var(--emerald);
    color: #fff;
    border-color: var(--emerald);
}

.btn-emerald:hover {
    background-color: var(--emerald-dark);
    color: #fff;
}

/* ---- Status Timeline ---- */
.production-timeline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.timeline-step.done {
    background: rgba(46,204,138,0.15);
    color: var(--emerald-dark);
}

.timeline-step.active {
    background: var(--navy);
    color: #fff;
}

.timeline-step.pending {
    background: var(--bg-light);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.timeline-step .arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ---- Alert Banners ---- */
.alert-trial {
    background: linear-gradient(135deg, #fff3cd, #ffeeba);
    border: 1px solid #ffc107;
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-expired {
    background: linear-gradient(135deg, #fde8e8, #f8d7da);
    border: 1px solid var(--danger);
    border-radius: 10px;
    padding: 14px 18px;
}

/* ---- Forms ---- */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.form-control, .form-select {
    font-size: 0.875rem;
    border-color: var(--border);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 0.2rem rgba(26,58,110,0.15);
}

.form-section-title {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--emerald);
    margin-bottom: 16px;
}

/* ---- Pagination ---- */
.page-link {
    color: var(--navy);
    font-size: 0.85rem;
}

.page-item.active .page-link {
    background-color: var(--navy);
    border-color: var(--navy);
}

/* ---- Toast ---- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.toast-item {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-left: 4px solid var(--navy);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    font-size: 0.875rem;
}

.toast-item.success { border-left-color: var(--success); }
.toast-item.danger  { border-left-color: var(--danger); }
.toast-item.warning { border-left-color: var(--warning); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ---- Landing Page ---- */
.landing-navbar {
    background: var(--navy) !important;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.landing-navbar .navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff !important;
}

.landing-navbar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    padding: 6px 14px !important;
}

.landing-navbar .nav-link:hover { color: var(--emerald) !important; }

.hero-section {
    background: linear-gradient(135deg, var(--navy) 0%, #0f2548 60%, #1a3a6e 100%);
    color: #fff;
    padding: 90px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(46,204,138,0.06);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.hero-section h1 span { color: var(--emerald); }

.hero-section .lead {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
}

.btn-cta {
    background: var(--emerald);
    color: #fff;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: 50px;
    font-size: 1rem;
    border: none;
    box-shadow: 0 4px 20px rgba(46,204,138,0.4);
    transition: all 0.3s;
}

.btn-cta:hover {
    background: var(--emerald-dark);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(46,204,138,0.5);
}

.feature-card {
    background: #fff;
    border-radius: 14px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.feature-card .feature-icon {
    width: 56px;
    height: 56px;
    background: rgba(26,58,110,0.08);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 16px;
}

.feature-card h5 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pricing-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 24px;
    border: 2px solid var(--border);
    transition: all 0.3s;
    height: 100%;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--navy);
    box-shadow: 0 8px 30px rgba(26,58,110,0.15);
    transform: scale(1.03);
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
}

.pricing-card .price small {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-card .feature-list li {
    padding: 6px 0;
    font-size: 0.88rem;
    border-bottom: 1px dashed #f0f0f0;
}

.pricing-card .feature-list li:last-child { border-bottom: none; }

.testimonial-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.testimonial-card .stars { color: #f39c12; }

.section-title {
    text-align: center;
    margin-bottom: 48px;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.section-title .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 540px;
    margin: 10px auto 0;
}

.section-title .accent-line {
    width: 50px;
    height: 4px;
    background: var(--emerald);
    margin: 12px auto 0;
    border-radius: 2px;
}

/* ---- Admin Layout ---- */
.admin-wrapper {
    display: flex;
}

.admin-sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--navy);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* ---- Badges ---- */
.badge { font-weight: 500; font-size: 0.72rem; }

/* ---- Utilities ---- */
.text-navy { color: var(--navy) !important; }
.text-emerald { color: var(--emerald) !important; }
.bg-navy { background-color: var(--navy) !important; }
.bg-emerald { background-color: var(--emerald) !important; }

.fw-600 { font-weight: 600; }
.cursor-pointer { cursor: pointer; }

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: #c0c7d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0a9b4; }

/* ---- Loading Spinner ---- */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.show {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0;
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .pricing-card.featured {
        transform: scale(1);
    }
}

@media (max-width: 576px) {
    .content-area { padding: 16px; }
    .hero-section h1 { font-size: 1.8rem; }
    .kpi-card .kpi-value { font-size: 1.4rem; }
}

/* ---- Extra Utilities ---- */
.btn-xs {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    line-height: 1.5;
}

.btn-outline-navy {
    color: var(--navy);
    border-color: var(--navy);
}
.btn-outline-navy:hover {
    background: var(--navy);
    color: #fff;
}

.border-navy { border-color: var(--navy) !important; }

/* Table compact */
.table > :not(caption) > * > * { padding: 0.5rem 0.75rem; }

/* Card hover clickable */
tr[onclick] { cursor: pointer; }

/* ============================================================
   LOGADM SIDEBAR — sidebar-link (bukan nav-link, agar tidak
   bentrok dengan Bootstrap .nav-link)
   ============================================================ */
.admin-sidebar {
    background: var(--navy);
}

.admin-sidebar .sidebar-brand {
    padding: 18px 20px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
}

.admin-sidebar .brand-text {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
}

.admin-sidebar .brand-tagline {
    color: #2ECC8A;
    font-size: 0.7rem;
    font-weight: 500;
    display: block;
}

.admin-sidebar .sidebar-menu {
    padding: 12px 0;
}

.admin-sidebar .menu-label {
    color: rgba(255,255,255,0.45);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 10px 20px 4px;
    display: block;
}

/* ---- sidebar-link: class khusus menggantikan nav-link ---- */
.admin-sidebar a.sidebar-link {
    color: #e2e8f0;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 3px solid transparent;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.admin-sidebar a.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: rgba(255,255,255,0.65);
    flex-shrink: 0;
    transition: color 0.2s;
}

.admin-sidebar a.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.10);
    border-left-color: #2ECC8A;
    text-decoration: none;
}

.admin-sidebar a.sidebar-link:hover i {
    color: #2ECC8A;
}

.admin-sidebar a.sidebar-link.active {
    color: #ffffff;
    background: rgba(46,204,138,0.18);
    border-left-color: #2ECC8A;
    font-weight: 600;
}

.admin-sidebar a.sidebar-link.active i {
    color: #2ECC8A;
}

/* Footer sidebar */
.admin-sidebar .sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    margin-top: auto;
}

.admin-sidebar .sidebar-footer .user-info .fw-600 {
    color: #ffffff;
}

.admin-sidebar .sidebar-footer .user-role {
    color: rgba(255,255,255,0.6);
    font-size: 0.78rem;
}

/* Admin topbar */
.admin-main #topbar {
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* ---- Card Header Tabs ---- */
.card-header-tabs {
    margin-bottom: -1px;
    border-bottom: none;
}
.card-header-tabs .nav-link {
    color: var(--text-secondary);
    font-size: .82rem;
    padding: 4px 12px;
    border-radius: 6px 6px 0 0;
}
.card-header-tabs .nav-link.active {
    color: var(--navy);
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--border);
    border-bottom-color: #fff;
}
.card-header-tabs .nav-link:hover {
    color: var(--navy);
    background: rgba(26,58,110,.05);
}
