/* =============================================
   SIPROKON - Main Stylesheet
   Theme: Orange & White, Modern Professional
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #f97316;
    --primary-dark: #ea6c0a;
    --primary-light: #fff7ed;
    --primary-soft: #fed7aa;
    --secondary: #1e293b;
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #cbd5e1;
    --sidebar-active: #f97316;
    --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
    --card-radius: 14px;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-600: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray-50);
    color: var(--secondary);
    font-size: 14px;
}

/* ---- Sidebar ---- */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: var(--primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; color: white;
}

.sidebar-brand .brand-name {
    font-size: 18px; font-weight: 700; color: white;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 10px; color: var(--sidebar-text);
}

.sidebar-section {
    padding: 8px 16px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.3);
    margin-top: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 400;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(249,115,22,0.12);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
}

/* ---- Main Content ---- */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Topbar ---- */
.topbar {
    background: white;
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 0 var(--gray-200);
    position: sticky; top: 0; z-index: 900;
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary);
}

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

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--primary-light);
    border-radius: 50px;
    cursor: pointer;
    border: 1px solid var(--primary-soft);
}

.user-avatar {
    width: 32px; height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 13px;
}

.user-info .name { font-size: 13px; font-weight: 600; color: var(--secondary); }
.user-info .role { font-size: 11px; color: var(--primary); }

/* ---- Page Content ---- */
.page-content {
    padding: 28px;
    flex: 1;
}

.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
}

.page-header p {
    color: var(--gray-600);
    font-size: 13px;
    margin-top: 2px;
}

/* ---- Stat Cards ---- */
.stat-card {
    background: white;
    border-radius: var(--card-radius);
    padding: 22px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: transform 0.2s;
}

.stat-card:hover { transform: translateY(-2px); }

