/* ============================================================
   LA CASA DEL TORNILLO - PANEL ADMINISTRATIVO CSS
   Theme: Navy (#0A2540) & Gold (#FDC101) Modern Dashboard
   ============================================================ */

:root {
    --primary: #0A2540;
    --primary-dark: #061527;
    --primary-light: #16375c;
    --accent-gold: #FDC101;
    --accent-gold-hover: #E5AC00;
    --accent-gold-soft: rgba(253, 193, 1, 0.15);
    
    --bg-body: #F4F6F9;
    --bg-card: #FFFFFF;
    --bg-input: #F8FAFC;
    
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --border-color: #E2E8F0;
    
    --success: #10B981;
    --success-soft: rgba(16, 185, 129, 0.12);
    --warning: #F59E0B;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #EF4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #3B82F6;
    --info-soft: rgba(59, 130, 246, 0.12);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== UTILITIES ==================== */
.hidden { display: none !important; }
.text-green { color: var(--success); }
.text-gold { color: var(--accent-gold); }
.text-muted { color: var(--text-muted); }
.font-sm { font-size: 0.875rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.max-w-600 { max-width: 600px; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: var(--font-body);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--primary);
    color: #FFFFFF;
}
.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-gold {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
}
.btn-gold:hover {
    background-color: var(--accent-gold-hover);
    box-shadow: 0 4px 12px rgba(253, 193, 1, 0.35);
    transform: translateY(-1px);
}

.btn-white {
    background-color: #FFFFFF;
    color: var(--primary);
    border-color: var(--border-color);
}
.btn-white:hover {
    background-color: #F8FAFC;
}

.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-outline:hover {
    background-color: #EDF2F7;
}

.btn-outline-light {
    background-color: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.2);
}
.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.btn-danger-soft {
    background-color: var(--danger-soft);
    color: var(--danger);
}
.btn-danger-soft:hover {
    background-color: var(--danger);
    color: #FFFFFF;
}

/* ==================== LOGIN SCREEN ==================== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, #0c2f52 0%, #061527 90%);
}

.login-card {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 440px;
    padding: 36px 32px;
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0A2540;
    padding: 18px 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 24px rgba(10, 37, 64, 0.22);
    margin-bottom: 20px;
    border: 1px solid rgba(253, 193, 1, 0.35);
}

.login-logo {
    max-width: 175px;
    height: auto;
    display: block;
}

.login-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.login-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    pointer-events: none;
}

.input-with-icon input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    font-size: 0.95rem;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.input-with-icon input:focus,
input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.12);
}

.login-error {
    background-color: var(--danger-soft);
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.login-footer a {
    display: inline-block;
    margin-top: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* ==================== ADMIN APP LAYOUT ==================== */
.admin-app {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.sidebar-brand .brand-title {
    display: block;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: #FFFFFF;
    line-height: 1.2;
}

.sidebar-brand .brand-sub {
    font-size: 0.72rem;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.mobile-sidebar-close {
    display: none;
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
}

.user-info .user-name {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
}

.user-info .user-role {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    margin-bottom: 4px;
    font-family: var(--font-body);
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.nav-item.active {
    background-color: var(--accent-gold);
    color: var(--primary-dark);
    font-weight: 700;
}

.nav-badge {
    margin-left: auto;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.nav-item.active .nav-badge {
    background-color: var(--primary-dark);
    color: #FFFFFF;
}

.sidebar-footer {
    padding: 16px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Main Area */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.admin-topbar {
    height: var(--topbar-height);
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--border-color);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
}

.page-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pill.synced {
    background-color: var(--success-soft);
    color: var(--success);
}
.status-pill.synced .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
}

.status-pill.pending {
    background-color: var(--warning-soft);
    color: var(--warning);
}
.status-pill.pending .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.25); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.status-pill.db-pill {
    background-color: #f1f5f9;
    color: #475569;
    transition: all 0.2s;
}
.status-pill.db-pill:hover {
    background-color: #e2e8f0;
}
.status-pill.db-pill.connected {
    background-color: #E8F5E9;
    color: #2E7D32;
}
.status-pill.db-pill.connected .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #2E7D32;
}
.status-pill.db-pill.local {
    background-color: #E3F2FD;
    color: #1565C0;
}
.status-pill.db-pill.local .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #1976D2;
}

