/* =========================================
   DASHBOARD ADMIN - UD. MUDA JAYA TANI
   (selaras dengan markup index.php)
========================================= */

/* ---- Wrapper & scope ---- */
.dashboard-admin,
.dashboard-admin-heading {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    color: #183b29;
    box-sizing: border-box;
}

.dashboard-admin *,
.dashboard-admin *::before,
.dashboard-admin *::after {
    box-sizing: border-box;
}

/* =========================================
   HEADER HALAMAN
========================================= */
.dashboard-admin-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 0;
    border: none;
    background: transparent;
}

.dashboard-admin-heading .dashboard-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #247447;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.dashboard-admin-heading h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.3;
}

.dashboard-admin-heading p {
    margin: 0;
    color: #748477;
    font-size: 13px;
    line-height: 1.7;
}

.dashboard-admin-heading p strong {
    color: #183b29;
}

.dashboard-tanggal {
    flex-shrink: 0;
    padding: 11px 15px;
    border: 1px solid #e0eae3;
    border-radius: 12px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    color: #183b29;
}

/* =========================================
   KARTU STATISTIK UTAMA
========================================= */
.dashboard-statistik {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-statistik .dashboard-kartu {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 20px;
    border: 1px solid #e2ebe4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(20, 60, 38, .05);
}

.dashboard-statistik .kartu-icon {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: #e7f5eb;
    font-size: 22px;
}

.dashboard-statistik .dashboard-kartu > div:last-child {
    min-width: 0;
}

.dashboard-statistik span {
    display: block;
    color: #748477;
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-statistik h2 {
    display: block;
    margin: 6px 0 0;
    color: #153c28;
    font-size: 23px;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.dashboard-statistik small {
    display: block;
    margin-top: 4px;
    color: #89968d;
    font-size: 10px;
    line-height: 1.5;
}

/* =========================================
   PANEL UMUM
========================================= */
.dashboard-admin .panel.dashboard-panel {
    display: block;
    width: 100%;
    min-width: 0;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid #e1eae3;
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(20, 60, 38, .045);
}

.dashboard-admin .panel.dashboard-panel .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8efe9;
}

.dashboard-admin .panel.dashboard-panel .panel-header h2 {
    margin: 0 0 6px;
    color: #193d2a;
    font-size: 17px;
    line-height: 1.4;
}

.dashboard-admin .panel.dashboard-panel .panel-header p {
    margin: 0;
    color: #849188;
    font-size: 12px;
    line-height: 1.6;
}

.dashboard-admin .dashboard-link {
    flex-shrink: 0;
    color: #237747;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-admin .dashboard-link:hover {
    text-decoration: underline;
}

/* =========================================
   STATUS PESANAN (4 KOTAK)
========================================= */
.dashboard-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.dashboard-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e4ece5;
    border-radius: 12px;
    background: #f9fcf9;
}

.dashboard-status-item span {
    color: #65796b;
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-status-item strong {
    color: #214c33;
    font-size: 22px;
}

.dashboard-status-item.status-menunggu {
    background: #fff9e9;
    border-color: #f2e5bd;
}

.dashboard-status-item.status-diproses {
    background: #eef5ff;
    border-color: #dce7fa;
}

.dashboard-status-item.status-selesai {
    background: #eaf7ee;
    border-color: #d7ebdd;
}

.dashboard-status-item.status-dibatalkan {
    background: #fff0ed;
    border-color: #f5ddd7;
}

/* =========================================
   GRAFIK 7 HARI
========================================= */
.dashboard-grafik-ringkasan {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid #e2ece4;
    border-radius: 11px;
    background: #f7fbf8;
}

.dashboard-grafik-ringkasan span {
    color: #718477;
    font-size: 12px;
}

.dashboard-grafik-ringkasan strong {
    color: #237747;
    font-size: 15px;
}

.dashboard-grafik {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.dashboard-grafik-item {
    display: grid;
    grid-template-rows: 40px 170px 28px;
    min-width: 0;
    text-align: center;
}

.dashboard-grafik-nilai {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 7px;
    color: #237747;
    font-size: 10px;
    font-weight: 700;
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.dashboard-grafik-area {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
    height: 100%;
    border-bottom: 1px solid #dce8df;
    background: repeating-linear-gradient(
        to bottom,
        #fff 0,
        #fff 41px,
        #edf3ee 42px,
        #fff 43px
    );
}

.dashboard-grafik-batang {
    width: min(42px, 65%);
    min-height: 4px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, #42b778, #207747);
    transition: height .4s ease;
}

.dashboard-grafik-nol {
    width: min(42px, 65%);
    height: 3px;
    background: #dce8df;
    border-radius: 2px;
}

.dashboard-grafik-item > span {
    padding-top: 8px;
    color: #718477;
    font-size: 11px;
}

/* =========================================
   RINGKASAN STOK
========================================= */
.dashboard-stok-ringkasan {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.dashboard-stok-ringkasan > div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    border: 1px solid #e2ece4;
    border-radius: 12px;
    background: #f8fbf8;
}

.dashboard-stok-ringkasan span {
    color: #718477;
    font-size: 12px;
    line-height: 1.5;
}

.dashboard-stok-ringkasan strong {
    color: #214c33;
    font-size: 22px;
}
/* =========================================
   TABEL DASHBOARD
========================================= */
.dashboard-admin .dashboard-tabel {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e1eae3; /* Bingkai luar tabel */
    border-radius: 12px;       /* Sudut tabel melengkung */
    background: #fff;
}

.dashboard-admin .dashboard-tabel table {
    width: 100%;
    border-collapse: collapse;
    min-width: 750px; /* Mencegah tabel terlalu gepeng di layar kecil */
}

/* Header Tabel */
.dashboard-admin .dashboard-tabel th {
    padding: 14px 16px; /* Jarak dalam (padding) diperbesar */
    background: #f4f9f5; /* Warna latar hijau sangat muda */
    color: #3b5945;      /* Warna teks header */
    font-size: 12px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid #dce8df; /* Garis pemisah tebal di bawah header */
}

/* Isi Tabel */
.dashboard-admin .dashboard-tabel td {
    padding: 14px 16px; /* Jarak antar kolom dan baris */
    border-bottom: 1px solid #eef3ef; /* Garis pemisah antar baris */
    color: #344c3b;
    font-size: 13px;
    line-height: 1.5;
    vertical-align: middle;
}

/* Efek selang-seling (zebra) agar baris mudah dibaca */
.dashboard-admin .dashboard-tabel tbody tr:nth-child(even) {
    background-color: #fafcfb;
}

/* Efek hover saat mouse diarahkan ke baris */
.dashboard-admin .dashboard-tabel tbody tr:hover {
    background-color: #f0f7f2;
}

/* Menghilangkan garis bawah di baris paling terakhir */
.dashboard-admin .dashboard-tabel tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================
   BADGE
========================================= */
.dashboard-admin .dashboard-badge {
    display: inline-block;
    padding: 6px 10px;
    border: 1px solid #dce8df;
    border-radius: 20px;
    background: #f5f9f6;
    color: #496b55;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard-admin .dashboard-badge.badge-menipis {
    background: #fff8e7;
    border-color: #f1e0b2;
    color: #926b16;
}

.dashboard-admin .dashboard-badge.badge-habis {
    background: #fff0ed;
    border-color: #f3d2cb;
    color: #b43d2e;
}

/* Warna badge status pesanan */
.dashboard-admin .dashboard-badge.badge-status {
    background: #f5f9f6;
    border-color: #dce8df;
    color: #496b55;
    text-transform: capitalize;
}

/* =========================================
   EMPTY STATE
========================================= */
.dashboard-admin .dashboard-pesan-kosong {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 18px;
    border: 1px dashed #cfe2d5;
    border-radius: 12px;
    background: #f6fbf7;
    color: #3f6b4f;
    font-size: 13px;
}

.dashboard-admin .dashboard-pesan-kosong span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0f2e6;
    color: #237747;
    font-weight: 800;
    flex-shrink: 0;
}

.dashboard-admin .dashboard-pesan-kosong p {
    margin: 0;
    line-height: 1.5;
}

.dashboard-admin .kosong {
    padding: 35px 20px;
    text-align: center;
}

.dashboard-admin .kosong .kosong-icon {
    margin-bottom: 12px;
    font-size: 42px;
}

.dashboard-admin .kosong h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #193d2a;
}

.dashboard-admin .kosong p {
    margin: 0;
    color: #849188;
    font-size: 13px;
    line-height: 1.6;
}

/* =========================================
   RESPONSIVE - TABLET
========================================= */
@media (max-width: 1200px) {
    .dashboard-statistik,
    .dashboard-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-stok-ringkasan {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* =========================================
   RESPONSIVE - HP
========================================= */
@media (max-width: 700px) {
    .dashboard-admin-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-admin-heading h1 {
        font-size: 24px;
    }

    .dashboard-statistik {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dashboard-statistik .dashboard-kartu {
        gap: 10px;
        padding: 13px;
    }

    .dashboard-statistik .kartu-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .dashboard-statistik h2 {
        font-size: 17px;
    }

    .dashboard-admin .panel.dashboard-panel {
        padding: 16px;
        margin-bottom: 16px;
    }

    .dashboard-status-grid,
    .dashboard-stok-ringkasan {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .dashboard-status-item,
    .dashboard-stok-ringkasan > div {
        padding: 12px;
    }

    .dashboard-grafik {
        gap: 5px;
    }

    .dashboard-grafik-item {
        grid-template-rows: 36px 135px 28px;
    }

    .dashboard-grafik-nilai {
        font-size: 8px;
    }

    .dashboard-grafik-item > span {
        font-size: 10px;
    }

    .dashboard-admin .dashboard-tabel table {
        min-width: 650px;
    }
}

/* =========================================
   RESPONSIVE - HP SANGAT KECIL
========================================= */
@media (max-width: 380px) {
    .dashboard-statistik,
    .dashboard-status-grid,
    .dashboard-stok-ringkasan {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-grafik {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}