/* --- KANASA Admin Dashboard Stylesheet --- */

/* --- Variables & Colors --- */
:root {
    --admin-bg-primary: #F8F6F2;
    --admin-bg-secondary: #ffffff;
    --admin-border-color: rgba(72, 48, 33, 0.08);
    --admin-text-primary: #483021;
    --admin-text-secondary: #7C685C;
    --admin-accent: #855829;
    --admin-accent-hover: #6D441D;
    --admin-accent-light: rgba(133, 88, 41, 0.06);
    --admin-card-shadow: 0 4px 20px rgba(72, 48, 33, 0.04);
    --admin-font-serif: 'Cormorant Garamond', serif;
    --admin-font-sans: 'Outfit', sans-serif;
    
    /* Status Colors */
    --status-pending-bg: #FEF3C7;
    --status-pending-text: #D97706;
    --status-processing-bg: #DBEAFE;
    --status-processing-text: #2563EB;
    --status-shipped-bg: #E0F2FE;
    --status-shipped-text: #0284C7;
    --status-delivered-bg: #D1FAE5;
    --status-delivered-text: #059669;
    
    /* Transition */
    --admin-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-admin-theme="dark"] {
    --admin-bg-primary: #121312;
    --admin-bg-secondary: #1C1D1C;
    --admin-border-color: rgba(255, 255, 255, 0.08);
    --admin-text-primary: #EFECE6;
    --admin-text-secondary: #A69E96;
    --admin-accent: #C4A882;
    --admin-accent-hover: #ECE5DC;
    --admin-accent-light: rgba(196, 168, 130, 0.1);
    --admin-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* --- Base Admin Reset --- */
body.admin-body {
    font-family: var(--admin-font-sans);
    background-color: var(--admin-bg-primary);
    color: var(--admin-text-primary);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Admin Login Layout --- */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: radial-gradient(circle at 10% 20%, rgba(133, 88, 41, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(72, 48, 33, 0.05) 0%, transparent 40%);
}

.login-card {
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--admin-card-shadow);
    transition: var(--admin-transition);
}

.login-logo {
    display: block;
    width: 140px;
    margin: 0 auto 1.5rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-family: var(--admin-font-serif);
    font-size: 2.2rem;
    font-weight: 500;
    color: var(--admin-text-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--admin-text-secondary);
}

.login-form .form-group {
    margin-bottom: 1.5rem;
}

.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
    color: var(--admin-text-secondary);
}

.login-input {
    width: 100%;
    padding: 0.85rem 1rem;
    font-family: var(--admin-font-sans);
    font-size: 1rem;
    color: var(--admin-text-primary);
    background-color: var(--admin-bg-primary);
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    transition: var(--admin-transition);
}

.login-input:focus {
    border-color: var(--admin-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--admin-accent-light);
}

.login-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--admin-accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-family: var(--admin-font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: var(--admin-transition);
    margin-top: 1rem;
}

.login-btn:hover {
    background-color: var(--admin-accent-hover);
}

.login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-error {
    background-color: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.login-demo-tip {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--admin-accent-light);
    border-radius: 8px;
    border: 1px dashed var(--admin-border-color);
    font-size: 0.85rem;
    color: var(--admin-text-secondary);
    text-align: center;
}

.login-demo-tip strong {
    color: var(--admin-text-primary);
}


/* --- Admin Dashboard Layout --- */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    background-color: var(--admin-bg-secondary);
    border-right: 1px solid var(--admin-border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--admin-transition);
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    width: 110px;
}

.sidebar-close-btn {
    display: none;
    cursor: pointer;
    color: var(--admin-text-secondary);
}

.sidebar-nav {
    flex: 1;
    padding: 1.25rem 1rem;
    overflow-y: auto;
}

.nav-heading {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--admin-text-secondary);
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    color: var(--admin-text-secondary);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    transition: var(--admin-transition);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--admin-text-primary);
    background-color: var(--admin-accent-light);
}

