/* admin-style.css */
:root {
    --primary: #1e3a8a; /* Premium Dark Blue */
    --primary-dark: #0f172a; /* Darker Slate Blue for hovers */
    --secondary: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --info: #3b82f6;
    --light-grey: #f3f4f6;
    --medium-grey: #e5e7eb;
    --dark-grey: #4b5563;
}
html { 
    scroll-behavior: smooth; 
}
body { 
    font-family: 'Inter', system-ui, sans-serif; 
    background-color: var(--light-grey); 
    color: #111827; 
}
h1, h2, h3, h4, h5, h6 { 
    font-family: 'Poppins', sans-serif; 
}
.sidebar { 
    background-image: linear-gradient(180deg, #1f2937, #111827); 
    transition: transform 0.3s ease; 
}
.sidebar-brand { 
    background-image: linear-gradient(to right, var(--primary-dark), var(--primary)); 
}
.sidebar-link { 
    display: flex; 
    align-items: center; 
    padding: 0.875rem 1.5rem; 
    color: #d1d5db; 
    font-weight: 500; 
    transition: all 0.2s ease; 
    border-left: 4px solid transparent; 
    margin: 0 0.5rem 2px 0; 
    border-radius: 0 8px 8px 0; 
}
.sidebar-link:hover { 
    background-color: rgba(255, 255, 255, 0.08); 
    color: #ffffff; 
}
.sidebar-link.active { 
    background-color: var(--primary); 
    color: #ffffff; 
    border-left-color: var(--secondary); 
}
.sidebar-link i { 
    font-size: 1.1rem; 
    width: 1.5rem; 
    text-align: center; 
    margin-right: 0.875rem; 
    color: #9ca3af; 
    transition: all 0.2s ease; 
}
.sidebar-link:hover i, .sidebar-link.active i { 
    color: #ffffff; 
}
.admin-card { 
    background-color: #ffffff; 
    border-radius: 0.75rem; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03); 
    border: 1px solid var(--medium-grey); 
}
.card-header { 
    padding: 1rem 1.5rem; 
    border-bottom: 1px solid var(--medium-grey); 
    background-color: #f9fafb; 
}
.card-header h3 { 
    font-size: 1.125rem; 
    font-weight: 600; 
}
.card-body { 
    padding: 1.5rem; 
}
.card-footer { 
    padding: 1rem 1.5rem; 
    border-top: 1px solid var(--medium-grey); 
    background-color: #f9fafb; 
    border-radius: 0 0 0.75rem 0.75rem;
}
.form-label { 
    display: block; 
    font-size: 0.875rem; 
    font-weight: 500; 
    color: #374151; 
    margin-bottom: 0.5rem; 
}
.form-control, textarea.form-control, select.form-control { 
    width: 100%; 
    border: 1px solid #d1d5db; 
    border-radius: 0.5rem; 
    padding: 0.625rem 0.875rem; 
    transition: all 0.15s ease; 
    background-color: white; 
}
.form-control:focus, textarea.form-control:focus, select.form-control:focus { 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2); 
    outline: none; 
}
.multi-image-preview-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
    gap: 0.75rem; 
}
.multi-image-preview-item { 
    position: relative; 
    aspect-ratio: 1/1; 
    border-radius: 0.5rem; 
    overflow: hidden; 
    border: 1px solid var(--medium-grey); 
    cursor: grab; 
}
.multi-image-preview-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}
.multi-image-preview-item .remove-img-btn { 
    position: absolute; 
    top: 0.25rem; 
    right: 0.25rem; 
    width: 1.5rem; 
    height: 1.5rem; 
    background-color: rgba(0,0,0,0.6); 
    color: white; 
    border: none; 
    border-radius: 50%; 
    font-size: 1rem; 
    line-height: 1.5rem; 
    cursor: pointer; 
    z-index: 10; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
.sortable-ghost {
    opacity: 0.4;
    background: #c7d2fe;
}
.btn { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    padding: 0.625rem 1.25rem; 
    border-radius: 0.5rem; 
    font-weight: 500; 
    transition: all 0.15s ease; 
    border: 1px solid transparent;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}
.btn:disabled { 
    opacity: 0.6; 
    cursor: not-allowed; 
}
.btn-primary { 
    background-color: var(--primary); 
    color: white; 
}
.btn-primary:hover:not(:disabled) { 
    background-color: var(--primary-dark); 
}
.btn-danger { 
    background-color: var(--danger); 
    color: white; 
}
.loader { 
    border-radius: 50%; 
    width: 40px; 
    height: 40px; 
    margin: 0 auto; 
    border-top: 5px solid rgba(79, 70, 229, 0.2); 
    border-right: 5px solid rgba(79, 70, 229, 0.2); 
    border-bottom: 5px solid rgba(79, 70, 229, 0.2); 
    border-left: 5px solid var(--primary); 
    animation: loader 1.1s infinite linear; 
}
@keyframes loader { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.passcode-container { min-height: 100vh; background-image: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.passcode-card { width: 100%; max-width: 380px; background-color: white; border-radius: 1.25rem; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5); text-align: center; padding: 2.5rem; }
.passcode-logo { width: 85px; height: 85px; margin: 0 auto 1.5rem; background-color: transparent; display: flex; align-items: center; justify-content: center; padding: 5px; }
.passcode-input { font-size: 1.5rem; letter-spacing: 0.2em; text-align: center; border: 2px solid #e5e7eb; border-radius: 0.5rem; padding: 0.75rem; width: 100%; margin: 0 auto; font-family: monospace; }
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 1rem; border-radius: 0.5rem; background-color: white; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05); display: flex; align-items: center; max-width: 350px; transform: translateX(calc(100% + 20px)); opacity: 0; transition: all .5s cubic-bezier(.68,-.55,.265,1.55); }
.toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { margin-right: 0.75rem; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: white; }
.toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; background-color: rgba(0,0,0,0.1); }
.toast-progress-bar { height: 100%; width: 0; transition: width linear; }
.toast-success .toast-icon, .toast-success .toast-progress-bar { background-color: var(--success); }
.toast-error .toast-icon, .toast-error .toast-progress-bar { background-color: var(--danger); }
.toast-info .toast-icon, .toast-info .toast-progress-bar { background-color: var(--info); }
.page-enter-active { animation: fadeIn 0.4s ease-out forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, visibility 0.3s ease; }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { background-color: white; border-radius: 0.75rem; width: 90%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--medium-grey); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.modal-title { font-size: 1.25rem; font-weight: 600; }
.modal-close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #6b7280; }
.modal-body { padding: 1.5rem; overflow-y: auto; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--medium-grey); display: flex; justify-content: flex-end; gap: 0.75rem; flex-shrink: 0; background-color: #f9fafb; }
.draggable-item { display: flex; align-items: center; background-color: white; border: 1px solid var(--medium-grey); border-radius: 0.5rem; padding: 0.75rem; gap: 1rem; margin-bottom: 0.75rem; transition: box-shadow .2s ease; }
.draggable-item:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06); }
.variant-type-block, .description-block, .spec-highlight-block { border: 1px solid var(--medium-grey); border-radius: 0.5rem; margin-bottom: 1rem; background-color: #ffffff; box-shadow: 0 1px 2px rgba(0,0,0,0.05); overflow: hidden; }
.variant-type-header, .description-block-header, .spec-highlight-header { display: flex; align-items: center; padding: 0.75rem 1rem; cursor: pointer; background-color: #f9fafb; border-bottom: 1px solid var(--medium-grey); }
.variant-type-header:hover, .description-block-header:hover, .spec-highlight-header:hover { background-color: var(--light-grey); }
.variant-type-body, .description-block-body, .spec-highlight-body { padding: 1.25rem; background-color: #ffffff; }
.remove-btn { background: none; border: none; cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0.25rem; }
.fa-chevron-down { transition: transform 0.3s ease; } 
.rotate-180 { transform: rotate(180deg); }
.combo-modal-content { display: flex; flex-direction: column; gap: 1rem; }
.combo-item { display: flex; gap: 0.75rem; align-items: center; }
.combo-item input[type="text"] { flex-grow: 1; }
.combo-item input[type="number"] { width: 100px; }
@media (max-width: 768px) { main#main-content-area { padding: 0.75rem; } .admin-card .card-body { padding: 1rem; } .admin-card { border: none; border-radius: 0; box-shadow: none; } }

/* === STYLES FOR CATEGORY SECTION & MODAL === */
.radio-group-wrapper { display: flex; gap: 0.5rem; border: 1px solid #d1d5db; border-radius: 0.5rem; padding: 0.25rem; background-color: #f9fafb; }
.radio-label { flex-grow: 1; display: block; cursor: pointer; position: relative; }
.radio-label input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-label span { display: block; text-align: center; padding: 0.5rem 1rem; border-radius: 0.375rem; font-weight: 500; font-size: 0.875rem; color: var(--dark-grey); transition: all 0.2s ease-in-out; }
.radio-label input[type="radio"]:checked + span { background-color: var(--primary); color: white; box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px 0 rgba(0,0,0,0.06); }
.radio-label:hover:not(:has(:checked)) span { background-color: var(--medium-grey); }

.badge { display: inline-flex; align-items: center; padding: 0.25rem 0.625rem; font-size: 0.75rem; font-weight: 500; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: 9999px; text-transform: capitalize; }
.badge-blue { color: #1e40af; background-color: #dbeafe; }
.badge-purple { color: #5b21b6; background-color: #ede9fe; }

.file-preview-wrapper { position: relative; width: 100%; max-width: 150px; }
.form-file-preview { aspect-ratio: 1/1; border: 2px dashed #d1d5db; border-radius: 0.5rem; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background-color: #f9fafb; transition: border-color .2s ease; }
.form-file-preview:hover { border-color: var(--primary); }
.form-file-preview img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 5; }
.form-file-preview .placeholder { z-index: 1; text-align: center; color: #6b7280; }
.form-file-upload { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.remove-media-btn { position: absolute; top: -0.5rem; right: -0.5rem; width: 1.75rem; height: 1.75rem; background-color: var(--danger); color: white; border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 3px rgba(0,0,0,0.2); z-index: 15; display: flex; align-items: center; justify-content: center; font-size: 1rem; cursor: pointer; transition: transform .2s ease; }
.remove-media-btn:hover { transform: scale(1.1); }
.remove-media-btn.hidden { display: none; }

/* === UPGRADED ORDERS PAGE STYLES (FIXED) === */
/* FIX 2: Tab container styling to prevent overflow */
nav[aria-label="Tabs"] {
    display: flex;
    justify-content: space-around; /* Distribute tabs evenly */
}
.tab-button {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--dark-grey);
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0; /* Prevent buttons from shrinking and pushing others out */
}
.tab-button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.order-card-wrapper {
    background-color: #fff;
    border-radius: 0.75rem;
    border: 1px solid var(--medium-grey);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}
.order-card-wrapper:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}
.order-card-compact {
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem 1.5rem;
    align-items: center;
}
.order-card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out, padding 0.5s ease-in-out;
    padding: 0 1.25rem;
}
.order-card-details.expanded {
    max-height: 800px; /* Adjust as needed */
    padding: 1.25rem;
    border-top: 1px solid var(--light-grey);
}
.copy-btn {
    background: none;
    border: none;
    color: var(--dark-grey);
    cursor: pointer;
    margin-left: 0.25rem;
    transition: color 0.2s;
}
.copy-btn:hover {
    color: var(--primary);
}
.vendor-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: #581c87; /* purple-900 */
    background-color: #f3e8ff; /* purple-100 */
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.ramazone-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1e40af; /* blue-800 */
    background-color: #dbeafe; /* blue-100 */
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}
.status-Confirmed { background-color: #e0f2fe; color: #0ea5e9; }
.status-Shipped { background-color: #dbeafe; color: #3b82f6; }
.status-Out-for-Delivery { background-color: #fef3c7; color: #f59e0b; }
.status-Delivered { background-color: #dcfce7; color: #22c55e; }
.status-Pending { background-color: #fee2e2; color: #ef4444; }
.status-Rejected { background-color: var(--medium-grey); color: var(--dark-grey); }

/* Invoice Template Styles (hidden by default) */
#invoice-template-container {
    position: absolute;
    left: -9999px; /* Move off-screen */
    top: -9999px;
    width: 800px; /* A4-like width */
    background-color: white;
    font-family: 'Poppins', sans-serif;
    color: #333;
    padding: 2rem;
}