/* =======================
   GLOBAL RESET
======================= */
* {
    box-sizing: border-box; /* 🔥 FIX UTAMA SEMUA LAYOUT */
}

body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    background: #ecf0f5;
}

/* =======================
   SIDEBAR
======================= */
.sidebar {
    width: 230px;
    height: 100vh;
    position: fixed;
    background: #117864;
    color: white;
}

.sidebar h3 {
    padding: 20px;
    margin: 0;
    text-align: center;
    background: #0e6655;
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #d1f2eb;
    text-decoration: none;
    transition: 0.3s;
}

.sidebar a:hover,
.sidebar a.active {
    background: #1abc9c;
    color: white;
    font-weight: bold;
}

/* =======================
   CONTENT
======================= */
.content {
    margin-left: 230px;
    padding: 20px;
}

/* =======================
   NAVBAR
======================= */
.navbar {
    background: white;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.navbar-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-right a {
    color: red;
    text-decoration: none;
}

/* =======================
   CARD
======================= */
.card-box {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.card {
    flex: 1 1 200px;
    padding: 20px;
    border-radius: 10px;
    color: white;
    position: relative;
    transition: 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.card h4 {
    margin: 0;
}

.card h2 {
    margin-top: 10px;
    font-size: 28px;
}

/* WARNA CARD */
.blue { background: #3498db; }
.red { background: #e74c3c; }
.yellow { background: #f1c40f; color: black; }
.green { background: #2ecc71; }

/* ICON CARD */
.card i {
    position: absolute;
    right: 15px;
    bottom: 10px;
    font-size: 40px;
    opacity: 0.3;
}

/* =======================
   BOX
======================= */
.box {
    background: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* =======================
   TABLE
======================= */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

table th {
    background: #0e6655;
    color: white;
    padding: 10px;
    text-align: center;
}

table td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

table tr:hover {
    background: #f9f9f9;
}

/* =======================
   BUTTON
======================= */
.btn {
    background: #1abc9c;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #16a085;
}

.btn-edit {
    background: #3498db;
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
}

.btn-edit:hover {
    background: #2980b9;
}

.btn-hapus {
    background: #e74c3c;
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
}

.btn-hapus:hover {
    background: #c0392b;
}

/* =======================
   FORM
======================= */
label {
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

form input,
form select {
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border-radius: 5px;
    border: 1px solid #ccc;
}

form input:focus,
form select:focus {
    border: 1px solid #1abc9c;
    outline: none;
}

/* =======================
   CHART FIX
======================= */
.chart-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.chart-box {
    flex: 1 1 400px;
    max-width: 100%;
}

.chart-box canvas {
    width: 100% !important;
    height: 300px !important;
}

/* =======================
   LOGIN PAGE
======================= */
.login-body {
    background: white;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    background: #117864;
    padding: 30px;
    width: 320px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    color: white;
}

/* HEADER */
.login-header {
    text-align: center;
    margin-bottom: 10px;
}

.login-header i {
    font-size: 35px;
    color: white;
}

.login-header h3 {
    margin: 5px 0;
}

/* TITLE */
.login-title {
    margin: 10px 0 0;
}

.login-sub {
    font-size: 12px;
    color: #d1f2eb;
    margin-bottom: 15px;
}

/* LABEL */
.login-box label {
    font-size: 13px;
    color: #d1f2eb;
}

/* 🔥 FIX INPUT & BUTTON SAMA */
.login-box input,
.btn-login {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    border-radius: 5px;
}

/* INPUT */
.login-box input {
    padding: 10px;
    border: none;
    margin: 5px 0 10px;
}

/* BUTTON */
.btn-login {
    background: #0b5345;
    color: white;
    border: none;
    cursor: pointer;
}

.btn-login:hover {
    background: #063d35;
}

/* FOOTER */
.login-footer {
    text-align: center;
    margin-top: 10px;
}

.login-footer a {
    font-size: 12px;
    color: #d1f2eb;
    text-decoration: none;
}

/* =======================
   FOOTER
======================= */
footer {
    margin-left: 230px;
    text-align: center;
    padding: 10px;
}

/* =======================
   RESPONSIVE
======================= */
@media (max-width: 768px) {

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .content {
        margin-left: 0;
    }

    .card-box {
        flex-direction: column;
    }

    footer {
        margin-left: 0;
    }
}