/* ==================================================
   FORM TRIAL CLASS - ADMIN PANEL
================================================== */

:root {
    --primary: #357a32;
    --primary-dark: #286126;
    --primary-light: #E8F5E9;

    --white: #ffffff;
    --background: #f5f7f5;

    --text: #212529;
    --gray: #6c757d;

    --border: #dee2e6;

    --danger: #dc2626;

    --radius: 8px;

    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}


/* ==================================================
   GLOBAL
================================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
}


/* ==================================================
   ADMIN LOGIN
================================================== */

.admin-login {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 30px 20px;

    background: var(--background);
}


.login-card {
    width: 100%;
    max-width: 430px;

    padding: 40px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


.login-header {
    text-align: center;

    margin-bottom: 30px;
}


.login-icon {
    width: 70px;
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0 auto 20px;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: 50%;

    font-size: 30px;
}


.login-header h2 {
    margin: 0 0 8px;

    font-size: 26px;
    font-weight: 700;
}


.login-header p {
    margin: 0;

    color: var(--gray);
}


/* ==================================================
   FORM
================================================== */

.form-label {
    font-weight: 600;
}


.form-control {
    min-height: 48px;

    border: 1px solid var(--border);

    border-radius: var(--radius);
}


.form-control:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 0.2rem rgba(53, 122, 50, 0.15);
}


/* ==================================================
   BUTTON
================================================== */

.btn-primary {
    min-height: 48px;

    background: var(--primary);
    border-color: var(--primary);

    border-radius: var(--radius);

    font-weight: 600;
}


.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* ==================================================
   ACTION BUTTON
================================================== */

.action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.delete-form {
    margin: 0;
}

/* ==================================================
   ALERT
================================================== */

.alert {
    border-radius: var(--radius);
}

/* ==================================================
   ADMIN LAYOUT
================================================== */