/* Content Sections */
.tab-content {
    display: none;
    padding: 28px;
}
.tab-content.active {
    display: block;
}

/* ==================== DASHBOARD STYLES ==================== */
.dashboard-banner {
    background: linear-gradient(135deg, var(--primary) 0%, #153e6b 100%);
    color: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 28px 32px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: var(--shadow-md);
}

.banner-text h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.banner-text p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 650px;
}

.banner-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

/* Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-icon.bg-blue { background-color: var(--info-soft); color: var(--info); }
.metric-icon.bg-gold { background-color: var(--accent-gold-soft); color: #B48200; }
.metric-icon.bg-green { background-color: var(--success-soft); color: var(--success); }
.metric-icon.bg-purple { background-color: rgba(147, 51, 234, 0.12); color: #9333ea; }

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.metric-value {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
}

/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.card-body {
    padding: 24px;
}

/* Category breakdown list */
.category-breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
}

.cat-breakdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
}

.cat-breakdown-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.cat-breakdown-info svg {
    width: 18px;
    height: 18px;
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.cat-breakdown-count {
    background-color: #FFFFFF;
    border: 1px solid var(--border-color);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
}

/* Quick Actions */
.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.2s;
    width: 100%;
}

.quick-action-btn:hover {
    background-color: #FFFFFF;
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.qa-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.qa-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.qa-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.qa-info strong {
    font-size: 0.92rem;
    color: var(--primary);
}

.qa-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.qa-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: transform 0.2s ease, color 0.2s ease;
}

.qa-arrow svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
}

.quick-action-btn:hover .qa-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* ==================== PRODUCTS TAB ==================== */
.products-toolbar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 460px;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 12px;
    color: var(--text-light);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    font-size: 0.92rem;
    font-family: var(--font-body);
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.select-control {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text-main);
    cursor: pointer;
}

.products-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.products-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.products-table th {
    background-color: #F8FAFC;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.products-table tbody tr:hover {
    background-color: #F8FAFC;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    object-fit: contain;
    background-color: #FFFFFF;
    padding: 2px;
}

.prod-name-cell strong {
    display: block;
    color: var(--primary);
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.prod-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.76rem;
    font-weight: 600;
    background-color: #F1F5F9;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

.prod-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.prod-specs-cell {
    max-width: 280px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sizes-pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 220px;
}

.size-pill {
    background-color: #F1F5F9;
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    font-weight: 600;
}

.table-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.btn-icon-action {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background-color: #FFFFFF;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon-action:hover {
    background-color: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.btn-icon-action.delete:hover {
    background-color: var(--danger);
    color: #FFFFFF;
    border-color: var(--danger);
}

.btn-icon-action svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    pointer-events: none;
    transition: transform 0.12s ease;
}

.btn-icon-action:hover svg {
    transform: scale(1.1);
}

.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 12px;
    color: var(--text-light);
}

.empty-state h3 {
    color: var(--primary);
    margin-bottom: 6px;
}

/* ==================== CATEGORIES TAB ==================== */
.categories-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

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

.category-admin-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-admin-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: #F8FAFC;
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.category-admin-card:hover .cat-card-icon {
    background-color: var(--accent-gold-soft);
    border-color: var(--accent-gold);
    color: #B48200;
}

.cat-card-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.cat-card-title h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

.cat-card-title span {
    font-size: 0.75rem;
    color: var(--text-light);
}

.cat-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    margin-top: 8px;
}

.cat-prod-count {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ==================== PUBLISH & BACKUPS TAB ==================== */
.publish-hero-card {
    margin-bottom: 24px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
    border: 2px solid var(--border-color);
}

.publish-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px 28px;
    gap: 24px;
}

.status-indicator-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background-color: var(--accent-gold-soft);
    color: #B48200;
    flex-shrink: 0;
}

.indicator-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
}

.indicator-info h3 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.indicator-info p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.backups-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.backup-btn-row {
    display: flex;
    gap: 12px;
}

.server-backups-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 14px;
}

