/* Main Stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #45a049;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: #f8f9fa;
}

/* ===== HEADER & NAVIGATION ===== */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    color: white; /* ✅ Ubah dari var(--text-color) jadi white */
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

.nav-menu a.active {
    font-weight: bold;
    border-bottom: 2px solid white;
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s;
}

.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 0.95rem;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

.dropdown-item i {
    margin-right: 0.5rem;
}

/* Divider di dropdown */
.dropdown-menu hr {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #eee;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--info-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #2980b9;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Main Content */
main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-color);
}

.card-title {
    font-size: 1.5rem;
    color: var(--dark-color);
}

/* Forms */
form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.1);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

thead {
    background-color: var(--dark-color);
    color: white;
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Grid Layout */
.grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.grid-2 {
        grid-template-columns: 1fr;
}

@media (min-width: 700px) {
    .grid-2 {
        grid-template-columns: 1fr 1fr;
    }
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card.horizontal-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 190px;
    width: 100%;
    max-width: 150%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.product-image {
    width: 100%;
    height: 200px;
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.horizontal-card .product-image {
    width: 230px;
    min-width: 120px;
    max-width: 180px;
    height: 230px;
    border-radius: 8px 0 0 8px;
    flex-shrink: 0;
}

.horizontal-card .product-info {
    flex: 1;
    padding: 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 1rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.product-price {
    font-size: 1.2rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.product-stock {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.product-actions button,
.product-actions a {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Sidebar */
.sidebar {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.sidebar-item {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-item:hover,
.sidebar-item.active {
    background-color: var(--primary-color);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.modal-close {
    float: right;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--danger-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: black;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
    }
    
    .grid {
        gap: 1rem;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 1rem 0;
}

.stat-label {
    color: #666;
    font-size: 0.95rem;
}

/* Admin Layout */
.admin-wrapper {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 0;
    min-height: calc(100vh - 80px);
}

.admin-sidebar {
    background: white;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
    padding: 1.5rem 0;
    overflow-y: auto;
}

.admin-main {
    padding: 2rem;
    overflow-y: auto;
}

.menu-item {
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    display: block;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
    background-color: #f0f0f0;
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.menu-section {
    margin-bottom: 1rem;
}

.menu-label {
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #999;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* Category Display */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.category-box {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.category-body {
    padding: 1rem;
}

.subcategory-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.subcategory-item:hover {
    background-color: var(--light-color);
    padding-left: 1rem;
}

/* Status Badge */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background-color: #d1ecf1;
    color: var(--primary-color);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary-color);
}

.pagination a:hover {
    background-color: var(--primary-color);
    color: white;
}

.pagination .active {
    background-color: var(--primary-color);
    color: white;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Color Utility Classes - Untuk styling dinamis */
.text-primary {
    color: var(--primary-color);
}

.text-secondary {
    color: var(--secondary-color);
}

.text-dark {
    color: var(--dark-color);
}

.bg-primary {
    background-color: var(--primary-color);
    color: white;
}

.bg-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.bg-light {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.border-primary {
    border: 2px solid var(--primary-color);
}

.section-title {
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.section-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.info-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.info-card h4 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.info-card p {
    color: #666;
    font-size: 0.85rem;
    margin: 0;
}

.category-card {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
    background: white;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.category-image {
    width: 100%;
    height: 200px;
    background: #f0f0f0;
    overflow: hidden;
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-content {
    padding: 1.5rem;
}

.category-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.category-content p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

/* SOP Tab Buttons */
   .sop-container {
        background-color: #FFE52A;
        border-radius: 12px;
        padding: 8px;
        display: flex;
        justify-content: space-around;
        max-width: 800px;
        margin: 0 auto;
    }

    .sop-tab-btn {
        background: none;
        border: none;
        color: #333;
        font-size: 16px;
        padding: 10px 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

    .sop-tab-btn.active {
        background-color: rgba(255, 255, 255, 0.687);
        border-radius: 8px;
        color: #333;
    }

    .sop-icon {
        width: 20px;
        height: 20px;
    }

/* Layanan Tab Buttons */
   .layanan-container {
        background-color: #FFE52A;
        border-radius: 12px;
        padding: 8px;
        display: flex;
        justify-content: space-around;
        max-width: 800px;
        margin: 0 auto;
    }

    .layanan-tab-btn {
        background: none;
        border: none;
        color: #333;
        font-size: 16px;
        padding: 10px 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        transition: all 0.3s ease;
    }

    .layanan-tab-btn.active {
        background-color: rgba(255, 255, 255, 0.687);
        border-radius: 8px;
        color: #333;
    }

    .layanan-icon {
        width: 20px;
        height: 20px;
    }
