/* --- ElectraForge Admin Panel Redesign V2 --- */

/* :root Variables for the new Peach & Light Blue theme */
:root {
    --primary-color: #FFDAB9; /* Peach */
    --primary-hover: #FFA07A; /* Light Salmon for hover */
    --accent-color: #ADD8E6; /* Light Blue */
    --accent-hover: #87CEEB; /* Sky Blue for hover */
    --background-color: #F8F9FA; /* Very light gray */
    --surface-color: #FFFFFF; /* White for cards */
    --text-color: #212529; /* Dark charcoal for "black outlines" */
    --text-muted: #6C757D;
    --border-color: #DEE2E6;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* --- General & Reset --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 16px;
}
a { color: var(--primary-hover); text-decoration: none; transition: color 0.2s ease; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin-bottom: 1rem; line-height: 1.2; font-weight: 600; }
p { margin-bottom: 1rem; }

/* --- Layout --- */
.main-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}
.sidebar-header { margin-bottom: 2rem; }
.sidebar-header h3 { font-size: 1.5rem; color: var(--text-color); }
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.sidebar-nav a:hover { background-color: #F0F0F0; color: var(--text-color); }
.sidebar-nav a.active { background-color: var(--primary-color); color: var(--text-color); font-weight: 600; }

.content { flex-grow: 1; padding: 2rem; }
.content-header { margin-bottom: 2rem; }
.content-header h1 { font-size: 2rem; }

/* --- Mobile Menu (NEW) --- */
.mobile-menu-toggle {
    display: none; /* Hidden by default on desktop */
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

/* --- Components (Existing styles below are unchanged) --- */
.card {
    background: var(--surface-color);
    padding: 1.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
input, textarea, select {
    width: 100%; padding: 0.75rem; border: 1px solid var(--border-color);
    border-radius: var(--border-radius); font-size: 1rem;
    background-color: #FCFCFC; transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 218, 185, 0.5);
}
textarea { min-height: 120px; resize: vertical; }
.btn {
    padding: 0.75rem 1.5rem; border: none; border-radius: var(--border-radius);
    cursor: pointer; font-size: 1rem; font-weight: 600;
    text-decoration: none; display: inline-block; transition: all 0.2s ease;
    color: var(--text-color);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary { background-color: var(--primary-color); }
.btn-primary:hover { background-color: var(--primary-hover); }
.btn-secondary { background-color: #E9ECEF; }
.btn-success { background-color: var(--success-color); color: var(--surface-color); }
.btn-danger { background-color: var(--danger-color); color: var(--surface-color); }
.btn-warning { background-color: var(--warning-color); color: var(--text-color); }
.data-table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.data-table th { background-color: #FAFAFA; font-weight: 600; color: var(--text-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background-color: #F8F8F8; }
.data-table .actions a { margin-right: 10px; font-weight: 500; }
.success-message, .error-message { padding: 1rem; border-radius: var(--border-radius); margin-bottom: 1.5rem; border: 1px solid; }
.success-message { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.error-message { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.login-page { display: flex; justify-content: center; align-items: center; min-height: 100vh; background-color: var(--background-color); }
.login-container { background: var(--surface-color); padding: 2.5rem; border-radius: var(--border-radius); box-shadow: var(--shadow-md); width: 100%; max-width: 420px; }
.login-container h1 { text-align: center; margin-bottom: 2rem; }

/* --- Responsive (UPDATED) --- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        box-shadow: var(--shadow-md);
    }
    .sidebar.is-visible {
        transform: translateX(0);
    }
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .sidebar-overlay.is-visible {
        display: block;
    }
    .content { padding: 1.5rem 1rem; }
    .content-header { padding-top: 50px; } /* Add space for the fixed menu button */
    .content-header h1 { font-size: 1.5rem; }
}

/* --- Appended Page-Specific Styles (Unchanged) --- */
.table-thumbnail { width: 50px; height: 50px; object-fit: cover; border-radius: var(--border-radius); }
.form-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: flex-start; }
.form-actions { margin-top: 1.5rem; }
.category-checklist { border: 1px solid var(--border-color); padding: 10px; border-radius: var(--border-radius); max-height: 150px; overflow-y: auto; background-color: #FCFCFC; }
.category-checklist label { display: block; }
.current-images { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.img-container { position: relative; cursor: move; }
.img-container img { width: 100px; height: 100px; object-fit: cover; border-radius: var(--border-radius); border: 1px solid var(--border-color); }
.delete-img-btn { position: absolute; top: -5px; right: -5px; background: var(--danger-color); color: white; border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-weight: bold; line-height: 22px; text-align: center; font-size: 14px; }
.file-input { padding: 5px; background-color: transparent; }
.upload-label { font-weight: 500; }
.upload-area { display: flex; align-items: flex-end; gap: 1rem; }
.upload-area .form-group { margin-bottom: 0; }
@media (max-width: 992px) { .form-grid { grid-template-columns: 1fr; } }
.checklist-box { height: 300px; overflow-y: auto; border: 1px solid var(--border-color); padding: 10px; border-radius: var(--border-radius); background-color: #FCFCFC; }
.checklist-item { display: block; padding: 5px 8px; cursor: pointer; border-radius: 4px; }
.checklist-item:hover { background-color: #f0f0f0; }
.checklist-item input { margin-right: 8px; }
.text-muted { color: var(--text-muted); }
.status-badge { padding: 4px 10px; border-radius: 20px; color: white; font-weight: 500; text-transform: uppercase; font-size: 0.75em; }
.status-badge.pending { background-color: var(--warning-color); color: #000; }
.status-badge.confirmed { background-color: var(--info-color); }
.status-badge.shipped { background-color: #007bff; }
.status-badge.delivered { background-color: var(--success-color); }
.status-badge.cancelled, .status-badge.failed { background-color: var(--danger-color); }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.stat-card { background-color: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1.5rem; display: flex; align-items: center; gap: 1.5rem; position: relative; overflow: hidden; }
.stat-icon { font-size: 2rem; color: #fff; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon.pending { background-color: var(--warning-color); color: var(--text-color); }
.stat-icon.confirmed { background-color: var(--info-color); }
.stat-icon.shipped { background-color: #0d6efd; }
.stat-icon.delivered { background-color: var(--success-color); }
.stat-icon.cancelled { background-color: #6c757d; }
.stat-icon.failed { background-color: var(--danger-color); }
.stat-icon.products { background-color: #6610f2; }
.stat-icon.low-stock { background-color: #fd7e14; }
.stat-info h4 { margin: 0 0 0.25rem 0; color: var(--text-muted); font-size: 0.9rem; font-weight: 500; }
.stat-info p { font-size: 2rem; font-weight: 700; margin: 0; color: var(--text-color); }
.stat-link { position: absolute; bottom: 10px; right: 15px; font-size: 0.85rem; font-weight: 500; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.settings-nav a { padding: 0.6rem 1rem; text-decoration: none; border-radius: var(--border-radius); font-weight: 500; color: var(--text-muted); }
.settings-nav a:hover { background-color: #f0f0f0; color: var(--text-color); }
.settings-nav a.active { background-color: var(--accent-color); color: var(--text-color); font-weight: 600; }
.compact-textarea { min-height: 50px; font-size: 0.9em; padding: 0.5rem; }
.api-section { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border-color); }
.api-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.order-container{display:grid;grid-template-columns:1fr 320px;gap:1.5rem;align-items:start}
@media (max-width:992px){.order-container{grid-template-columns:1fr}}
.status-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}
.action-buttons{display:flex;gap:1rem}
.action-buttons .btn{flex-grow:1}
#fraud-check-result strong{font-size:1.2rem;display:block}
.data-table tfoot td{font-weight:600}
.user-agent-info ul{list-style-type:none;padding-left:0;margin-top:5px}
.user-agent-info li{font-size:.9em}
.user-agent-info details{margin-top:10px}
.user-agent-info summary{cursor:pointer;font-weight:500;color:var(--primary-hover);font-size:.9em}
.raw-user-agent{font-size:.8em;word-break:break-all;background:#f0f0f0;padding:5px;border-radius:4px;margin-top:5px;color:var(--text-muted)}
.total-summary{margin-bottom:1rem}
.courier-list{font-size:.9em;color:var(--text-muted)}
.courier-item{margin-bottom:.25rem}
/* Loader Overlay */
    #loading-overlay {
        position: fixed; top: 0; left: 0; width: 100%; height: 100%;
        background: rgba(255, 255, 255, 0.8); z-index: 9999;
        display: none; justify-content: center; align-items: center;
        backdrop-filter: blur(5px);
    }
    .loader {
        border: 8px solid #f3f3f3; border-top: 8px solid var(--primary-color);
        border-radius: 50%; width: 60px; height: 60px;
        animation: spin 1s linear infinite;
    }
    @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }