/* Admin Portal Styles */

:root {
    --primary-color: #4285f4;
    --secondary-color: #34a853;
    --danger-color: #ea4335;
    --warning-color: #fbbc04;

    /* Layered System - Light Mode */
    --bg-primary: #f5f5f5;
    /* Main background */
    --bg-secondary: #ffffff;
    /* Sidebar/Header */
    --bg-card: #ffffff;
    /* Cards */
    --bg-tertiary: #f8f9fa;
    /* Hovers/Table stripes */

    --border-color: #e0e0e0;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;

    /* Legacy mapping */
    --light-bg: var(--bg-primary);
    --dark-bg: var(--text-primary);
}

html.dark-mode {
    /* Layered System - Dark Mode (Professional Neutral/Slate) */
    --bg-primary: #0d1117;
    /* Deepest background */
    --bg-secondary: #161b22;
    /* Sidebar/Header */
    --bg-card: #161b22;
    /* Cards match secondary for clean look */
    --bg-tertiary: #21262d;
    /* Inputs, Hovers, Table stripes */

    --text-primary: #c9d1d9;
    /* Soft white */
    --text-secondary: #8b949e;
    /* Slate gray */
    --text-muted: #6e7681;

    --border-color: #30363d;
    /* Subtle border */

    /* Legacy mapping */
    --light-bg: var(--bg-primary);
}

