/* File: dashboard.css (Versi Gabungan) */

:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --background-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #1c1e21;
    --border-color: #dee2e6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Password Prompt */
.password-container {
    background-color: var(--container-bg);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.password-container h2 {
    margin-top: 0;
    font-size: 24px;
    color: #333;
}

#password-input {
    width: calc(100% - 20px);
    padding: 12px;
    margin: 20px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
}

#password-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

#password-submit:hover {
    background-color: var(--primary-hover);
}

.error-message {
    color: #dc3545;
    margin-top: 10px;
    font-size: 14px;
    min-height: 20px;
}

/* Dashboard Content */
#dashboard-content {
    width: 100%;
    max-width: 1200px;
    margin: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    background-color: var(--container-bg);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background-color: var(--primary-color);
    color: white;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 28px;
}

#refresh-button {
    padding: 10px 15px;
    background-color: #fff;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

#refresh-button:hover {
    background-color: #f0f8ff;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: #f8f9fa;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-link {
    padding: 15px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #495057;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-bottom-color 0.2s;
}

.tab-link:hover {
    color: var(--primary-color);
}

.tab-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.main-content {
    padding: 30px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Orders Tab */
#orders-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.order-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.order-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0056b3;
}

.order-id, .order-date {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
}

.order-body p {
    margin: 8px 0; font-size: 14px; line-height: 1.5;
}
.order-body strong {
    font-weight: 600; color: #333;
}
.order-items {
    margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px;
}
.order-items h4 {
    margin-top: 0; margin-bottom: 10px; font-size: 16px;
}
.order-item {
    display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0;
}
.item-name { flex: 1; padding-right: 10px; }
.item-qty, .item-price { color: #555; }
.order-total {
    border-top: 1px solid #ccc; margin-top: 10px; padding-top: 10px; text-align: right; font-size: 16px; font-weight: bold; color: #dc3545;
}

/* Analytics Tab */
.analytics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.chart-container {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.chart-container h3 {
    margin-top: 0;
    text-align: center;
    font-size: 18px;
    color: #333;
}

@media (max-width: 900px) {
    .analytics-grid {
        grid-template-columns: 1fr;
    }
}