.sidebar-link.active {
    border-left: 3px solid var(--admin-accent);
    padding-left: calc(1rem - 3px);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    stroke-width: 2px;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--admin-border-color);
}

.admin-profile-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--admin-accent);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.profile-info {
    flex: 1;
    overflow: hidden;
}

.profile-name {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--admin-transition);
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.02);
}

.btn-logout:hover {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
}


/* Main Content Styling */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 1.5rem;
    min-height: 100vh;
    transition: var(--admin-transition);
}

/* Header Styling */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border-color);
}

.header-left h1 {
    font-family: var(--admin-font-serif);
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.header-left p {
    font-size: 0.95rem;
    color: var(--admin-text-secondary);
}

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

.admin-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 50%;
    cursor: pointer;
    color: var(--admin-text-secondary);
    box-shadow: var(--admin-card-shadow);
    transition: var(--admin-transition);
}

.admin-theme-toggle:hover {
    color: var(--admin-text-primary);
    transform: scale(1.05);
}

.admin-menu-toggle {
    display: none;
    cursor: pointer;
    color: var(--admin-text-primary);
    background: none;
    border: none;
}


/* --- Metrics Grid --- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    padding: 1.15rem;
    box-shadow: var(--admin-card-shadow);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: var(--admin-transition);
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(72, 48, 33, 0.06);
}

.metric-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-text-secondary);
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.metric-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.metric-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.metric-trend.up {
    background-color: rgba(5, 150, 105, 0.08);
    color: #059669;
}

.metric-trend.down {
    background-color: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

.metric-trend.neutral {
    background-color: rgba(107, 114, 128, 0.08);
    color: #6b7280;
}

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

.metric-icon-box {
    width: 44px;
    height: 44px;
    background-color: var(--admin-accent-light);
    color: var(--admin-accent);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.metric-icon-box svg {
    width: 22px;
    height: 22px;
}


/* --- Charts Section --- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--admin-card-shadow);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.chart-container {
    position: relative;
    width: 100%;
}


/* --- Double Column Table Area --- */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.table-card {
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--admin-card-shadow);
}

.table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.table-card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-action-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--admin-transition);
}

.btn-action-small:hover {
    background-color: var(--admin-bg-primary);
}

/* Responsive Table Wrapper */
.responsive-table-wrap {
    overflow-x: auto;
    width: 100%;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    padding: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-text-secondary);
    border-bottom: 2px solid var(--admin-border-color);
}

.admin-table td {
    padding: 1rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--admin-border-color);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: var(--admin-transition);
}

.admin-table tbody tr:hover {
    background-color: rgba(72, 48, 33, 0.01);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge.pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.status-badge.processing {
    background-color: var(--status-processing-bg);
    color: var(--status-processing-text);
}

.status-badge.shipped {
    background-color: var(--status-shipped-bg);
    color: var(--status-shipped-text);
}

.status-badge.delivered {
    background-color: var(--status-delivered-bg);
    color: var(--status-delivered-text);
}

.status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Stock Indicator */
.stock-badge {
    font-weight: 600;
}

.stock-badge.instock {
    color: #059669;
}

.stock-badge.lowstock {
    color: #d97706;
}

.stock-badge.outofstock {
    color: #ef4444;
}

/* Product list widget */
.mini-product-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mini-product-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    background-color: var(--admin-bg-primary);
    border: 1px solid var(--admin-border-color);
}

.mini-product-info {
    display: flex;
    flex-direction: column;
}

.mini-product-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.mini-product-model {
    font-size: 0.75rem;
    color: var(--admin-text-secondary);
}

/* Action button icons */
.action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--admin-border-color);
    cursor: pointer;
    color: var(--admin-text-secondary);
    transition: var(--admin-transition);
}

.action-icon-btn:hover {
    color: var(--admin-accent);
    border-color: var(--admin-accent);
    background-color: var(--admin-accent-light);
}

