﻿/* ===== STYLE UNTUK WEBSITE TOKO ===== */
/* Last Update: 11 Juni 2026 */

/* ----- RESET ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f6f9;
}

/* ----- HEADER ----- */
.header {
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    color: white;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .header h2 {
        margin: 0;
        font-size: 20px;
    }

.user-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.logout-btn {
    background-color: #e74c3c;
    color: white;
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 13px;
    border: none;
    cursor: pointer;
}

    .logout-btn:hover {
        background-color: #c0392b;
    }

/* ===== MENU UTAMA (LEVEL 1) ===== */
.menu {
    background-color: #2c3e50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

    .menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
    }

    .menu > ul {
        background-color: #2c3e50;
    }

    .menu ul li {
        position: relative;
    }

        .menu ul li a,
        .menu ul li span {
            display: block;
            padding: 14px 20px;
            color: white;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

            .menu ul li a:hover,
            .menu ul li span:hover {
                background-color: #1abc9c;
                color: white;
            }

        /* ===== LEVEL 2 (SUB MENU) ===== */
        .menu ul li ul {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background-color: white;
            border: 1px solid #ddd;
            border-top: none;
            min-width: 220px;
            z-index: 1001;
            flex-direction: column;
            box-shadow: 0 4px 8px rgba(0,0,0,0.15);
            border-radius: 0 0 5px 5px;
        }

        .menu ul li:hover > ul {
            display: block;
        }

        .menu ul li ul li {
            width: 100%;
        }

            .menu ul li ul li a,
            .menu ul li ul li span {
                padding: 10px 18px;
                color: #333;
                background-color: white;
                border-bottom: 1px solid #f0f0f0;
                font-size: 13px;
            }

            .menu ul li ul li:last-child a {
                border-bottom: none;
            }

            .menu ul li ul li a:hover,
            .menu ul li ul li span:hover {
                background-color: #3498db;
                color: white;
            }

            /* ===== LEVEL 3 (SUB SUB MENU) ===== */
            .menu ul li ul li ul {
                position: absolute;
                left: 100%;
                top: 0;
                min-width: 220px;
                background-color: white;
                border: 1px solid #ddd;
                border-radius: 5px;
                box-shadow: 0 4px 8px rgba(0,0,0,0.15);
                z-index: 1002;
            }

            .menu ul li ul li:hover > ul {
                display: block;
            }

            /* FIX: Untuk submenu level 3 yang mepet batas kanan */
            .menu ul li ul li ul.right-aligned {
                left: auto !important;
                right: 100% !important;
            }

        /* ===== INDICATOR UNTUK MENU YANG PUNYA CHILD ===== */
        .menu ul li.has-child > a::after,
        .menu ul li.has-child > span::after {
            content: " ▼";
            font-size: 10px;
        }

        .menu ul li ul li.has-child > a::after,
        .menu ul li ul li.has-child > span::after {
            content: " ▶";
            float: right;
            font-size: 10px;
        }

/* ----- CONTENT ----- */
.content {
    padding: 20px;
    min-height: 500px;
}

/* ----- FOOTER ----- */
.footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
    font-size: 12px;
}

/* ----- FORM PANEL ----- */
.form-panel {
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

    .form-panel h3 {
        margin-top: 0;
        margin-bottom: 20px;
        color: #2c3e50;
        border-bottom: 2px solid #3498db;
        padding-bottom: 10px;
    }

/* ----- FORM ROW (untuk layout 2 kolom) ----- */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.col-6 {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
}

/* ----- FORM GROUP ----- */
.form-group {
    margin-bottom: 0;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        color: #2c3e50;
        font-size: 13px;
    }

    .form-group .required {
        color: #e74c3c;
    }

/* ----- FORM CONTROL ----- */
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

    .form-control:focus {
        border-color: #3498db;
        outline: none;
        box-shadow: 0 0 5px rgba(52,152,219,0.3);
    }

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    background-color: white;
}

/* ----- RADIO LIST ----- */
.radio-list {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

    .radio-list input[type="radio"] {
        margin-right: 5px;
    }

/* ----- BUTTONS ----- */
.btn {
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

    .btn-primary:hover {
        background-color: #2980b9;
    }

.btn-success {
    background-color: #2ecc71;
    color: white;
}

    .btn-success:hover {
        background-color: #27ae60;
    }

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

    .btn-secondary:hover {
        background-color: #7f8c8d;
    }

.btn-info {
    background-color: #1abc9c;
    color: white;
}

    .btn-info:hover {
        background-color: #16a085;
    }

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

    .btn-danger:hover {
        background-color: #c0392b;
    }

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ----- TOOLBAR ----- */
.toolbar {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.search-box {
    display: flex;
    gap: 5px;
}

    .search-box .form-control {
        width: 250px;
    }

/* ----- GRIDVIEW ----- */
.gridview {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

    .gridview th {
        background-color: #34495e;
        color: white;
        padding: 12px;
        text-align: left;
        font-size: 13px;
    }

    .gridview td {
        padding: 10px 12px;
        border-bottom: 1px solid #eee;
        font-size: 13px;
    }

    .gridview tr:hover {
        background-color: #f0f7ff;
    }

    .gridview tr:nth-child(even) {
        background-color: #f9f9f9;
    }

/* ----- STATUS BADGE ----- */
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.status-aktif {
    background-color: #d4edda;
    color: #155724;
}

.status-nonaktif {
    background-color: #f8d7da;
    color: #721c24;
}

/* ----- ACTION BUTTONS di GRID ----- */
.btn-action {
    padding: 4px 12px;
    margin: 0 2px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    display: inline-block;
    cursor: pointer;
    border: none;
}

.btn-edit {
    background-color: #ffc107;
    color: #212529;
}

    .btn-edit:hover {
        background-color: #e0a800;
        color: #212529;
        text-decoration: none;
    }

.btn-hapus {
    background-color: #dc3545;
    color: white;
}

    .btn-hapus:hover {
        background-color: #c82333;
        color: white;
        text-decoration: none;
    }

/* ----- PAGER ----- */
.grid-pager {
    background-color: #f8f9fa;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    margin-top: 15px;
}

    .grid-pager a,
    .grid-pager span {
        padding: 5px 10px;
        margin: 0 2px;
        border: 1px solid #ddd;
        text-decoration: none;
        display: inline-block;
        border-radius: 3px;
    }

    .grid-pager a {
        background-color: white;
        color: #3498db;
    }

        .grid-pager a:hover {
            background-color: #3498db;
            color: white;
            border-color: #3498db;
        }

    .grid-pager span {
        background-color: #3498db;
        color: white;
        border-color: #2980b9;
    }

/* ----- GRID INFO ----- */
.grid-info {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 13px;
}

/* ----- ERROR MESSAGE ----- */
.error-message {
    color: #e74c3c;
    font-size: 11px;
    margin-top: 3px;
    display: block;
}

hr {
    margin: 10px 0 20px 0;
    border: 0;
    border-top: 1px solid #ddd;
}

/* ----- INFO BOX ----- */
.info-box {
    padding: 8px 0;
    color: #7f8c8d;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .toolbar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

        .search-box .form-control {
            width: 100%;
        }

    /* Responsive menu untuk mobile */
    .menu ul {
        flex-direction: column;
    }

        .menu ul li ul {
            position: static;
            display: none;
            width: 100%;
            padding-left: 20px;
        }

        .menu ul li:hover ul {
            display: block;
        }

        .menu ul li ul li ul {
            position: static;
            padding-left: 20px;
        }

        .menu ul li.has-child > a::after,
        .menu ul li ul li.has-child > a::after {
            content: " ▼";
        }
}
