:root {
    --primary: #FAAC30;
    --primary-hover: #e09825;
    --primary-light: #fff8eb;
    --dark-sidebar: #1e293b;
    --dark-sidebar-hover: #334155;
    --bg-body: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: var(--dark-sidebar);
    color: #ffffff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand span {
    color: var(--primary);
}

.sidebar-logo {
    width: 145px;
    height: auto;
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--dark-sidebar-hover) transparent;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: var(--dark-sidebar-hover);
    border-radius: 9999px;
}

.sidebar-menu .menu-header {
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.05em;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    background-color: var(--dark-sidebar-hover);
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--primary-light);
    color: var(--text-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid rgba(250, 172, 48, 0.3);
}

.user-badge .role-tag {
    background-color: var(--primary);
    color: #000;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    font-weight: 700;
}

.page-container {
    padding: 2rem;
    flex-grow: 1;
}

.card-custom {
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-custom-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-custom-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.card-custom-body {
    padding: 1.5rem;
}

.stat-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.btn-primary-custom {
    background-color: var(--primary);
    color: #000000;
    font-weight: 600;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    color: #000000;
}

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

.table-custom th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.table-custom td {
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.925rem;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: #f1f5f9;
}

.badge-custom {
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef9c3; color: #854d0e; }
.badge-info { background-color: #e0f2fe; color: #075985; }
.badge-danger { background-color: #fee2e2; color: #991b1b; }

.hari-chip {
    border-color: #cbd5e1;
    color: #334155;
}

.hari-chip:hover {
    border-color: #15803d;
    color: #166534;
}

.hari-chip.active {
    background-color: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

.login-bg {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.login-logo {
    width: 84px;
    height: 84px;
    object-fit: contain;
    display: block;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

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

    .main-content {
        width: 100%;
    }

    .topbar {
        padding: 0 1rem;
    }

    .page-container {
        padding: 1rem;
    }

    .user-badge span:first-child {
        display: none;
    }

    .table-custom th,
    .table-custom td {
        padding: 0.6rem 0.6rem;
        font-size: 0.82rem;
    }

    .card-custom-body {
        padding: 1rem;
    }

    .card-custom-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

.combobox-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    margin-top: 4px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.combobox-list {
    max-height: 260px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
}

.combobox-list li {
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.925rem;
}

.combobox-list li:hover,
.combobox-list li.active {
    background-color: var(--primary-light);
    color: var(--text-dark);
}

.date-range-wrap {
    position: relative;
}

.date-range-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1060;
    width: 288px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
    padding: 0.75rem;
    display: none;
}

.date-range-pop.open {
    display: block;
}

.drp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.drp-nav {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

.drp-nav:hover {
    background-color: var(--primary-light);
}

.drp-month-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.drp-weekdays,
.drp-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
}

.drp-weekdays span {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

.drp-days {
    row-gap: 2px;
}

.drp-empty {
    height: 30px;
}

.drp-day {
    height: 30px;
    line-height: 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-dark);
    transition: background-color 0.15s ease;
}

.drp-day:hover {
    background-color: var(--primary-light);
}

.drp-day.in-range {
    background-color: #fde8c8;
}

.drp-day.start,
.drp-day.end {
    background-color: var(--primary);
    color: #000000;
    font-weight: 700;
}

.drp-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Harga pendaftaran & SPP otomatis */
.spp-auto-box {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.55rem 0.9rem;
    border: 1px solid #f6dba4;
    border-radius: 10px;
    background: linear-gradient(135deg, #fff8eb, #fffdf7);
    min-height: 42px;
}

.spp-auto-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.1;
}

.spp-auto-sub {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Tier diskon multi-bulan */
.diskon-card {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: #ffffff;
}

.diskon-preview {
    padding: 0.5rem 0.75rem;
    border: 1px dashed #f0d7a5;
    border-radius: 8px;
    background-color: #fffaf1;
    color: #6b5a3e;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .diskon-card {
        padding: 0.8rem;
    }

    .spp-auto-value {
        font-size: 1.1rem;
    }
}

/* ============================================================
   ImajirekaEvent - tambahan komponen admin
   ============================================================ */
a.stat-card { text-decoration: none; color: inherit; }
a.stat-card:hover { border-color: rgba(250, 172, 48, 0.65); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06); }

a.card-custom { text-decoration: none; color: inherit; display: block; }
a.card-custom:hover { border-color: rgba(250, 172, 48, 0.65); }

.event-thumb {
    width: 66px;
    height: 46px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #f1f5f9;
    display: block;
}

.event-thumb-placeholder {
    width: 66px;
    height: 46px;
    border-radius: 8px;
    background: var(--primary-light);
    color: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border: 1px solid #f6dba4;
}

.quota-bar {
    width: 100%;
    min-width: 110px;
    height: 8px;
    border-radius: 999px;
    background: #eef2f7;
    overflow: hidden;
}

.quota-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #FAAC30, #e09825);
}

.quota-bar-fill.full { background: #dc2626; }

.image-preview {
    width: 100%;
    max-width: 380px;
    height: 130px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    display: block;
}

.image-preview.poster { max-width: 210px; height: 280px; object-fit: contain; background: #fffdf8; }

.form-label-custom {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    display: block;
}

.field-card {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
    margin-bottom: 0.85rem;
    overflow: hidden;
}

.field-card summary {
    list-style: none;
    cursor: pointer;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.field-card summary::-webkit-details-marker { display: none; }
.field-card summary:hover { background: #f8fafc; }
.field-card[open] summary { border-bottom: 1px solid var(--border-color); background: #fffaf1; }
.field-card-body { padding: 1rem; }

.field-type-tag {
    background: #e0f2fe;
    color: #075985;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.field-option-chip {
    display: inline-block;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.78rem;
    border-radius: 999px;
    padding: 0.18rem 0.55rem;
    margin: 0 0.3rem 0.3rem 0;
}

.scanner-shell {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 1.25rem;
}

#reader {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: #0f172a;
    min-height: 240px;
    border: 1px solid var(--border-color);
}

#reader video { border-radius: 12px; }

.scan-result {
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    display: none;
    margin-top: 0.85rem;
}

.scan-result.show { display: block; }
.scan-result.ok { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.scan-result.err { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.scan-result.info { background: #e0f2fe; border: 1px solid #7dd3fc; color: #075985; }

.scan-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

.scan-modal-icon.ok { background: #dcfce7; color: #166534; }
.scan-modal-icon.err { background: #fee2e2; color: #991b1b; }
.scan-modal-icon.info { background: #e0f2fe; color: #075985; }

.scan-name {
    font-size: 1.05rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
}

.attendance-status { font-weight: 700; }
.attendance-status.present { color: #166534; }
.attendance-status.absent { color: #b45309; }

.compact-table td, .compact-table th { padding: 0.6rem 0.75rem; font-size: 0.86rem; }

.quota-stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }
.quota-stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.login-error {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.answer-table td:first-child { width: 38%; color: var(--text-muted); font-weight: 600; }

.ticket-code-badge {
    font-family: Consolas, monospace;
    letter-spacing: 0.06em;
    background: #0f172a;
    color: #facc15;
    border-radius: 6px;
    padding: 0.25rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
}

@media (max-width: 900px) {
    .scanner-shell { grid-template-columns: 1fr; }
}

/* Ringkasan baris data di halaman admin */
.sukses-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.875rem;
}

.sukses-row .label { color: var(--text-muted); font-weight: 600; flex: 1; }
.sukses-row .val { color: var(--text-dark); font-weight: 700; text-align: right; flex: 1.5; word-break: break-word; }

/* Custom form fields di halaman Create/Edit Event */
.custom-field-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: #fffdf8;
    padding: 1rem;
}

.custom-field-card .field-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: #fff1d6;
    color: #9a5b00;
    font-size: 0.78rem;
    font-weight: 800;
}

.custom-field-card .field-options-wrap {
    border-top: 1px dashed var(--border-color);
    padding-top: 0.9rem;
}

.custom-field-card .field-options-list {
    max-width: 560px;
}

.custom-field-card .option-row .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-field-card .option-row .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
