
/* =========================================
   RESET
========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    scroll-behavior: smooth;
}

body {
    width: 100%;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #222;
    overflow-x: hidden;
}

/* =========================================
   LAYOUT UTAMA
========================================= */
.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: #111;
    color: #fff;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
}

.sidebar-header {
    padding: 25px 20px;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    color: #aaa;
}

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
}

.sidebar-menu li {
    margin-bottom: 5px;
}

.sidebar-menu a {
    display: block;
    padding: 12px 15px;
    color: #ddd;
    text-decoration: none;
    border-radius: 5px;
    font-size: 14px;
    transition: 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: #fff;
    color: #111;
}

/* =========================================
   CONTENT
========================================= */
.main-content {
    margin-left: 250px;
    width: calc(100% - 250px);
    min-width: 0;
    min-height: 100vh;
}

/* =========================================
   HEADER
========================================= */
.top-header {
    min-height: 70px;
    background: #fff;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    gap: 15px;
}

.top-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.admin-info {
    font-size: 14px;
    color: #555;
}

/* =========================================
   PAGE CONTENT
========================================= */
.page-content {
    width: 100%;
    padding: 30px;
    min-width: 0;
}

.page-title {
    margin-bottom: 25px;
}

.page-title h2 {
    font-size: 24px;
    margin-bottom: 5px;
}

.page-title p {
    color: #777;
    font-size: 14px;
    line-height: 1.5;
}

/* =========================================
   DASHBOARD CARDS
========================================= */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    min-width: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.card-title {
    font-size: 13px;
    color: #777;
    margin-bottom: 10px;
}

.card-value {
    font-size: 28px;
    font-weight: bold;
    overflow-wrap: anywhere;
}

/* =========================================
   CONTENT BOX
========================================= */
.content-box {
    width: 100%;
    min-width: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.content-box h3 {
    font-size: 18px;
    margin-bottom: 15px;
}

.content-box p {
    color: #666;
    line-height: 1.6;
}

/* =========================================
   TABLE
========================================= */
.table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-size: 14px;
}

table th {
    background: #f5f5f5;
    font-weight: 600;
    white-space: nowrap;
}

table tr:hover {
    background: #fafafa;
}

/* =========================================
   BUTTON
========================================= */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border: none;
    border-radius: 5px;
    background: #111;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: 0.2s;
}

.btn:hover {
    background: #333;
}

/* =========================================
   FORM
========================================= */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
}

.form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #111;
}

/* =========================================
   GAMBAR DAN MEDIA
========================================= */
img,
video,
iframe {
    max-width: 100%;
}

img {
    height: auto;
}

/* =========================================
   LAPTOP DAN DESKTOP
   Lebar layar di atas 1200px
========================================= */
@media screen and (min-width: 1201px) {

    .sidebar {
        width: 250px;
        min-width: 250px;
    }

    .main-content {
        margin-left: 250px;
        width: calc(100% - 250px);
    }

    .dashboard-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .page-content {
        padding: 30px;
    }
}

/* =========================================
   LAPTOP KECIL DAN TABLET LANDSCAPE
   Lebar layar 1001px - 1200px
========================================= */
@media screen and (min-width: 1001px) and (max-width: 1200px) {

    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .main-content {
        margin-left: 220px;
        width: calc(100% - 220px);
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-content {
        padding: 25px;
    }
}

/* =========================================
   TABLET
   Lebar layar 701px - 1000px
========================================= */
@media screen and (min-width: 701px) and (max-width: 1000px) {

    .sidebar {
        width: 190px;
        min-width: 190px;
    }

    .sidebar-header {
        padding: 20px 15px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .sidebar-menu {
        padding: 12px 8px;
    }

    .sidebar-menu a {
        padding: 11px 10px;
        font-size: 13px;
    }

    .main-content {
        margin-left: 190px;
        width: calc(100% - 190px);
    }

    .top-header {
        padding: 0 20px;
    }

    .top-header h1 {
        font-size: 18px;
    }

    .page-content {
        padding: 20px;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }

    .card {
        padding: 16px;
    }

    .card-value {
        font-size: 24px;
    }

    .content-box {
        padding: 20px;
    }
}

/* =========================================
   HP
   Lebar layar maksimal 700px
========================================= */
@media screen and (max-width: 700px) {

    /* Layout utama */
    .wrapper {
        display: block;
        width: 100%;
    }

    /* Sidebar menjadi menu horizontal */
    .sidebar {
        position: relative;
        width: 100%;
        min-width: 100%;
        min-height: auto;
        height: auto;
        top: auto;
        left: auto;
        bottom: auto;
        overflow: visible;
    }

    .sidebar-header {
        padding: 15px;
    }

    .sidebar-header h2 {
        font-size: 18px;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: nowrap;
        gap: 5px;
        padding: 10px;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar-menu li {
        flex: 0 0 auto;
        margin-bottom: 0;
    }

    .sidebar-menu a {
        display: block;
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Konten utama */
    .main-content {
        margin-left: 0;
        width: 100%;
        min-height: auto;
    }

    /* Header */
    .top-header {
        min-height: 60px;
        height: auto;
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-header h1 {
        font-size: 18px;
    }

    .admin-info {
        font-size: 12px;
    }

    /* Isi halaman */
    .page-content {
        padding: 15px;
    }

    .page-title {
        margin-bottom: 18px;
    }

    .page-title h2 {
        font-size: 21px;
    }

    .page-title p {
        font-size: 13px;
    }

    /* Kartu dashboard */
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }

    .card {
        padding: 16px;
    }

    .card-title {
        font-size: 12px;
    }

    .card-value {
        font-size: 24px;
    }

    /* Kotak konten */
    .content-box {
        padding: 15px;
        margin-bottom: 18px;
    }

    .content-box h3 {
        font-size: 16px;
    }

    .content-box p {
        font-size: 14px;
    }

    /* Tabel dapat digeser */
    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 650px;
    }

    /* Form */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-control {
        width: 100%;
        font-size: 16px;
        padding: 12px;
    }

    /* Tombol */
    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* =========================================
   HP KECIL
   Lebar layar maksimal 400px
========================================= */
@media screen and (max-width: 400px) {

    .sidebar-header {
        padding: 12px;
    }

    .sidebar-header h2 {
        font-size: 16px;
    }

    .sidebar-menu a {
        padding: 9px 10px;
        font-size: 12px;
    }

    .page-content {
        padding: 12px;
    }

    .page-title h2 {
        font-size: 19px;
    }

    .top-header {
        padding: 10px 12px;
    }

    .top-header h1 {
        font-size: 16px;
    }

    .card {
        padding: 14px;
    }

    .card-value {
        font-size: 22px;
    }

    .content-box {
        padding: 12px;
    }
}