.admin-wrapper {
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* ==================================================
   SIDEBAR
================================================== */

.admin-sidebar {
    width: 250px;
    height: 100vh;
    flex-shrink: 0;

    background: var(--primary);
    color: var(--white);

    overflow: hidden;
}


/* ==================================================
   SIDEBAR BRAND
================================================== */

.sidebar-brand {
    display: block;

    padding: 25px;

    color: var(--white);
    text-decoration: none;

    border-bottom: 1px solid rgba(255, 255, 255, 0.15);

    transition: background 0.2s ease;
}

.sidebar-brand:hover {
    background: rgba(255, 255, 255, 0.05);

    color: var(--white);
    text-decoration: none;
}

.sidebar-brand h4 {
    margin: 0 0 5px;

    color: inherit;

    font-size: 20px;
}

.sidebar-brand span {
    color: inherit;

    font-size: 13px;
    opacity: 0.8;
}


/* ==================================================
   SIDEBAR MENU
================================================== */

.sidebar-menu {
    padding: 20px 15px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 12px 15px;
    margin-bottom: 5px;

    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;

    border-radius: var(--radius);
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.sidebar-menu a i {
    flex-shrink: 0;
    font-size: 16px;
}

/* MAIN */

.admin-main {
    flex: 1;
    min-width: 0;
    height: 100vh;

    display: flex;
    flex-direction: column;

    overflow: hidden;
}


/* HEADER */

.admin-header {
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-shrink: 0;

    padding: 0 30px;

    background: var(--white);
    border-bottom: 1px solid var(--border);
}


/* CONTENT */

.admin-content {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    padding-top: 18px;
    padding-bottom: 25px;
    padding-left: 25px;
    padding-right: 25px;

    overflow: hidden;
    
    overflow-y: auto;
    overflow-x: hidden;
}


/* DESKRIPSI + SEARCH */

.page-header {
    flex-shrink: 0;
    margin-bottom: 15px;
}

/* ==================================================
   DASHBOARD CARD
================================================== */

.dashboard-card {
    max-width: 450px;

    display: flex;
    align-items: center;

    gap: 20px;

    padding: 25px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
    
    margin-bottom: 25px;
}

.dashboard-card-icon {
    width: 60px;
    height: 60px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: var(--radius);

    font-size: 25px;
}

.dashboard-card span {
    color: var(--gray);
    font-size: 14px;
}

.dashboard-card h3 {
    margin: 5px 0 0;
    font-size: 20px;
}

.dashboard-card-link {
    margin-left: auto;

    color: var(--primary);

    font-size: 22px;

    text-decoration: none;
}

/* ==================================================
   SUMBER INFORMASI PENDAFTAR
================================================== */

.source-card {
    width: 100%;
    max-width: 850px;

    padding: 25px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);
}


/* HEADER */

.source-card-header {
    margin-bottom: 25px;
}

.source-card-header h3 {
    margin: 0 0 5px;

    font-size: 19px;
    font-weight: 700;
}

.source-card-header p {
    margin: 0;

    color: var(--gray);
    font-size: 14px;
}


/* CHART */

.source-chart {
    display: flex;
    flex-direction: column;

    gap: 14px;
}


/* ITEM */

.source-item {
    display: grid;

    grid-template-columns: 100px 1fr 35px;

    align-items: center;

    gap: 15px;
}


/* NAMA SUMBER */

.source-name {
    font-size: 14px;
    font-weight: 600;
}


/* AREA BAR */

.source-bar-area {
    width: 100%;
}

.source-bar-track {
    width: 100%;
    height: 12px;

    overflow: hidden;

    background: var(--primary-light);

    border-radius: 20px;
}

.source-bar-fill {
    height: 100%;

    background: var(--primary);

    border-radius: 20px;

    transition: width 0.3s ease;
}


/* TOTAL */

.source-total {
    text-align: right;

    color: var(--primary);

    font-size: 14px;
    font-weight: 700;
}

/* ==================================================
   DATA CARD
================================================== */

.data-card {
    flex: 1;
    min-height: 0;

    display: flex;
    flex-direction: column;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}


/* ==================================================
   TABLE WRAPPER
================================================== */

.table-wrapper {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overflow-x: auto;
}


/* TABLE */

.table-wrapper .table {
    margin-bottom: 0;
}


/* HEADER TABLE STICKY */

.table-wrapper .table thead th {
    position: sticky;
    top: 0;

    z-index: 10;

    background: #f8f9fa;
}

/* ==================================================
   DATA PENDAFTAR
================================================== */

.data-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.data-card .table {
    margin-bottom: 0;
}

.data-card .table thead th {
    padding: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.data-card .table tbody td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

.data-card .table tbody tr:last-child td {
    border-bottom: 0;
}

.data-card .table tbody tr:hover {
    background: #fafcfa;
}


/* STATUS */

.status-badge {
    display: inline-block;

    padding: 6px 12px;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: var(--radius);

    font-size: 12px;
    font-weight: 600;
}

/* ==================================================
   SEARCH DATA PENDAFTAR
================================================== */

.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.page-header-row p {
    margin: 0;
}

.page-header-row .search-box {
    flex-shrink: 0;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.search-box i {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    color: var(--gray);
}

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 15px 0 42px;

    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(53, 122, 50, 0.10);
}

/* ==================================================
   DETAIL PENDAFTAR
================================================== */

.detail-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.detail-section {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.detail-section:last-child {
    border-bottom: 0;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 10px;

    margin: 0 0 10px;

    color: var(--primary);

    font-size: 18px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 40px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item span {
    color: var(--gray);
    font-size: 13px;
}

.detail-item strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
}

.detail-full {
    grid-column: 1 / -1;
}

/* DETAIL PAGE HEADER */

.detail-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.detail-page-header p {
    margin: 0;
}

.detail-page-header .btn {
    flex-shrink: 0;
}


/* ==================================================
   RESPONSIVE ADMIN
================================================== */

@media (max-width: 768px) {

    .admin-sidebar {
        width: 75px;
    }

    .sidebar-brand h4,
    .sidebar-brand span,
    .sidebar-menu a:not(.active) span {
        display: none;
    }

    .sidebar-menu a {
        justify-content: center;
    }

    .admin-header {
        padding: 0 20px;
    }

    .admin-content {
        padding: 20px;
    }

    .detail-section {
        padding: 15px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .detail-full {
        grid-column: auto;
    }

    .detail-page-header {
        gap: 15px;
    }

    .page-header-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .page-header-row .search-box {
        max-width: 100%;
    }
    
    .source-card {
        padding: 20px;
    }
    
    .source-item {
        grid-template-columns: 80px 1fr 30px;
        gap: 10px;
    }
    
    .source-name {
        font-size: 13px;
    }

}

/* ==================================================
   MOBILE SIDEBAR TOGGLE
================================================== */

.admin-sidebar-toggle {
    display: none;

    border: 0;
    background: transparent;
    color: var(--dark);

    font-size: 24px;

    padding: 4px 8px;
    margin-right: 10px;

    cursor: pointer;
}

.admin-header-left {
    display: flex;
    align-items: center;
}


/* ==================================================
   MOBILE
================================================== */

@media (max-width: 768px) {

    .admin-sidebar {
        position: fixed;

        top: 0;
        left: 0;

        width: 250px;
        height: 100vh;

        z-index: 1050;

        transform: translateX(-100%);

        transition: transform 0.25s ease;

        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.15);
    }


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


    .admin-main {
        width: 100%;
        min-width: 0;
    }


    .admin-sidebar-toggle {
        display: inline-flex;

        align-items: center;
        justify-content: center;
    }


    .admin-header {
        padding: 0 15px;
    }


    .admin-user {
        gap: 8px;
    }


    .admin-user span {
        display: none;
    }


    .admin-content {
        padding: 20px 15px;
    }

}


/* ==================================================
   SIDEBAR OVERLAY
================================================== */

.admin-sidebar-overlay {
    display: none;

    position: fixed;

    inset: 0;

    background: rgba(0, 0, 0, 0.35);

    z-index: 1040;
}


@media (max-width: 768px) {

    .admin-sidebar-overlay.active {
        display: block;
    }

}

/* ==================================================
   MOBILE SIDEBAR - OPEN STATE FIX
================================================== */

@media (max-width: 768px) {

    /* SIDEBAR DEFAULT: TERSEMBUNYI */

    .admin-sidebar {
        width: 250px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1050;
    }


    /* SIDEBAR SAAT DIBUKA */

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


    /* TAMPILKAN BRAND */

    .admin-sidebar .sidebar-brand h4,
    .admin-sidebar .sidebar-brand span {
        display: block;
    }


    /* TAMPILKAN SEMUA TEKS MENU */

    .admin-sidebar .sidebar-menu a span {
        display: inline;
    }


    /* MENU KEMBALI KE POSISI NORMAL */

    .admin-sidebar .sidebar-menu a {
        justify-content: flex-start;
    }


    /* TOMBOL HAMBURGER */

    .admin-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

}

/* ==========================================
   GRAFIK PENDAFTAR 7 HARI
   ========================================== */

.daily-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.daily-card-header {
    margin-bottom: 25px;
}

.daily-card-header h3 {
    margin: 0 0 5px;
    font-size: 20px;
}

.daily-card-header p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}


/* CHART */

.daily-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 18px;

    height: 230px;
    align-items: end;
}


.daily-item {
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}


.daily-date {
    text-align: center;
    margin-top: 10px;
    order: 2;
}

.daily-date strong {
    display: block;
    font-size: 13px;
}

.daily-date span {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}


.daily-bar-area {
    height: 180px;

    display: flex;
    align-items: flex-end;
    justify-content: center;

    gap: 8px;

    width: 100%;
}


.daily-bar-track {
    width: 35px;
    height: 100%;

    background: #e8f3e9;

    border-radius: 6px 6px 0 0;

    display: flex;
    align-items: flex-end;

    overflow: hidden;
}


.daily-bar-fill {
    width: 100%;

    background: var(--primary);

    border-radius: 6px 6px 0 0;

    min-height: 0;

    transition: height 0.3s ease;
}


.daily-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);

    min-width: 20px;
}