/* Header Button */
.header-button {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    margin-right: 1rem;
    color: var(--text-secondary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.header-button:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

html.dark-mode .admin-header {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .header-left h1 {
    color: var(--text-primary);
}

html.dark-mode .header-button {
    color: var(--text-primary) !important;
}

html.dark-mode .content-section,
html.dark-mode .photo-card,
html.dark-mode .sidebar,
html.dark-mode .stat-card,
html.dark-mode .collection-card,
html.dark-mode .info-box,
html.dark-mode .message-box,
html.dark-mode .section-content,
html.dark-mode .products-table-container,
html.dark-mode .login-box,
html.dark-mode .filter-select {
    background-color: var(--bg-card) !important;
    border-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .modal-content {
    background-color: #1e1e1e;
    border-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .modal-close {
    color: var(--text-primary);
}

html.dark-mode .nav-item {
    color: var(--text-secondary);
}

html.dark-mode .nav-item:hover,
html.dark-mode .nav-item.active {
    background-color: rgba(66, 133, 244, 0.1);
    color: var(--primary-color);
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background-color: #2d2d2d;
    border-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .table-container {
    background-color: #1e1e1e;
}

html.dark-mode .data-table th {
    background-color: #2d2d2d;
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

html.dark-mode .data-table td {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .photo-thumbnail-item {
    background-color: #1e1e1e;
    border-color: var(--border-color);
}

html.dark-mode .photo-checkbox {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

html.dark-mode .login-container {
    background-color: var(--light-bg);
}

html.dark-mode .product-card {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

html.dark-mode .nav-item.active {
    background-color: rgba(66, 133, 244, 0.1);
    color: var(--primary-color);
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea {
    background-color: #2d2d2d;
    border-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode .table-container {
    background-color: #1e1e1e;
}

html.dark-mode .data-table th {
    background-color: #2d2d2d;
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

html.dark-mode .data-table td {
    border-bottom-color: var(--border-color);
    color: var(--text-primary);
}

html.dark-mode tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

html.dark-mode .photo-thumbnail-item {
    background-color: #2d2d2d;
    border-color: var(--border-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Login Screen */
.login-container {
    display: flex !important;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Hide login screen when dashboard is shown */
.login-container.hidden,
.login-container[style*="display: none"],
.login-container[style*="display:none"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--border-color);
}

.login-box h1 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.login-button:hover {
    background: #357ae8;
}

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    display: none;
}

.loading-spinner {
    margin-top: 1rem;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Portal Dashboard */
.admin-dashboard {
    display: none;
    /* Hidden by default */
    flex-direction: column;
    height: 100vh;
    background: var(--light-bg);
    position: relative;
    z-index: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Show dashboard when authenticated */
.admin-dashboard.visible,
.admin-dashboard[style*="display: flex"],
.admin-dashboard[style*="display:flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
}

.admin-header {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-left h1 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.header-left h1 i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
    background: var(--primary-color);
}

.user-avatar-initials {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.user-details {
    text-align: right;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.logout-button {
    padding: 0.5rem 1rem;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.logout-button:hover {
    background: #d33b2c;
}

/* Admin Main Layout */
.admin-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--light-bg);
}

.nav-item.active {
    background: rgba(66, 133, 244, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.admin-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.content-section {
    display: none;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.section-content {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #357ae8;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #d33b2c;
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #555;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(66, 133, 244, 0.1);
    color: var(--primary-color);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--text-primary);
}

.data-table tr:hover {
    background: var(--light-bg);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content.large-modal {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem;
}

.photo-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 540px;
    display: flex;
    flex-direction: column;
}

.photo-card img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: #f8f9fa;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s, border-color 0.3s;
}

/* Dark mode override for photo letterboxing */
.dark-mode .photo-card img,
[data-theme="dark"] .photo-card img {
    background: #2d2d2d;
    border-bottom-color: #404040;
}

.photo-card-content {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.photo-card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.photo-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

/* Collection List */
.collection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.collection-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-card h3 {
    margin-bottom: 0.5rem;
}

.collection-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.collection-card-actions {
    display: flex;
    gap: 0.5rem;
}

/* Loading */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: -2px;
}

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

.support-tab,
.accounting-tab {
    display: none;
}

.support-tab.active,
.accounting-tab.active {
    display: block;
}

/* Info Box */
.info-box {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-box h3 {
    margin-bottom: 1rem;
}

.info-box pre {
    background: var(--light-bg);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9rem;
}

/* Filter Group */
.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Stripe Elements */
#card-element {
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

#card-errors {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
    }

    .nav-item {
        white-space: nowrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Photo Thumbnail Selection Styles */
.photo-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.photo-thumbnail-item {
    position: relative;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.photo-thumbnail-item:hover:not(.in-collection) {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.photo-thumbnail-item.in-collection {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: #ccc;
}

.photo-thumbnail-item.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.2);
}

.photo-checkbox {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 24px;
    height: 24px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.photo-checkbox input[type="checkbox"]:checked {
    accent-color: var(--primary-color);
}

.photo-thumbnail-item img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

@media (max-width: 768px) {
    .photo-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
    }
}

/* Products Page Styles */
.products-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    overflow-x: auto;
}

.product-info-cell {
    min-width: 300px;
}

.product-info-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.product-thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
}

.product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.markup-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.markup-input {
    text-align: right;
    padding-right: 0.5rem;
}

.input-suffix {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--secondary-color);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--secondary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

/* Badge Styles */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

/* Utilities */
.text-sm {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.text-secondary {
    color: var(--text-secondary);
}

.font-bold {
    font-weight: 600;
}

.opacity-50 {
    opacity: 0.5;
}



.category-section {
    margin-bottom: 2rem;
}

/* SortableJS Styles */
.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
}

.sortable-chosen {
    background-color: #eef7ff;
}

.sortable-drag {
    cursor: grabbing;
    opacity: 1;
    background-color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

/* Bulk Actions */
.photo-card {
    position: relative;
}

.photo-checkbox-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
}

.photo-card:hover .photo-checkbox-container,
.photo-card.selected .photo-checkbox-container {
    opacity: 1;
}

.photo-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.photo-card.selected {
    border: 2px solid #007bff;
    background-color: #f0f7ff;
}

.bulk-actions-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.bulk-actions-bar.active {
    transform: translateY(0);
}

.bulk-actions-info {
    font-weight: 500;
    color: #333;
}

.bulk-actions-buttons {
    display: flex;
    gap: 1rem;
}

.drag-handle {
    cursor: grab;
    padding: 0.5rem;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drag-handle:hover {
    color: #333;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-header {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.product-card {
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.product-card.disabled {
    opacity: 0.6;
    background: #f5f5f5;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.product-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.4;
}

.product-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.product-size,
.product-material {
    background: #e9ecef;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.product-price {
    margin: 0.75rem 0;
}

.product-price .price {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.price-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

.base-price {
    color: var(--text-secondary);
}

.markup {
    background: #d4edda;
    color: #155724;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.product-sku {
    margin: 0.5rem 0;
    font-size: 0.75rem;
    color: #999;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

/* Large Modal */
.large-modal {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.pricing-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.pricing-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.pricing-section small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Alert Box */
.alert-box {
    background: #e7f3ff;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    color: #333;
}

html.dark-mode .alert-box {
    background: rgba(66, 133, 244, 0.15);
    border-left-color: var(--primary-color);
    color: var(--text-primary);
}

html.dark-mode .alert-box strong {
    color: var(--text-primary);
}

html.dark-mode .alert-box ul,
html.dark-mode .alert-box p {
    color: var(--text-secondary) !important;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25em 0.5em;
    font-size: 0.75em;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-secondary {
    color: #383d41;
    background-color: #e2e3e5;
}

html.dark-mode .badge-secondary {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

/* Header Button (Theme Toggle) */
.header-button {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-button:hover {
    background-color: var(--bg-tertiary);
    /* Use variable instead of hardcoded secondary */
}

/* Portal Photo Edit Navigation & Theme Toggle */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.navbar-brand a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-tertiary);
    transition: all 0.2s ease;
}

.navbar-brand a:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand i {
    font-size: 0.9em;
}

.navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Theme Toggle Button specific to this page if different from header-button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.theme-toggle i {
    font-size: 1.1rem;
}