.backup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.backup-item .backup-name {
    font-weight: 600;
    color: var(--primary);
}

.backup-item .backup-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(6, 21, 39, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-dialog {
    background-color: #FFFFFF;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 550px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

.modal-dialog.modal-lg {
    max-width: 760px;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s;
}

.modal-close:hover {
    background-color: var(--bg-body);
    color: var(--danger);
}

.modal-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 16px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    font-size: 0.9rem;
    font-family: var(--font-body);
    color: var(--text-main);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Tags Input (Medidas) */
.tags-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-input);
    min-height: 46px;
    margin-top: 6px;
}

.tags-input-container:focus-within {
    border-color: var(--primary);
    background-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(10, 37, 64, 0.12);
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--primary);
    color: #FFFFFF;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-badge .tag-remove {
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.8;
}
.tag-badge .tag-remove:hover {
    opacity: 1;
}

.tags-input-container input {
    border: none !important;
    background: transparent !important;
    padding: 4px 6px !important;
    font-size: 0.88rem !important;
    flex: 1;
    min-width: 140px;
    box-shadow: none !important;
}

.common-sizes-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    font-size: 0.78rem;
}

.common-sizes-bar .label {
    color: var(--text-muted);
    font-weight: 600;
}

.quick-size-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-chip {
    background-color: #EDF2F7;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.15s;
}

.quick-chip:hover {
    background-color: var(--accent-gold);
    border-color: var(--accent-gold);
    color: var(--primary-dark);
}

/* Image Uploader Box */
.image-uploader-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-top: 8px;
}

.image-preview-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F8FAFC;
    flex-shrink: 0;
    overflow: hidden;
}

.image-preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.btn-remove-img {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: rgba(239, 68, 68, 0.9);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.btn-remove-img svg {
    width: 12px;
    height: 12px;
    stroke: #FFFFFF;
    stroke-width: 2.5;
    fill: none;
}

.image-upload-options {
    flex: 1;
}

.upload-dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    cursor: pointer;
    background-color: var(--bg-input);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(10, 37, 64, 0.04);
}

.upload-dropzone span {
    font-size: 0.85rem;
    color: var(--text-main);
}

.upload-dropzone .format-hint {
    font-size: 0.75rem;
    color: var(--text-light);
}

.input-with-button {
    display: flex;
    gap: 8px;
}

/* Official Icons Selector in Category Modal */
.icon-selector-wrapper {
    margin-top: 8px;
}

.selected-icon-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background-color: #F8FAFC;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
}

.preview-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.preview-box {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background-color: #FFFFFF;
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.88rem;
}

.preview-box svg {
    width: 22px;
    height: 22px;
    stroke: var(--primary);
    stroke-width: 2;
    fill: none;
}

.official-icons-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.official-icons-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #FFFFFF;
}

.icon-chip-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: #F8FAFC;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.icon-chip-btn:hover {
    background-color: #EDF2F7;
    border-color: var(--primary);
    color: var(--primary);
}

.icon-chip-btn.active {
    background-color: var(--accent-gold-soft);
    border-color: var(--accent-gold);
    color: var(--primary-dark);
    font-weight: 700;
}

.icon-chip-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.icon-chip-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Image Gallery Modal Grid */
.image-gallery-search {
    margin-bottom: 16px;
}
.image-gallery-search input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.gallery-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    background-color: #FFFFFF;
}

.gallery-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.gallery-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    margin-bottom: 4px;
}

.gallery-item span {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 200;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background-color: #FFFFFF;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid var(--primary);
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 18px;
    height: 18px;
    fill: none;
    display: block;
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 1024px) {
    .dashboard-sections {
        grid-template-columns: 1fr;
    }
    .backups-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .mobile-sidebar-close {
        display: block;
    }
    .mobile-menu-btn {
        display: block;
    }
    .admin-main {
        margin-left: 0;
    }
    .dashboard-banner {
        flex-direction: column;
        align-items: flex-start;
    }
    .products-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: none;
    }
    .filter-controls {
        flex-direction: column;
    }
    .publish-hero-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .image-uploader-box {
        flex-direction: column;
        align-items: center;
    }
}