@media (max-width: 768px) {

    .daily-card {
        padding: 18px;
        margin-bottom: 20px;
    }

    .daily-card-header h3 {
        font-size: 18px;
    }

    .daily-chart {
        gap: 8px;
        height: 210px;
    }

    .daily-bar-area {
        height: 160px;
        gap: 4px;
    }

    .daily-bar-track {
        width: 24px;
    }

    .daily-total {
        font-size: 11px;
    }

    .daily-date strong {
        font-size: 11px;
    }

    .daily-date span {
        font-size: 10px;
    }

}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;

    margin-bottom: 25px;
}

.dashboard-stats .dashboard-card {
    margin-bottom: 0;
}

/* ==================================================
   FIX DASHBOARD STATS MOBILE
================================================== */

@media screen and (max-width: 768px) {

    .dashboard-stats {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 15px !important;
        margin-bottom: 25px;
    }

    .dashboard-stats .dashboard-card {
        display: flex !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;

        box-sizing: border-box;
    }

}

/* ==================================================
   PENGATURAN
================================================== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 25px;

    max-width: 1000px;
}


.settings-card {
    background: var(--white);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    padding: 25px;

    box-shadow: var(--shadow);
}


.settings-card-header {
    display: flex;
    align-items: flex-start;

    gap: 15px;

    margin-bottom: 25px;
}


.settings-icon {
    width: 50px;
    height: 50px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-light);
    color: var(--primary);

    border-radius: var(--radius);

    font-size: 22px;
}


.settings-card-header h3 {
    margin: 2px 0 5px;

    font-size: 19px;
    font-weight: 700;
}


.settings-card-header p {
    margin: 0;

    color: var(--gray);

    font-size: 14px;
}


.settings-form-group {
    margin-bottom: 20px;
}


.settings-form-group small {
    display: block;

    margin-top: 6px;

    color: var(--gray);

    font-size: 12px;
}


.settings-action {
    display: flex;
    justify-content: flex-end;

    margin-top: 10px;
}

@media (max-width: 768px) {

    .settings-grid {
        grid-template-columns: 1fr;

        gap: 20px;

        width: 100%;
    }


    .settings-card {
        padding: 20px;
    }


    .settings-action {
        justify-content: stretch;
    }


    .settings-action .btn {
        width: 100%;
    }

}

/* ==================================================
   JADWAL PENDAFTARAN SETTINGS
================================================== */

.settings-card-full {
    grid-column: 1 / -1;
}


.batch-settings {
    max-width: 900px;
}


.batch-settings-title {
    margin-bottom: 20px;
}


.batch-settings-title h4 {
    margin: 0;

    font-size: 18px;
    font-weight: 700;
}


.settings-date-grid {
    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 20px;
}


.settings-divider {
    border: 0;

    border-top: 1px solid var(--border);

    margin: 35px 0;
}

@media (max-width: 768px) {

    .settings-card-full {
        grid-column: auto;
    }

    .settings-date-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

}