.action-icon-btn svg {
    width: 16px;
    height: 16px;
}


/* --- Modal Popup (Status Editor) --- */
.admin-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(28, 29, 28, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: var(--admin-transition);
}

.admin-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.admin-modal {
    background-color: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: var(--admin-card-shadow);
    transform: translateY(20px);
    transition: var(--admin-transition);
    overflow: hidden;
}

.admin-modal-overlay.active .admin-modal {
    transform: translateY(0);
}

.admin-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.admin-modal-close {
    cursor: pointer;
    color: var(--admin-text-secondary);
    transition: var(--admin-transition);
}

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

.admin-modal-body {
    padding: 1.5rem;
}

.admin-modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--admin-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: rgba(72, 48, 33, 0.01);
}

.btn-secondary {
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--admin-text-primary);
    transition: var(--admin-transition);
}

.btn-secondary:hover {
    background-color: var(--admin-bg-primary);
}

.btn-primary {
    padding: 0.65rem 1.25rem;
    background-color: var(--admin-accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--admin-transition);
}

.btn-primary:hover {
    background-color: var(--admin-accent-hover);
}


/* --- Responsive Adjustments --- */

/* Small desktop / tablet wide */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet portrait */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close-btn {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .admin-menu-toggle {
        display: block;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile phones */
@media (max-width: 576px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .login-card {
        padding: 2rem 1.5rem;
    }
}

/* ====================================================================
   PRODUCT MANAGEMENT STYLES
   ==================================================================== */

/* --- Products Toolbar --- */
.products-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-left {
    flex: 1;
    min-width: 0;
}

.products-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    padding: 6px 12px;
    flex: 1;
    min-width: 180px;
    max-width: 280px;
    transition: border-color 0.2s;
}

.search-input-wrapper:focus-within {
    border-color: var(--admin-accent);
}

.products-search-input {
    border: none;
    background: transparent;
    outline: none;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--admin-text-primary);
    width: 100%;
}

.products-filter-select {
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    padding: 7px 10px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    background: var(--admin-bg-secondary);
    color: var(--admin-text-primary);
    cursor: pointer;
    outline: none;
}

.btn-filter-apply {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 7px 14px;
    border: 1px solid var(--admin-accent);
    border-radius: 8px;
    background: transparent;
    color: var(--admin-accent);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-filter-apply:hover {
    background: var(--admin-accent);
    color: #fff;
}

.btn-add-product {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 8px;
    background: var(--admin-accent);
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-add-product:hover {
    background: var(--admin-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Products Table --- */
.admin-table-container {
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    overflow-x: auto;
}

.admin-products-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
}

.admin-products-table thead th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    border-bottom: 1px solid var(--admin-border-color);
    white-space: nowrap;
}

.admin-products-table tbody tr {
    border-bottom: 1px solid var(--admin-border-color);
    transition: background-color 0.15s;
}

.admin-products-table tbody tr:last-child {
    border-bottom: none;
}

.admin-products-table tbody tr:hover {
    background-color: rgba(72, 48, 33, 0.02);
}

.admin-products-table tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    color: var(--admin-text-primary);
}

.row-inactive {
    opacity: 0.5;
}

.cell-id {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
}

.product-thumb-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--admin-border-color);
}

.product-thumb-placeholder {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px dashed var(--admin-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text-muted);
}

.product-name-text {
    font-weight: 500;
}

