* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
}

body {
    background: #e8f4fd;
}

/* ===== LOGIN ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 10px;
}

.login-header h2 {
    color: #1a73e8;
    font-size: 20px;
}

.login-header p {
    color: #666;
    font-size: 13px;
    margin-top: 4px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

.form-group input:focus {
    border-color: #1a73e8;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #1558b0;
}

.alert-error {
    background: #fde8e8;
    color: #c0392b;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}
/* ===== LAYOUT ===== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 240px;
    background: #1a73e8;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.sidebar-header img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.sidebar-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.sidebar nav a {
    display: block;
    padding: 11px 20px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-title {
    padding: 10px 20px 4px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
    margin-top: 6px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 240px;
    flex: 1;
    background: #f0f4f8;
    min-height: 100vh;
}

.topbar {
    background: white;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.topbar h4 {
    font-size: 16px;
    color: #333;
}

.topbar span {
    font-size: 14px;
    color: #555;
}

/* ===== DASHBOARD CARDS ===== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    border-left: 5px solid;
}

.card.blue   { border-color: #1a73e8; }
.card.green  { border-color: #27ae60; }
.card.orange { border-color: #e67e22; }
.card.teal   { border-color: #16a085; }
.card.red    { border-color: #e74c3c; }

.card-icon { font-size: 32px; }

.card-info p {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.card-info h3 {
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

/* ===== STOK INFO ===== */
.stok-info {
    margin: 0 24px 24px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.stok-info h3 {
    margin-bottom: 16px;
    font-size: 15px;
    color: #333;
}

/* ===== TABEL ===== */
.tabel {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabel thead tr {
    background: #1a73e8;
    color: white;
}

.tabel th, .tabel td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.tabel tbody tr:hover {
    background: #f5f9ff;
}
/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 24px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-header h3 {
    font-size: 16px;
    color: #333;
}

.btn-tambah {
    background: #1a73e8;
    color: white;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-tambah:hover { background: #1558b0; }

.btn-kembali {
    background: #6c757d;
    color: white;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-hapus {
    background: #e74c3c;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
}

.btn-hapus:hover { background: #c0392b; }

/* ===== FORM CARD ===== */
.form-card {
    background: white;
    border-radius: 10px;
    padding: 28px;
    max-width: 550px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.form-card .form-group {
    margin-bottom: 18px;
}

.form-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.form-card input,
.form-card select,
.form-card textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    border-color: #1a73e8;
}

.form-card textarea {
    height: 80px;
    resize: vertical;
}

.btn-simpan {
    background: #27ae60;
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-simpan:hover { background: #219a52; }
/* ===== REKAP BOX ===== */
.rekap-box {
    margin-top: 30px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.rekap-box h3 {
    margin-bottom: 16px;
    font-size: 15px;
    color: #333;
}
/* ===== TABEL FOOTER TOTAL ===== */
.tfoot-total {
    background: #f0f4f8;
}

.tfoot-total td {
    padding: 12px 14px;
    font-size: 14px;
    color: #333;
    border-top: 2px solid #1a73e8;
}
/* ===== FILTER BOX ===== */
.filter-box {
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-box form {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-box label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.filter-box input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.btn-filter {
    padding: 8px 18px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn-cetak {
    background: #e67e22;
    color: white;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.btn-cetak:hover { background: #ca6f1e; }

/* ===== LAPORAN SECTION ===== */
.laporan-section {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.laporan-section h4 {
    margin-bottom: 14px;
    font-size: 15px;
    color: #333;
}

/* ===== LABA BOX ===== */
.laba-box {
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    margin-top: 10px;
}

.laba-positif {
    background: #d5f5e3;
    color: #1e8449;
}

.laba-negatif {
    background: #fde8e8;
    color: #c0392b;
}

/* ===== LABA RUGI TABLE ===== */
.labarugi-box {
    background: white;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    max-width: 600px;
}

.labarugi-box h4 {
    margin-bottom: 16px;
    font-size: 15px;
    color: #333;
}

.tabel-labarugi {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.tabel-labarugi td {
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.tabel-labarugi td:last-child {
    text-align: right;
}

.group-header td {
    background: #1a73e8;
    color: white;
    font-weight: 700;
    font-size: 13px;
}

.subtotal td {
    background: #f0f4f8;
    border-top: 2px solid #ddd;
}

.laba-row td {
    background: #d5f5e3;
    color: #1e8449;
    font-size: 15px;
    border-top: 2px solid #27ae60;
}

.rugi-row td {
    background: #fde8e8;
    color: #c0392b;
    font-size: 15px;
    border-top: 2px solid #e74c3c;
}
/* ===== LOGO TEKS ===== */
.logo-teks {
    width: 65px;
    height: 65px;
    background: white;
    color: #1a73e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    margin: 0 auto 8px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-header p {
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}

.logo-teks-login {
    width: 75px;
    height: 75px;
    background: #1a73e8;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    margin: 0 auto 12px;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}
.btn-edit {
    background: #f39c12;
    color: white;
    padding: 5px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    margin-right: 4px;
    display: inline-block;
    font-weight: 600;
}

.btn-edit:hover { background: #d68910; }

/* ===== TOGGLE SIDEBAR ===== */
#toggleBtn {
    position: fixed !important;
    top: 50% !important;
    left: 240px;
    transform: translateY(-50%) !important;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    width: 28px;
    height: 60px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    visibility: visible !important;
    opacity: 1 !important;
    transition: left 0.3s ease;
}

.sidebar-closed .sidebar {
    width: 0 !important;
    overflow: hidden;
    transition: width 0.3s ease;
}

.sidebar-closed #toggleBtn {
    left: 0 !important;
}

.sidebar-closed .main-content {
    margin-left: 0 !important;
    transition: margin-left 0.3s ease;
}

.sidebar {
    transition: width 0.3s ease;
}

.main-content {
    transition: margin-left 0.3s ease;
}
.sidebar-closed .sidebar {
    transform: translateX(-240px) !important;
}

.sidebar-closed #toggleBtn {
    left: 0 !important;
}

.sidebar-closed .main-content {
    margin-left: 0 !important;
}

@media only screen and (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        width: 240px !important;
        height: 100vh !important;
        z-index: 1000 !important;
        left: 0 !important;
        top: 0 !important;
        overflow-y: auto !important;
    }

    body.sidebar-closed .sidebar {
        width: 0 !important;
        overflow: hidden !important;
    }

   #toggleBtn {
    position: fixed !important;
    left: 240px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 999999 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

    body.sidebar-closed #toggleBtn {
    left: 0 !important;
    border-radius: 0 8px 8px 0 !important;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 12px !important;
        gap: 10px !important;
    }

    .tabel {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }

    .form-card {
        max-width: 100% !important;
        padding: 16px !important;
    }

    .page-content {
        padding: 12px !important;
    }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }
}