.stat-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.orange { background: #fff7ed; color: var(--primary); }
.stat-icon.blue   { background: #eff6ff; color: var(--info); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.red    { background: #fff1f2; color: var(--danger); }
.stat-icon.yellow { background: #fffbeb; color: var(--warning); }
.stat-icon.purple { background: #faf5ff; color: #8b5cf6; }

.stat-data .label { font-size: 12px; color: var(--gray-600); margin-bottom: 4px; }
.stat-data .value { font-size: 24px; font-weight: 700; color: var(--secondary); line-height: 1; }
.stat-data .sub   { font-size: 11px; color: var(--gray-600); margin-top: 3px; }

/* ---- Cards ---- */
.card-custom {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card-custom .card-head {
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-custom .card-head h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--secondary);
    margin: 0;
}

.card-custom .card-body-p {
    padding: 22px;
}

/* ---- Tables ---- */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: var(--gray-50);
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table-custom td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 13.5px;
}

.table-custom tr:hover td { background: var(--gray-50); }
.table-custom tr:last-child td { border-bottom: none; }

/* ---- Status Badges ---- */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-status.pending   { background: #fffbeb; color: #92400e; }
.badge-status.diproses  { background: #eff6ff; color: #1d4ed8; }
.badge-status.selesai   { background: #f0fdf4; color: #166534; }
.badge-status.batal     { background: #fff1f2; color: #9f1239; }

/* ---- Buttons ---- */
.btn-primary-custom {
    background: var(--primary);
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none;
}

.btn-primary-custom:hover { background: var(--primary-dark); color: white; }

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 8px 18px;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 7px;
    text-decoration: none;
}

.btn-outline-custom:hover { background: var(--primary); color: white; }

/* ---- Progress Bar ---- */
.progress-custom {
    height: 8px;
    background: var(--gray-200);
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #fb923c);
    border-radius: 20px;
    transition: width 0.5s ease;
}

/* ---- Forms ---- */
.form-control-custom {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 13.5px;
    color: var(--secondary);
    background: white;
    transition: border-color 0.2s;
    outline: none;
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(249,115,22,0.1);
}

.form-label-custom {
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary);
    margin-bottom: 6px;
    display: block;
}

/* ---- Alert ---- */
.alert-custom {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: flex; align-items: flex-start; gap: 10px;
}

.alert-custom.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-custom.error   { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }
.alert-custom.info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-custom.warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ---- Service Card ---- */
.service-card {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1.5px solid var(--gray-100);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.service-img {
    width: 100%; height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-soft));
    display: flex; align-items: center; justify-content: center;
    font-size: 60px; color: var(--primary);
}

.service-body { padding: 20px; }

.service-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

/* ---- Timeline ---- */
.timeline { position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 18px; top: 0; bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    display: flex;
    gap: 20px;
    padding-bottom: 24px;
    position: relative;
}

.timeline-dot {
    width: 36px; height: 36px;
    background: white;
    border: 2.5px solid var(--primary);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    font-size: 14px;
    flex-shrink: 0;
    z-index: 1;
}

.timeline-content {
    background: white;
    border-radius: 10px;
    padding: 14px 18px;
    box-shadow: var(--card-shadow);
    flex: 1;
}

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 42px 40px;
    width: 100%; max-width: 420px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

.login-logo {
    width: 60px; height: 60px;
    background: var(--primary);
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; color: white;
    margin: 0 auto 16px;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .topbar { padding: 0 18px; }
    .page-content { padding: 18px; }
}

/* ---- Misc ---- */
.separator { border: none; border-top: 1px solid var(--gray-200); margin: 16px 0; }
.text-primary-custom { color: var(--primary) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.fw-600 { font-weight: 600; }
.fs-13 { font-size: 13px; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-600);
}

.empty-state i { font-size: 50px; color: var(--gray-200); margin-bottom: 16px; }
.empty-state h5 { font-size: 16px; color: var(--secondary); margin-bottom: 8px; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }

/* =============================================
   SIPROKON - Mobile Responsive Fix
   Tambahkan di bagian BAWAH style.css
   ============================================= */

/* ---- Sidebar Toggle Button ---- */
#sidebarToggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}
#sidebarToggle:hover { background: var(--gray-100); }

/* ---- Sidebar Overlay ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ---- Topbar mobile ---- */
.topbar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* ---- Topbar right mobile ---- */
@media (max-width: 992px) {
    #sidebarToggle { display: inline-flex; align-items: center; }

    .topbar {
        padding: 0 14px;
        height: 58px;
        gap: 8px;
    }

    .topbar-right {
        gap: 8px;
    }

    /* Sembunyikan teks WA Admin di mobile, tapi tetap tampilkan tombol */
    .topbar-right .btn.btn-sm span { display: none; }

    /* User chip — sembunyikan info teks di mobile */
    .user-info { display: none; }
    .user-chip {
        padding: 6px;
        gap: 0;
    }

    /* Page content lebih compact */
    .page-content { padding: 14px; }

    /* Page header */
    .page-header h1 { font-size: 18px; }
    .page-header p  { font-size: 12px; }

    /* Page header actions: wrap ke bawah di mobile */
    .page-header.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .page-header.d-flex .d-flex {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        z-index: 1000;
        width: 260px;
    }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
}

/* ---- Stat Cards Mobile ---- */
@media (max-width: 576px) {
    /* 1 kolom di HP kecil */
    .stat-card {
        padding: 16px;
        gap: 14px;
    }
    .stat-icon {
        width: 46px;
        height: 46px;
        font-size: 18px;
        border-radius: 10px;
    }
    .stat-data .value { font-size: 20px; }
    .stat-data .label { font-size: 11px; }

    /* Card padding lebih kecil */
    .card-custom .card-head { padding: 14px 16px; }
    .card-custom .card-body-p { padding: 16px; }
    .card-custom .card-head h5 { font-size: 13.5px; }

    /* Tombol lebih compact */
    .btn-primary-custom,
    .btn-outline-custom {
        padding: 8px 14px;
        font-size: 12.5px;
    }

    /* Tabel scroll horizontal */
    .table-responsive-mobile {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-custom th,
    .table-custom td {
        padding: 10px 12px;
        font-size: 12.5px;
        white-space: nowrap;
    }

    /* Form */
    .form-control-custom { font-size: 13px; padding: 9px 12px; }

    /* Alert */
    .alert-custom { font-size: 12.5px; padding: 12px 14px; }

    /* Page content */
    .page-content { padding: 12px; }

    /* Topbar title lebih kecil */
    .topbar-title { font-size: 13px; max-width: 120px; }
}

/* ---- Row gap mobile ---- */
@media (max-width: 768px) {
    .row.g-3, .row.g-4 { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }

    /* Timeline compact */
    .timeline-content { padding: 12px 14px; }
    .timeline-dot { width: 30px; height: 30px; font-size: 12px; }
    .timeline::before { left: 15px; }

    /* Empty state */
    .empty-state { padding: 36px 16px; }
    .empty-state i { font-size: 36px; }

    /* Service card */
    .service-img { height: 160px; }

    /* Badge status */
    .badge-status { font-size: 11px; padding: 4px 10px; }
}

/* ---- Stat card grid fix ---- */
@media (max-width: 400px) {
    .stat-data .value { font-size: 17px; }
    .stat-data .label { font-size: 10.5px; }
    .stat-icon { width: 40px; height: 40px; font-size: 16px; }
}