.model-badge {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(72, 48, 33, 0.06);
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.price-current {
    font-weight: 600;
    display: block;
}

.price-original {
    font-size: 0.75rem;
    text-decoration: line-through;
    color: var(--admin-text-muted);
}

.category-pill {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(72, 48, 33, 0.06);
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 500;
}

.stock-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

.stock-ok {
    background: #d1fae5;
    color: #065f46;
}

.stock-low {
    background: #fef3c7;
    color: #92400e;
}

.stock-out {
    background: #fee2e2;
    color: #991b1b;
}

/* Toggle switch */
.status-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.toggle-track {
    display: block;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: #d1d5db;
    position: relative;
    transition: background 0.2s;
}

.toggle-thumb {
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.status-toggle-btn.active .toggle-track {
    background: #10b981;
}

.status-toggle-btn.active .toggle-thumb {
    transform: translateX(16px);
}

/* Action buttons */
.cell-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--admin-border-color);
    background: transparent;
    color: var(--admin-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.action-btn:hover {
    background: var(--admin-bg-primary);
}

.edit-btn:hover {
    color: var(--admin-accent);
    border-color: var(--admin-accent);
}

.delete-btn:hover {
    color: #dc2626;
    border-color: #dc2626;
}

/* --- Product Form --- */
.product-form {
    max-width: 900px;
}

.form-section {
    background: var(--admin-bg-secondary);
    border: 1px solid var(--admin-border-color);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 16px;
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--admin-text-primary);
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border-color);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.form-group label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--admin-text-muted);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    background: var(--admin-bg-primary);
    color: var(--admin-text-primary);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--admin-accent);
}

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

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--admin-text-primary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--admin-accent);
}

/* Dynamic rows (features, specs) */
.dynamic-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.dynamic-row input {
    flex: 1;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    background: var(--admin-bg-primary);
    color: var(--admin-text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.dynamic-row input:focus {
    border-color: var(--admin-accent);
}

.spec-row input:first-child {
    flex: 0.4;
}

.btn-add-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px dashed var(--admin-accent);
    background: transparent;
    color: var(--admin-accent);
    cursor: pointer;
    margin-left: auto;
    transition: all 0.2s;
}

.btn-add-row:hover {
    background: var(--admin-accent);
    color: #fff;
    border-style: solid;
}

.btn-remove-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--admin-text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.btn-remove-row:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Color variant cards */
.color-variant-card {
    border: 1px solid var(--admin-border-color);
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    background: var(--admin-bg-primary);
}

.color-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--admin-border-color);
    background: var(--admin-bg-secondary);
}

.color-preview-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--admin-border-color);
    flex-shrink: 0;
}

.color-card-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    flex: 1;
}

.color-card-body {
    padding: 14px;
}

.color-hex-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker-input {
    width: 36px !important;
    height: 32px !important;
    padding: 2px !important;
    border: 1px solid var(--admin-border-color) !important;
    border-radius: 6px !important;
    cursor: pointer;
    background: none !important;
}

.hex-display {
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    color: var(--admin-text-muted);
}

.sizes-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.size-checkbox {
    cursor: pointer;
}

.size-checkbox input {
    display: none;
}

.size-checkbox span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 32px;
    border: 1px solid var(--admin-border-color);
    border-radius: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--admin-text-primary);
    transition: all 0.15s;
    background: var(--admin-bg-secondary);
}

.size-checkbox input:checked + span {
    background: var(--admin-accent);
    color: #fff;
    border-color: var(--admin-accent);
}

.size-checkbox:hover span {
    border-color: var(--admin-accent);
}

/* Form actions bar */
.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 0;
}

.btn-form-cancel {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 8px 20px;
    border: 1px solid var(--admin-border-color);
    border-radius: 8px;
    background: var(--admin-bg-secondary);
    color: var(--admin-text-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-form-cancel:hover {
    background: var(--admin-bg-primary);
}

.btn-form-save {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 24px;
    border: none;
    border-radius: 8px;
    background: var(--admin-accent);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-form-save:hover {
    background: var(--admin-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Back link on form page */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    color: var(--admin-text-muted);
    text-decoration: none;
    margin-bottom: 4px;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--admin-accent);
}

/* --- Product Form Responsive --- */
@media (max-width: 768px) {
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .products-search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper {
        max-width: 100%;
    }

    .toolbar-right {
        text-align: center;
    }

    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .form-section {
        padding: 14px 16px;
    }

    .admin-products-table {
        font-size: 0.78rem;
    }

    .admin-products-table thead th,
    .admin-products-table tbody td {
        padding: 8px 8px;
    }

    .product-thumb-img {
        width: 36px;
        height: 36px;
    }

    /* Hide less important columns on mobile */
    .admin-products-table .cell-model,
    .admin-products-table .cell-gender,
    .admin-products-table .cell-colors {
        display: none;
    }
    .admin-products-table thead th:nth-child(4),
    .admin-products-table thead th:nth-child(7),
    .admin-products-table thead th:nth-child(9) {
        display: none;
    }
}

@media (max-width: 480px) {
    .form-grid-2,
    .form-grid-3,
    .form-grid-4 {
        grid-template-columns: 1fr;
    }

    .color-card-body .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* --- Color Image Management Section --- */
.color-image-management-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--admin-border-color);
}

.section-sub-label {
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--admin-text-muted);
    display: block;
    margin-bottom: 8px;
}

.color-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.no-images-notice {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: rgba(72, 48, 33, 0.03);
    border-radius: 8px;
    color: var(--admin-text-muted);
    font-size: 0.8rem;
}

.no-images-notice i {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.color-image-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--admin-border-color);
    background: #fff;
    transition: all 0.2s ease;
}

.color-image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.color-image-thumb:hover img {
    transform: scale(1.05);
}

.image-delete-overlay {
    position: absolute;
    top: 6px;
    right: 6px;
    cursor: pointer;
    z-index: 10;
}

.delete-img-checkbox {
    display: none;
}

.delete-icon-wrapper {
    background: rgba(255, 255, 255, 0.9);
    color: #9ca3af;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.delete-icon-wrapper i {
    width: 12px;
    height: 12px;
    transition: all 0.2s ease;
}

.color-image-thumb:hover .delete-icon-wrapper {
    color: #dc2626;
}

/* Checked state for deletion */
.delete-img-checkbox:checked + .delete-icon-wrapper {
    background: #dc2626;
    color: #fff;
}

.delete-img-checkbox:checked + .delete-icon-wrapper i {
    transform: rotate(45deg);
}

.color-image-thumb:has(.delete-img-checkbox:checked) {
    border-color: #dc2626;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.color-image-thumb:has(.delete-img-checkbox:checked) img {
    filter: grayscale(1) opacity(0.25);
}

/* --- File Upload Area --- */
.file-upload-wrapper {
    position: relative;
    width: 100%;
}

.color-image-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important;
    cursor: pointer;
    z-index: 2;
}

.file-upload-drag-area {
    border: 2px dashed var(--admin-border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    background: var(--admin-bg-secondary);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.file-upload-drag-area i {
    width: 24px;
    height: 24px;
    color: var(--admin-text-muted);
    transition: color 0.2s;
}

.file-upload-drag-area span {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--admin-text-muted);
}

.file-upload-wrapper:hover .file-upload-drag-area {
    border-color: var(--admin-accent);
    background: rgba(72, 48, 33, 0.01);
}

.file-upload-wrapper:hover .file-upload-drag-area i {
    color: var(--admin-accent);
}

/* --- Primary Image Selection Swatches --- */
.image-primary-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
    cursor: pointer;
    z-index: 10;
}

.primary-img-radio {
    display: none;
}

.star-icon-wrapper {
    background: rgba(255, 255, 255, 0.9);
    color: #9ca3af;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.star-icon-wrapper i {
    width: 12px;
    height: 12px;
    fill: none;
    transition: all 0.2s ease;
}

.color-image-thumb:hover .star-icon-wrapper {
    color: #eab308; /* yellow-500 */
}

/* Checked state for primary image selection */
.primary-img-radio:checked + .star-icon-wrapper {
    background: #eab308;
    color: #fff;
}

.primary-img-radio:checked + .star-icon-wrapper i {
    fill: currentColor;
}



