/* ============================================
   ARGYM.COMPONENTS - Blazor Component Library
   Theme: Warm & Organic
   ============================================ */

/* ========== CSS VARIABLES ========== */
:root {
    /* Brand Colors */
    --argym-beige: #F5F5DC;
    --argym-beige-light: #FAFAF2;
    --argym-beige-dark: #E8E4D0;
    --argym-cafe: #8B7355;
    --argym-cafe-light: #A68B6A;
    --argym-cafe-dark: #6B5A45;
    --argym-white: #FFFFFF;

    /* Neutrals */
    --argym-text: #3D3D3D;
    --argym-text-muted: #7A7A7A;
    --argym-border: #E8E4D9;
    --argym-border-light: #E5E5E5;
    --argym-bg: #FAF8F5;

    /* Status Colors */
    --argym-success: #10B981;
    --argym-success-light: #D1FAE5;
    --argym-warning: #F59E0B;
    --argym-warning-light: #FEF3C7;
    --argym-danger: #EF4444;
    --argym-danger-light: #FEE2E2;
    --argym-info: #3B82F6;
    --argym-info-light: #DBEAFE;

    /* Typography */
    --argym-font-primary: 'DM Sans', sans-serif;
    --argym-font-display: 'Playfair Display', serif;

    /* Effects */
    --argym-radius-sm: 8px;
    --argym-radius-md: 16px;
    --argym-radius-lg: 24px;
    --argym-radius-full: 50px;
    --argym-shadow: 0 4px 20px rgba(139, 115, 85, 0.1);
    --argym-shadow-hover: 0 8px 30px rgba(139, 115, 85, 0.15);
    --argym-transition: 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --argym-beige: #3D3630;
    --argym-beige-light: #2A2520;
    --argym-beige-dark: #4A433C;
    --argym-cafe: #C4A77D;
    --argym-cafe-light: #D4BC96;
    --argym-cafe-dark: #A68B6A;
    --argym-white: #1E1B18;
    --argym-text: #F5F5F0;
    --argym-text-muted: #A0998F;
    --argym-border: #4A433C;
    --argym-border-light: #3D3630;
    --argym-bg: #151311;
    --argym-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --argym-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* ========== RESET PROTECTION ==========
   External CSS resets (* { margin: 0; padding: 0; }) can strip
   Bootstrap defaults. Restore them inside the admin container. */
.argym-admin-container *,
.argym-admin-container *::before,
.argym-admin-container *::after {
    box-sizing: border-box;
}

.argym-admin-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--argym-bg);
    font-family: var(--argym-font-primary);
    color: var(--argym-text);
    line-height: 1.5;
}

.argym-admin-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--argym-white);
    border-right: 1px solid var(--argym-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--argym-transition);
    overflow-y: auto;
}

.argym-admin-sidebar.collapsed {
    transform: translateX(-100%);
}

.argym-admin-main {
    flex: 1;
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
    transition: margin-left var(--argym-transition), width var(--argym-transition);
}

.argym-admin-sidebar.collapsed + .argym-admin-main {
    margin-left: 0;
    width: 100%;
}

/* ========== SIDEBAR COMPONENTS ========== */
.argym-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--argym-border);
}

.argym-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.argym-logo-wrapper img {
    height: 40px;
    width: auto;
}

.argym-admin-tag {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--argym-cafe);
    background: var(--argym-beige);
    padding: 0.25rem 0.5rem;
    border-radius: var(--argym-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Card */
.argym-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--argym-border);
}

.argym-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--argym-cafe);
    color: var(--argym-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    position: relative;
}

.argym-user-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--argym-success);
    border: 2px solid var(--argym-white);
    border-radius: 50%;
}

.argym-user-info {
    display: flex;
    flex-direction: column;
}

.argym-user-name {
    font-weight: 600;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-user-role {
    font-size: 0.75rem;
    color: var(--argym-text-muted);
}

/* Sidebar Navigation */
.argym-sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.argym-nav-group {
    margin-bottom: 0.5rem;
}

.argym-nav-group-label {
    display: block;
    padding: 0.5rem 1.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--argym-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.argym-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--argym-text-muted);
    text-decoration: none;
    transition: all var(--argym-transition);
    cursor: pointer;
}

.argym-nav-link:hover {
    background: var(--argym-beige-light);
    color: var(--argym-cafe);
}

.argym-nav-link.active {
    background: var(--argym-beige);
    color: var(--argym-cafe);
    font-weight: 600;
}

.argym-nav-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--argym-beige-light);
    border-radius: var(--argym-radius-sm);
    transition: background var(--argym-transition);
}

.argym-nav-link:hover .argym-nav-icon,
.argym-nav-link.active .argym-nav-icon {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-nav-link .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--argym-radius-full);
    background: var(--argym-beige);
    color: var(--argym-cafe);
}

.argym-nav-link .badge.primary {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

/* Sidebar Footer */
.argym-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--argym-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.argym-store-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--argym-cafe);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.argym-store-link:hover {
    color: var(--argym-cafe-dark);
}

.argym-logout-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--argym-beige-light);
    color: var(--argym-text-muted);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    transition: all var(--argym-transition);
}

.argym-logout-btn:hover {
    background: var(--argym-danger-light);
    color: var(--argym-danger);
}

/* ========== TOPBAR ========== */
.argym-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    width: 100%;
    background: var(--argym-white);
    border-bottom: 1px solid var(--argym-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.argym-sidebar-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--argym-beige-light);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    color: var(--argym-text);
    font-size: 1.25rem;
}

.argym-topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.argym-topbar-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--argym-text-muted);
}

.argym-topbar-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-full);
    background: var(--argym-beige-light);
    font-family: var(--argym-font-primary);
    font-size: 0.9rem;
    color: var(--argym-text);
}

.argym-topbar-search input:focus {
    outline: none;
    border-color: var(--argym-cafe);
    background: var(--argym-white);
}

.argym-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.argym-topbar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    color: var(--argym-text-muted);
    position: relative;
    transition: all var(--argym-transition);
}

.argym-topbar-btn:hover {
    background: var(--argym-beige-light);
    color: var(--argym-cafe);
}

.argym-topbar-btn .dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--argym-danger);
    border-radius: 50%;
}

/* ========== PAGE CONTENT ========== */
.argym-page-content {
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    text-align: left;
}

/* Restore Bootstrap defaults that external resets may strip */
.argym-admin-main h1, .argym-admin-main h2, .argym-admin-main h3,
.argym-admin-main h4, .argym-admin-main h5, .argym-admin-main h6 {
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.argym-admin-main p {
    margin-bottom: 1rem;
}

/* Ensure content inside admin area stretches properly */
.argym-page-content > * {
    max-width: 100%;
}

/* Tables inside admin should be full width and left-aligned */
.argym-page-content table,
.argym-page-content .table {
    width: 100%;
    text-align: left;
}

.argym-page-content .table th,
.argym-page-content .table td {
    text-align: left;
}

/* BlazorBootstrap Grid - ensure proper fit */
.argym-page-content .bb-grid {
    width: 100%;
}

.argym-page-content .bb-grid .table-responsive {
    width: 100%;
}

/* Restore Bootstrap button margins stripped by * reset */
.argym-admin-main .btn {
    margin: 0;
}

.argym-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.argym-page-header h1 {
    font-family: var(--argym-font-display);
    font-size: 1.75rem;
    color: var(--argym-text);
    margin: 0;
}

.argym-page-header p {
    color: var(--argym-text-muted);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

.argym-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--argym-cafe);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.argym-back-link:hover {
    color: var(--argym-cafe-dark);
}

.argym-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ========== DASHBOARD CARD ========== */
.argym-card {
    background: var(--argym-white);
    border-radius: var(--argym-radius-md);
    box-shadow: var(--argym-shadow);
    overflow: visible;
}

.argym-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-md) var(--argym-radius-md) 0 0;
}

.argym-card-header h3 {
    font-family: var(--argym-font-display);
    font-size: 1.1rem;
    color: var(--argym-text);
    margin: 0;
}

.argym-card-body {
    padding: 1.5rem;
}

.argym-card-body.no-padding {
    padding: 0;
}

.argym-view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--argym-cafe);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.argym-view-all:hover {
    color: var(--argym-cafe-dark);
}

/* ========== STAT CARD ========== */
.argym-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.argym-stat-card {
    background: var(--argym-white);
    border-radius: var(--argym-radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    box-shadow: var(--argym-shadow);
    position: relative;
    overflow: hidden;
}

.argym-stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--argym-radius-sm);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.argym-stat-icon.primary {
    background: rgba(139, 115, 85, 0.1);
    color: var(--argym-cafe);
}

.argym-stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--argym-success);
}

.argym-stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--argym-warning);
}

.argym-stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--argym-danger);
}

.argym-stat-icon.info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--argym-info);
}

.argym-stat-details {
    flex: 1;
}

.argym-stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--argym-text-muted);
    margin-bottom: 0.25rem;
}

.argym-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--argym-text);
    line-height: 1.2;
}

.argym-stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.argym-stat-trend.up {
    color: var(--argym-success);
}

.argym-stat-trend.down {
    color: var(--argym-danger);
}

.argym-stat-trend.warning {
    color: var(--argym-warning);
}

.argym-stat-sparkline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 50px;
    opacity: 0.8;
}

/* ========== BUTTONS ========== */
.argym-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--argym-font-primary);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--argym-radius-full);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--argym-transition);
}

.argym-btn:hover {
    transform: translateY(-2px);
}

.argym-btn:active {
    transform: translateY(0);
}

.argym-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.argym-btn-primary:hover {
    background: var(--argym-cafe-dark);
    border-color: var(--argym-cafe-dark);
}

.argym-btn-secondary {
    background: var(--argym-beige);
    border-color: var(--argym-beige);
    color: var(--argym-cafe);
}

.argym-btn-secondary:hover {
    background: var(--argym-beige-dark);
    border-color: var(--argym-beige-dark);
}

.argym-btn-outline {
    background: transparent;
    border-color: var(--argym-border);
    color: var(--argym-text);
}

.argym-btn-outline:hover {
    border-color: var(--argym-cafe);
    color: var(--argym-cafe);
}

.argym-btn-success {
    background: var(--argym-success);
    border-color: var(--argym-success);
    color: white;
}

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

.argym-btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.argym-btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.argym-btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--argym-radius-sm);
}

/* ========== CUSTOM SELECT ========== */
.argym-select {
    position: relative;
    min-width: 180px;
}

.argym-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--argym-white);
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    transition: all var(--argym-transition);
    font-family: var(--argym-font-primary);
    color: var(--argym-text);
}

.argym-select-trigger:hover {
    border-color: var(--argym-cafe);
}

.argym-select.open .argym-select-trigger {
    border-color: var(--argym-cafe);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.argym-select-trigger .placeholder {
    color: var(--argym-text-muted);
}

.argym-select-trigger i {
    transition: transform var(--argym-transition);
    color: var(--argym-text-muted);
}

.argym-select.open .argym-select-trigger i {
    transform: rotate(180deg);
}

.argym-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--argym-white);
    border: 1px solid var(--argym-cafe);
    border-top: none;
    border-radius: 0 0 var(--argym-radius-sm) var(--argym-radius-sm);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--argym-shadow);
}

.argym-select.open .argym-select-options {
    display: block;
}

.argym-select-option {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--argym-transition);
    color: var(--argym-text);
}

.argym-select-option:hover {
    background: var(--argym-beige-light);
}

.argym-select-option.selected {
    background: var(--argym-beige);
    color: var(--argym-cafe);
    font-weight: 500;
}

/* ========== TAGS INPUT ========== */
.argym-tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    background: var(--argym-white);
    min-height: 44px;
    align-items: center;
}

.argym-tags-input:focus-within {
    border-color: var(--argym-cafe);
}

.argym-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--argym-beige);
    color: var(--argym-cafe);
    border-radius: var(--argym-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
}

.argym-tag button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: transparent;
    color: var(--argym-cafe);
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    border-radius: 50%;
}

.argym-tag button:hover {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-tags-input input {
    flex: 1;
    min-width: 100px;
    border: none;
    outline: none;
    padding: 0.25rem;
    font-family: var(--argym-font-primary);
    font-size: 0.9rem;
    background: transparent;
    color: var(--argym-text);
}

/* ========== TAG CHIPS & CONTAINERS ========== */
.argym-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.argym-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--argym-beige);
    color: var(--argym-cafe);
    border-radius: var(--argym-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--argym-font-primary);
    transition: all var(--argym-transition);
    user-select: none;
}

.argym-tag-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: transparent;
    color: var(--argym-cafe);
    cursor: pointer;
    padding: 0;
    margin-left: 0.15rem;
    border-radius: 50%;
    font-size: 0.9rem;
    line-height: 1;
    transition: all var(--argym-transition);
}

.argym-tag-chip button:hover {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-tag-chip.active {
    background: var(--argym-cafe);
    color: var(--argym-white);
    opacity: 1 !important;
}

/* ========== UPLOAD ZONE ========== */
.argym-upload-zone {
    border: 2px dashed var(--argym-border);
    border-radius: var(--argym-radius-md);
    padding: 2rem;
    text-align: center;
    transition: all var(--argym-transition);
    cursor: pointer;
}

.argym-upload-zone:hover,
.argym-upload-zone.dragover {
    border-color: var(--argym-cafe);
    background: var(--argym-beige-light);
}

.argym-upload-zone i {
    font-size: 2.5rem;
    color: var(--argym-cafe);
    margin-bottom: 1rem;
}

.argym-upload-zone h4 {
    font-family: var(--argym-font-display);
    color: var(--argym-text);
    margin: 0 0 0.5rem 0;
}

.argym-upload-zone p {
    color: var(--argym-text-muted);
    margin: 0;
}

.argym-upload-zone p span {
    color: var(--argym-cafe);
    text-decoration: underline;
    cursor: pointer;
}

.argym-upload-zone small {
    display: block;
    margin-top: 0.5rem;
    color: var(--argym-text-muted);
    font-size: 0.8rem;
}

/* Image Previews — grid where the first ("Principal") card spans 2x2
   so it reads as the hero image; remaining slots fill the rest of the
   row evenly via auto-fill. */
.argym-image-previews {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.argym-image-preview,
.argym-add-image {
    aspect-ratio: 1;
    border-radius: var(--argym-radius-sm);
    overflow: hidden;
    position: relative;
    background: var(--argym-beige-light);
    width: 100%;
    height: auto;
    min-height: 0;
    min-width: 0;
}

.argym-image-preview {
    border: 1px solid var(--argym-border);
}

.argym-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.argym-image-preview .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--argym-text-muted);
    font-size: 1.75rem;
}

.argym-image-preview.main {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1;
    border: 2px solid var(--argym-cafe);
    box-shadow: 0 4px 16px rgba(139, 115, 85, 0.12);
}

.argym-image-preview.main .placeholder {
    font-size: 3rem;
}

.argym-image-preview .label {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: var(--argym-cafe);
    color: var(--argym-white);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--argym-radius-full, 999px);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.argym-image-preview .remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;             /* always visible on touch + desktop */
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: background 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

.argym-image-preview .remove-btn:hover,
.argym-image-preview .remove-btn:focus-visible {
    background: var(--argym-danger);
    transform: scale(1.05);
}

/* Badge that marks an image as already persisted (vs. a pending upload).
   Helps the admin distinguish "this is in the DB; removing it deletes it"
   from "this is staged; removing it just discards the upload." */
.argym-image-preview .badge-existing {
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: var(--argym-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 1;
}

.argym-add-image {
    border: 2px dashed var(--argym-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--argym-text-muted);
    font-size: 1.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    text-decoration: none;
}

.argym-add-image:hover,
.argym-add-image:focus-visible {
    border-color: var(--argym-cafe);
    color: var(--argym-cafe);
    background: var(--argym-beige-light);
}

/* Tablet: keep main 2x2, total 4 cols */
@media (max-width: 992px) {
    .argym-image-previews {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Phone: 3 cols total — main spans 2x2 leaves a 1-col side strip
   for two thumbs. Avoids the previous "first card gets too small"
   issue where wrapping left odd, narrow leftovers. */
@media (max-width: 576px) {
    .argym-image-previews {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }
    .argym-image-preview .label {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
}

/* Very narrow (≤360px): drop the spanning so nothing gets cramped */
@media (max-width: 360px) {
    .argym-image-previews {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .argym-image-preview.main {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* ========== STATUS BADGES ========== */
.argym-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--argym-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.argym-status-badge.pending {
    background: var(--argym-warning-light);
    color: var(--argym-warning);
}

.argym-status-badge.processing {
    background: var(--argym-info-light);
    color: var(--argym-info);
}

.argym-status-badge.shipped {
    background: rgba(139, 115, 85, 0.1);
    color: var(--argym-cafe);
}

.argym-status-badge.completed,
.argym-status-badge.delivered {
    background: var(--argym-success-light);
    color: var(--argym-success);
}

.argym-status-badge.cancelled {
    background: var(--argym-danger-light);
    color: var(--argym-danger);
}

/* Segment Badges */
.argym-segment-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--argym-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.argym-segment-badge.vip {
    background: var(--argym-warning-light);
    color: var(--argym-warning);
}

.argym-segment-badge.premium {
    background: rgba(139, 115, 85, 0.1);
    color: var(--argym-cafe);
}

.argym-segment-badge.regular {
    background: var(--argym-beige);
    color: var(--argym-text-muted);
}

.argym-segment-badge.new {
    background: var(--argym-info-light);
    color: var(--argym-info);
}

/* ========== CUSTOMER AVATAR ========== */
.argym-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    flex-shrink: 0;
}

.argym-avatar.vip::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--argym-warning);
    border: 2px solid var(--argym-white);
    border-radius: 50%;
}

.argym-avatar.new::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background: var(--argym-info);
    border: 2px solid var(--argym-white);
    border-radius: 50%;
}

/* ========== DATA TABLE ========== */
.argym-data-table {
    width: 100%;
    border-collapse: collapse;
}

.argym-data-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--argym-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--argym-border);
    background: var(--argym-beige-light);
}

.argym-data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--argym-border);
    color: var(--argym-text);
}

.argym-data-table tbody tr {
    transition: background var(--argym-transition);
}

.argym-data-table tbody tr:hover {
    background: var(--argym-beige-light);
}

.argym-data-table .customer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.argym-data-table .customer-info {
    display: flex;
    flex-direction: column;
}

.argym-data-table .customer-name {
    font-weight: 600;
    color: var(--argym-text);
}

.argym-data-table .customer-email {
    font-size: 0.8rem;
    color: var(--argym-text-muted);
}

.argym-data-table .actions {
    display: flex;
    gap: 0.5rem;
}

.argym-action-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--argym-beige-light);
    color: var(--argym-text-muted);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    transition: all var(--argym-transition);
}

.argym-action-btn:hover {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

/* ========== PAGINATION ========== */
.argym-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.argym-pagination-info {
    font-size: 0.85rem;
    color: var(--argym-text-muted);
}

.argym-pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.argym-page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--argym-border);
    background: var(--argym-white);
    color: var(--argym-text);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--argym-transition);
    padding: 0 0.5rem;
}

.argym-page-btn:hover:not(:disabled) {
    border-color: var(--argym-cafe);
    color: var(--argym-cafe);
}

.argym-page-btn.active {
    background: var(--argym-cafe);
    border-color: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== FILTER TABS ========== */
.argym-filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.argym-filter-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--argym-border);
    background: var(--argym-white);
    color: var(--argym-text-muted);
    border-radius: var(--argym-radius-full);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--argym-font-primary);
    transition: all var(--argym-transition);
}

.argym-filter-tab:hover {
    border-color: var(--argym-cafe);
    color: var(--argym-cafe);
}

.argym-filter-tab.active {
    background: var(--argym-cafe);
    border-color: var(--argym-cafe);
    color: var(--argym-white);
}

/* ========== QUICK ACTIONS ========== */
.argym-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.argym-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1rem;
    background: var(--argym-beige-light);
    border: none;
    border-radius: var(--argym-radius-md);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--argym-transition);
    color: var(--argym-text);
}

.argym-quick-action:hover {
    background: var(--argym-beige);
    transform: translateY(-2px);
}

.argym-quick-action .action-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--argym-white);
    border-radius: var(--argym-radius-sm);
    font-size: 1.25rem;
    color: var(--argym-cafe);
}

.argym-quick-action span {
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
}

/* ========== ORDER ROW ========== */
.argym-order-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--argym-border);
}

.argym-order-row:last-child {
    border-bottom: none;
}

.argym-order-customer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.argym-order-amount {
    font-weight: 600;
    color: var(--argym-text);
    min-width: 80px;
    text-align: right;
}

/* ========== TOP PRODUCT ITEM ========== */
.argym-top-product {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--argym-border);
}

.argym-top-product:last-child {
    border-bottom: none;
}

.argym-top-product .rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--argym-beige);
    color: var(--argym-cafe);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.argym-top-product .product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--argym-radius-sm);
    background: var(--argym-beige-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--argym-text-muted);
    overflow: hidden;
}

.argym-top-product .product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.argym-top-product .product-info {
    flex: 1;
}

.argym-top-product .product-name {
    display: block;
    font-weight: 600;
    color: var(--argym-text);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.argym-top-product .product-category {
    display: block;
    font-size: 0.8rem;
    color: var(--argym-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.argym-top-product .product-metrics {
    text-align: right;
    min-width: 60px;
    flex-shrink: 0;
}

.argym-top-product .metric-value {
    display: block;
    font-weight: 600;
    color: var(--argym-text);
    white-space: nowrap;
}

.argym-top-product .metric-label {
    font-size: 0.75rem;
    color: var(--argym-text-muted);
    white-space: nowrap;
}

.argym-top-product .product-progress {
    width: 80px;
    height: 6px;
    background: var(--argym-beige);
    border-radius: var(--argym-radius-full);
    overflow: hidden;
}

.argym-top-product .progress-bar {
    height: 100%;
    background: var(--argym-cafe);
    border-radius: var(--argym-radius-full);
}

/* ========== STOCK ALERT ROW ========== */
.argym-alert-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--argym-radius-sm);
    margin-bottom: 0.5rem;
}

.argym-alert-row.critical {
    background: var(--argym-danger-light);
}

.argym-alert-row.warning {
    background: var(--argym-warning-light);
}

.argym-alert-row .alert-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--argym-radius-sm);
    background: var(--argym-white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--argym-text-muted);
}

.argym-alert-row .alert-info {
    flex: 1;
}

.argym-alert-row .alert-name {
    display: block;
    font-weight: 500;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-alert-row .alert-sku {
    font-size: 0.75rem;
    color: var(--argym-text-muted);
}

.argym-alert-row .alert-stock {
    text-align: right;
}

.argym-alert-row .stock-num {
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
}

.argym-alert-row.critical .stock-num {
    color: var(--argym-danger);
}

.argym-alert-row.warning .stock-num {
    color: var(--argym-warning);
}

.argym-alert-row .stock-label {
    font-size: 0.7rem;
    color: var(--argym-text-muted);
}

.argym-restock-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--argym-white);
    color: var(--argym-cafe);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
}

/* ========== FORM ELEMENTS ========== */
.argym-form-group {
    margin-bottom: 1rem;
}

.argym-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-form-input,
.argym-form-select,
.argym-form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    font-family: var(--argym-font-primary);
    font-size: 0.9rem;
    color: var(--argym-text);
    background: var(--argym-white);
    transition: border-color var(--argym-transition);
}

.argym-form-input:focus,
.argym-form-select:focus,
.argym-form-textarea:focus {
    outline: none;
    border-color: var(--argym-cafe);
}

.argym-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.argym-form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--argym-text-muted);
}

/* Input Group */
.argym-input-group {
    display: flex;
    align-items: stretch;
}

.argym-input-group .prefix,
.argym-input-group .suffix {
    padding: 0.75rem 1rem;
    background: var(--argym-beige-light);
    border: 1px solid var(--argym-border);
    color: var(--argym-text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.argym-input-group .prefix {
    border-right: none;
    border-radius: var(--argym-radius-sm) 0 0 var(--argym-radius-sm);
}

.argym-input-group .suffix {
    border-left: none;
    border-radius: 0 var(--argym-radius-sm) var(--argym-radius-sm) 0;
}

.argym-input-group input {
    flex: 1;
    border-radius: 0;
}

/* ========== SIZE SELECTOR ========== */
.argym-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.argym-size-option {
    position: relative;
}

.argym-size-option input {
    position: absolute;
    opacity: 0;
}

.argym-size-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--argym-transition);
    color: var(--argym-text);
}

.argym-size-option input:checked + span {
    background: var(--argym-cafe);
    border-color: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-size-option:hover span {
    border-color: var(--argym-cafe);
}

/* ========== CHECKBOX & RADIO ========== */
.argym-checkbox,
.argym-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.argym-checkbox input,
.argym-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--argym-cafe);
}

/* ========== DONUT CHART ========== */
.argym-donut-chart {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.argym-donut-container {
    position: relative;
    width: 150px;
    height: 150px;
}

.argym-donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.argym-donut-center .total-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--argym-text);
}

.argym-donut-center .total-label {
    font-size: 0.8rem;
    color: var(--argym-text-muted);
}

.argym-categories-list {
    flex: 1;
}

.argym-category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.argym-category-item .cat-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.argym-category-item .cat-name {
    flex: 1;
    color: var(--argym-text);
}

.argym-category-item .cat-percent {
    font-weight: 600;
    color: var(--argym-text);
    min-width: 40px;
}

.argym-category-item .cat-value {
    color: var(--argym-text-muted);
    font-size: 0.85rem;
    min-width: 70px;
    text-align: right;
}

/* ========== THEME TOGGLE ========== */
.argym-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--argym-white);
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-full);
    cursor: pointer;
}

.argym-theme-toggle-track {
    width: 44px;
    height: 24px;
    background: var(--argym-beige);
    border-radius: var(--argym-radius-full);
    position: relative;
    transition: var(--argym-transition);
}

.argym-theme-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--argym-white);
    border-radius: 50%;
    transition: var(--argym-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

[data-theme="dark"] .argym-theme-toggle-track {
    background: var(--argym-cafe);
}

[data-theme="dark"] .argym-theme-toggle-thumb {
    left: 22px;
}

/* ========== EDIT LAYOUT ========== */
.argym-edit-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
}

.argym-edit-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.argym-edit-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========== FORM ROW ========== */
.argym-form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ========== RICH EDITOR ========== */
.argym-rich-editor {
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    overflow: hidden;
}

.argym-editor-toolbar {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--argym-beige-light);
    border-bottom: 1px solid var(--argym-border);
}

.argym-editor-toolbar button {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    color: var(--argym-text-muted);
    transition: all var(--argym-transition);
}

.argym-editor-toolbar button:hover {
    background: var(--argym-white);
    color: var(--argym-cafe);
}

.argym-editor-content {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: none;
    resize: vertical;
    font-family: var(--argym-font-primary);
    font-size: 0.9rem;
    color: var(--argym-text);
    background: var(--argym-white);
}

.argym-editor-content:focus {
    outline: none;
}

/* ========== VARIANT EDITOR ========== */
.argym-variant-section {
    margin-bottom: 1.5rem;
}

.argym-variant-section:last-child {
    margin-bottom: 0;
}

.argym-variant-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.argym-variant-header label {
    font-weight: 600;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-btn-add-variant {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--argym-beige);
    color: var(--argym-cafe);
    border: none;
    border-radius: var(--argym-radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--argym-transition);
}

.argym-btn-add-variant:hover {
    background: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-variant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.argym-variant-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.argym-variant-item input {
    flex: 1;
}

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

.argym-remove-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--argym-beige-light);
    color: var(--argym-text-muted);
    border-radius: var(--argym-radius-sm);
    cursor: pointer;
    transition: all var(--argym-transition);
    flex-shrink: 0;
}

.argym-remove-btn:hover {
    background: var(--argym-danger-light);
    color: var(--argym-danger);
}

/* ========== INVENTORY TABLE ========== */
.argym-inventory-table {
    width: 100%;
    border-collapse: collapse;
}

.argym-inventory-table th {
    text-align: left;
    padding: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--argym-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--argym-border);
}

.argym-inventory-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--argym-border);
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-inventory-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    font-family: var(--argym-font-primary);
    font-size: 0.85rem;
    color: var(--argym-text);
}

.argym-inventory-table input:focus {
    outline: none;
    border-color: var(--argym-cafe);
}

.argym-inventory-total {
    padding: 1rem 0.75rem;
    text-align: right;
    font-size: 0.9rem;
    color: var(--argym-text-muted);
}

.argym-inventory-total strong {
    color: var(--argym-text);
}

/* ========== STATUS RADIO ========== */
.argym-status-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.argym-status-radio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--argym-radius-sm);
    transition: background var(--argym-transition);
}

.argym-status-radio:hover {
    background: var(--argym-beige-light);
}

.argym-status-radio input {
    width: 18px;
    height: 18px;
    accent-color: var(--argym-cafe);
}

.argym-radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--argym-text);
}

.argym-radio-label i.active {
    color: var(--argym-success);
    font-size: 0.6rem;
}

.argym-radio-label i.draft {
    color: var(--argym-warning);
    font-size: 0.6rem;
}

.argym-radio-label i.inactive {
    color: var(--argym-text-muted);
    font-size: 0.6rem;
}

/* ========== CHECKBOX LIST ========== */
.argym-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========== PRODUCT CELL ========== */
.argym-product-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.argym-product-thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--argym-radius-sm);
    background: var(--argym-beige-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--argym-text-muted);
    overflow: hidden;
    flex-shrink: 0;
}

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

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

.argym-product-name {
    font-weight: 600;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-product-variants {
    font-size: 0.75rem;
    color: var(--argym-text-muted);
}

/* ========== STOCK LEVEL ========== */
.argym-stock-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.argym-stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.argym-stock-indicator.high {
    background: var(--argym-success);
}

.argym-stock-indicator.medium {
    background: var(--argym-warning);
}

.argym-stock-indicator.low {
    background: #F97316;
}

.argym-stock-indicator.empty {
    background: var(--argym-danger);
}

/* ========== CUSTOMER CELL ========== */
.argym-customer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.argym-customer-info {
    display: flex;
    flex-direction: column;
}

.argym-customer-name {
    font-weight: 600;
    color: var(--argym-text);
    font-size: 0.9rem;
}

.argym-customer-email {
    font-size: 0.8rem;
    color: var(--argym-text-muted);
}

/* ========== ADD LINK ========== */
.argym-add-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--argym-cafe);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.75rem;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    transition: color var(--argym-transition);
}

.argym-add-link:hover {
    color: var(--argym-cafe-dark);
}

/* ========== ACTION BUTTON GROUP ========== */
.argym-action-group {
    display: flex;
    gap: 0.5rem;
}

/* ========== MODAL ========== */
.argym-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.argym-modal-backdrop.show {
    opacity: 1;
}

.argym-modal {
    background: var(--argym-white);
    border-radius: var(--argym-radius-md);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.argym-modal.show {
    transform: scale(1) translateY(0);
}

.argym-modal.sm {
    max-width: 400px;
}

.argym-modal.lg {
    max-width: 720px;
}

.argym-modal.xl {
    max-width: 960px;
}

.argym-modal.fullscreen {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    border-radius: 0;
}

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

.argym-modal-title {
    font-family: var(--argym-font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--argym-text);
    margin: 0;
}

.argym-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--argym-text-muted);
    cursor: pointer;
    border-radius: var(--argym-radius-sm);
    transition: all var(--argym-transition);
    padding: 0;
    flex-shrink: 0;
}

.argym-modal-close:hover {
    background: var(--argym-beige-light);
    color: var(--argym-text);
}

.argym-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.argym-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--argym-border);
}

/* ========== CONFIRM DIALOG ========== */
.argym-confirm-dialog .argym-modal-body {
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
}

.argym-confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.argym-confirm-icon.danger {
    background: var(--argym-danger-light);
    color: var(--argym-danger);
}

.argym-confirm-icon.warning {
    background: var(--argym-warning-light);
    color: var(--argym-warning);
}

.argym-confirm-icon.info {
    background: var(--argym-info-light);
    color: var(--argym-info);
}

.argym-confirm-message {
    font-size: 0.95rem;
    color: var(--argym-text-muted);
    line-height: 1.5;
    margin: 0;
}

.argym-confirm-dialog .argym-modal-footer {
    justify-content: center;
}

/* ========== TOAST ========== */
.argym-toast-container {
    position: fixed;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
    padding: 1rem;
}

.argym-toast-container.top-right {
    top: 0;
    right: 0;
}

.argym-toast-container.top-left {
    top: 0;
    left: 0;
}

.argym-toast-container.top-center {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.argym-toast-container.bottom-right {
    bottom: 0;
    right: 0;
}

.argym-toast-container.bottom-left {
    bottom: 0;
    left: 0;
}

.argym-toast-container.bottom-center {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.argym-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--argym-white);
    border-radius: var(--argym-radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border-left: 4px solid var(--argym-border);
    pointer-events: all;
    opacity: 0;
    transform: translateX(100%);
    transition: all var(--argym-transition);
    position: relative;
    overflow: hidden;
}

.argym-toast-container.top-left .argym-toast,
.argym-toast-container.bottom-left .argym-toast {
    transform: translateX(-100%);
}

.argym-toast-container.top-center .argym-toast,
.argym-toast-container.bottom-center .argym-toast {
    transform: translateY(-20px);
}

.argym-toast-container.bottom-right .argym-toast,
.argym-toast-container.bottom-left .argym-toast,
.argym-toast-container.bottom-center .argym-toast {
    transform: translateY(20px);
}

.argym-toast.show {
    opacity: 1;
    transform: translateX(0) translateY(0);
}

.argym-toast.success {
    border-left-color: var(--argym-success);
}

.argym-toast.warning {
    border-left-color: var(--argym-warning);
}

.argym-toast.danger {
    border-left-color: var(--argym-danger);
}

.argym-toast.info {
    border-left-color: var(--argym-info);
}

.argym-toast-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.argym-toast.success .argym-toast-icon {
    background: var(--argym-success-light);
    color: var(--argym-success);
}

.argym-toast.warning .argym-toast-icon {
    background: var(--argym-warning-light);
    color: var(--argym-warning);
}

.argym-toast.danger .argym-toast-icon {
    background: var(--argym-danger-light);
    color: var(--argym-danger);
}

.argym-toast.info .argym-toast-icon {
    background: var(--argym-info-light);
    color: var(--argym-info);
}

.argym-toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.argym-toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--argym-text);
}

.argym-toast-message {
    font-size: 0.85rem;
    color: var(--argym-text-muted);
    line-height: 1.4;
}

.argym-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--argym-text-muted);
    cursor: pointer;
    border-radius: var(--argym-radius-sm);
    padding: 0;
    flex-shrink: 0;
    transition: all var(--argym-transition);
    font-size: 0.75rem;
}

.argym-toast-close:hover {
    background: var(--argym-beige-light);
    color: var(--argym-text);
}

.argym-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--argym-beige-light);
}

.argym-toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    animation: argym-toast-countdown linear forwards;
}

.argym-toast-progress-bar.success {
    background: var(--argym-success);
}

.argym-toast-progress-bar.warning {
    background: var(--argym-warning);
}

.argym-toast-progress-bar.danger {
    background: var(--argym-danger);
}

.argym-toast-progress-bar.info {
    background: var(--argym-info);
}

@keyframes argym-toast-countdown {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* ========== TOOLTIP ========== */
.argym-tooltip-wrapper {
    position: relative;
    display: inline-flex;
}

.argym-tooltip {
    position: absolute;
    z-index: 1200;
    pointer-events: none;
    white-space: nowrap;
    animation: argym-tooltip-fade-in 0.2s ease;
}

.argym-tooltip.top {
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.argym-tooltip.bottom {
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
}

.argym-tooltip.left {
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.argym-tooltip.right {
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
}

.argym-tooltip-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--argym-radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--argym-font-primary);
    line-height: 1.4;
    max-width: 280px;
    white-space: normal;
    word-wrap: break-word;
}

.argym-tooltip.dark .argym-tooltip-inner {
    background: var(--argym-text);
    color: var(--argym-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.argym-tooltip.light .argym-tooltip-inner {
    background: var(--argym-white);
    color: var(--argym-text);
    box-shadow: var(--argym-shadow);
    border: 1px solid var(--argym-border);
}

/* Tooltip Arrow */
.argym-tooltip-arrow {
    position: absolute;
    width: 8px;
    height: 8px;
}

.argym-tooltip.top .argym-tooltip-arrow {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.argym-tooltip.bottom .argym-tooltip-arrow {
    top: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.argym-tooltip.left .argym-tooltip-arrow {
    right: -4px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.argym-tooltip.right .argym-tooltip-arrow {
    left: -4px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.argym-tooltip.dark .argym-tooltip-arrow {
    background: var(--argym-text);
}

.argym-tooltip.light .argym-tooltip-arrow {
    background: var(--argym-white);
    border: 1px solid var(--argym-border);
    border-top: none;
    border-left: none;
}

.argym-tooltip.light.top .argym-tooltip-arrow {
    border: 1px solid var(--argym-border);
    border-top: none;
    border-left: none;
}

.argym-tooltip.light.bottom .argym-tooltip-arrow {
    border: 1px solid var(--argym-border);
    border-bottom: none;
    border-right: none;
}

.argym-tooltip.light.left .argym-tooltip-arrow {
    border: 1px solid var(--argym-border);
    border-left: none;
    border-bottom: none;
}

.argym-tooltip.light.right .argym-tooltip-arrow {
    border: 1px solid var(--argym-border);
    border-right: none;
    border-top: none;
}

@keyframes argym-tooltip-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========== ICON PICKER ========== */
.argym-icon-picker {
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-sm);
    background: var(--argym-white);
    overflow: hidden;
}

.argym-icon-picker-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--argym-beige-light);
    border-bottom: 1px solid var(--argym-border);
}

.argym-icon-picker-preview i {
    color: var(--argym-cafe);
}

.argym-icon-picker-preview-name {
    font-size: 0.85rem;
    color: var(--argym-text-muted);
    font-family: var(--argym-font-primary);
}

.argym-icon-picker-tabs {
    display: flex;
    border-bottom: 1px solid var(--argym-border);
}

.argym-icon-picker-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--argym-text-muted);
    font-family: var(--argym-font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--argym-transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.argym-icon-picker-tab:hover {
    color: var(--argym-cafe);
    background: var(--argym-beige-light);
}

.argym-icon-picker-tab.active {
    color: var(--argym-cafe);
    border-bottom-color: var(--argym-cafe);
    font-weight: 600;
}

.argym-icon-picker-search {
    position: relative;
    padding: 0.75rem;
    border-bottom: 1px solid var(--argym-border);
}

.argym-icon-picker-search > i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--argym-text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.argym-icon-picker-search input {
    width: 100%;
    padding: 0.6rem 2rem 0.6rem 2.25rem;
    border: 1px solid var(--argym-border);
    border-radius: var(--argym-radius-full);
    background: var(--argym-beige-light);
    font-family: var(--argym-font-primary);
    font-size: 0.85rem;
    color: var(--argym-text);
    transition: border-color var(--argym-transition), background var(--argym-transition);
}

.argym-icon-picker-search input:focus {
    outline: none;
    border-color: var(--argym-cafe);
    background: var(--argym-white);
}

.argym-icon-picker-clear {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--argym-text-muted);
    cursor: pointer;
    border-radius: 50%;
    padding: 0;
    transition: all var(--argym-transition);
}

.argym-icon-picker-clear:hover {
    background: var(--argym-beige);
    color: var(--argym-text);
}

.argym-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    gap: 0.35rem;
    padding: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.argym-icon-picker-grid::-webkit-scrollbar {
    width: 6px;
}

.argym-icon-picker-grid::-webkit-scrollbar-track {
    background: var(--argym-beige-light);
    border-radius: 3px;
}

.argym-icon-picker-grid::-webkit-scrollbar-thumb {
    background: var(--argym-border);
    border-radius: 3px;
}

.argym-icon-picker-grid::-webkit-scrollbar-thumb:hover {
    background: var(--argym-cafe-light);
}

.argym-icon-picker-item {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: var(--argym-radius-sm);
    background: transparent;
    color: var(--argym-text);
    cursor: pointer;
    font-size: 1.15rem;
    transition: all var(--argym-transition);
    padding: 0;
}

.argym-icon-picker-item:hover {
    background: var(--argym-beige-light);
    border-color: var(--argym-border);
    color: var(--argym-cafe);
}

.argym-icon-picker-item.selected {
    background: var(--argym-cafe);
    border-color: var(--argym-cafe);
    color: var(--argym-white);
}

.argym-icon-picker-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: var(--argym-text-muted);
    font-size: 0.85rem;
}

.argym-icon-picker-empty i {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .argym-admin-sidebar {
        transform: translateX(-100%);
    }

    .argym-admin-sidebar.open {
        transform: translateX(0);
    }

    .argym-admin-main {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .argym-page-content {
        padding: 1rem;
    }

    .argym-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

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

    .argym-edit-layout {
        grid-template-columns: 1fr;
    }

    .argym-form-row {
        grid-template-columns: 1fr;
    }

    /* table column sizing is intact — scroll lives on the wrapper. */

    .argym-toast-container {
        max-width: 100%;
        padding: 0.75rem;
    }

    .argym-toast-container.top-center,
    .argym-toast-container.bottom-center {
        left: 0;
        transform: none;
        max-width: 100%;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE SAFETY NET
   Catches the long tail of overflow without per-component edits.
   Scoped to .argym-* containers so it doesn't leak outside the lib.
   Target baseline: iPhone SE (375×667).
   ──────────────────────────────────────────────────────────────────── */

/* Media never overflows their container */
.argym-admin-container img,
.argym-admin-container video,
.argym-admin-container canvas,
.argym-admin-container svg {
    max-width: 100%;
    height: auto;
}

/* Long unbreakable strings (URLs, product codes, emails) wrap instead of pushing.
   NOTE: do NOT apply this to .argym-data-table td/th — narrow table columns
   would break each word into vertical character-by-character lines. Tables
   handle overflow via the .argym-data-table-wrapper { overflow-x: auto }
   pattern below. */
.argym-card-title,
.argym-stat-value,
.argym-stat-label,
.argym-page-title,
.argym-page-subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Tables: cells stay on one line by default; the wrapper scrolls horizontally
   when the row is wider than the viewport. Specific cells that contain free
   prose (descriptions, addresses) can opt back in with .argym-cell-wrap. */
.argym-data-table th,
.argym-data-table td {
    white-space: nowrap;
}
.argym-data-table td.argym-cell-wrap,
.argym-data-table th.argym-cell-wrap {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    min-width: 180px;
}

/* Grids using fixed-pixel minmax collapse cleanly under 320px */
.argym-stats-grid,
.argym-charts-row,
.argym-catalog-overview,
.argym-quick-actions {
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

/* PageHeader actions area wraps below 768px instead of squishing */
@media (max-width: 768px) {
    .argym-page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .argym-page-header-actions > * {
        flex: 1 1 auto;
    }
}

/* ────────── Tier 2: targeted layout fixes ────────── */

/* AdminTopbar: search shrinks aggressively, then collapses below ~480px */
@media (max-width: 768px) {
    .argym-topbar {
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }
    .argym-topbar-search {
        max-width: none;
        flex: 1 1 100%;
        order: 3;             /* drop search to its own row */
    }
    .argym-topbar-actions {
        margin-left: auto;
    }
}

/* StatCard: trend label compresses to keep the value readable */
@media (max-width: 480px) {
    .argym-stat-card {
        padding: 0.875rem;
    }
    .argym-stat-card .argym-stat-trend {
        font-size: 0.7rem;
    }
    .argym-stat-value {
        font-size: 1.4rem;
    }
}

/* Charts row stacks below 991px (was already 1fr at 768px — earlier breakpoint) */
@media (max-width: 991px) {
    .argym-charts-row {
        grid-template-columns: 1fr;
    }
}

/* DataTable horizontal scroll at any width when content overflows.
   The scroll lives on the WRAPPER, not the <table> itself: a table can't
   be a scroll container without losing column-sizing semantics, so the
   wrapper is the right place. The table keeps its natural width and the
   wrapper exposes a horizontal scrollbar on narrow viewports. */
.argym-data-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.argym-data-table {
    width: 100%;
    min-width: 560px;          /* trips the wrapper's overflow on phones */
}

/* Touch-target floor on iOS Safari — buttons and links inside admin
   should be at least 44×44 to avoid the cursor-tap-miss UX problem */
@media (hover: none) and (pointer: coarse) {
    .argym-admin-container .argym-button,
    .argym-admin-container .btn,
    .argym-admin-container .argym-action-button,
    .argym-admin-container button.argym-topbar-btn {
        min-height: 44px;
    }
}

/* Modal max-width sanity below the iPhone SE */
@media (max-width: 480px) {
    .argym-modal-dialog,
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
}

/* ========== TOOLTIPS ========== */
[data-tooltip] {
    position: relative;
}
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--argym-cafe-dark, #3a2a1c);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: argym-tooltip-in 0.15s ease forwards;
    animation-delay: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    line-height: 1.3;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}
[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--argym-cafe-dark, #3a2a1c);
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: argym-tooltip-in 0.15s ease forwards;
    animation-delay: 0.2s;
}
@keyframes argym-tooltip-in {
    to { opacity: 1; }
}

/* ========== LOADER ========== */
.argym-loader.block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 12px;
}
.argym-loader.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.argym-loader-dots {
    display: flex;
    gap: 6px;
}
.argym-loader-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--argym-cafe, #4A3728);
    opacity: 0.3;
    animation: argym-dot-pulse 1.2s ease-in-out infinite;
}
.argym-loader.inline .argym-loader-dots span {
    width: 6px;
    height: 6px;
}
.argym-loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.argym-loader-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes argym-dot-pulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
    40% { opacity: 1; transform: scale(1.3); }
}
.argym-loader-text {
    margin: 0;
    font-size: 0.85rem;
    color: var(--argym-text-muted, #8a7a6d);
}
[data-theme="dark"] .argym-loader-dots span {
    background: var(--argym-cafe, #C4A77D);
}

/* ========== COLOR SWATCH ========== */
.argym-color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    vertical-align: middle;
    flex-shrink: 0;
}

/* ========== DETAIL TAG ========== */
.argym-detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--argym-beige-light, #faf7f2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--argym-cafe, #4A3728);
}
.argym-detail-tag i { font-size: 0.75rem; opacity: 0.6; }
.argym-detail-tag.discount {
    background: rgba(196, 112, 75, 0.12);
    color: var(--argym-terracota, #C4704B);
}

/* ========== COMING SOON CARD ========== */
.argym-coming-soon {
    text-align: center;
    padding: 3.5rem 2rem;
    background: var(--argym-blanco, #fff);
    border-radius: var(--argym-radius-lg, 16px);
}
.argym-coming-soon-icon {
    width: 80px;
    height: 80px;
    background: var(--argym-crema, #E8DFD0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--argym-cafe, #4A3728);
}
.argym-coming-soon h2 {
    font-family: var(--argym-font-display, 'Playfair Display', serif);
    color: var(--argym-cafe-dark, #3a2a1c);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}
.argym-coming-soon > p {
    color: var(--argym-text-muted, #8a7a6d);
    max-width: 480px;
    margin: 0 auto 2rem;
    font-size: 0.9rem;
    line-height: 1.6;
}
.argym-coming-soon-features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.argym-coming-soon-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--argym-cafe, #4A3728);
    font-weight: 500;
}
.argym-coming-soon-feature i {
    font-size: 1.1rem;
    color: var(--argym-verde-salvia, #7A8B6F);
}

/* ========== DELIVERY OPTION ========== */
.argym-delivery-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.argym-delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 2px solid var(--argym-crema, #E8DFD0);
    border-radius: var(--argym-radius-lg, 16px);
    cursor: pointer;
    transition: all 0.2s;
}
.argym-delivery-option:hover:not(.disabled) {
    border-color: var(--argym-cafe-light, #7a6a5a);
}
.argym-delivery-option.selected {
    border-color: var(--argym-cafe, #4A3728);
    background: rgba(74, 55, 40, 0.03);
}
.argym-delivery-option.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: var(--argym-beige-light, #faf7f2);
}
.argym-delivery-radio {
    padding-top: 2px;
    flex-shrink: 0;
}
.argym-radio-dot {
    width: 20px;
    height: 20px;
    border: 2px solid var(--argym-crema-dark, #c4b8a8);
    border-radius: 50%;
    display: block;
    position: relative;
    transition: all 0.2s;
}
.argym-radio-dot.active { border-color: var(--argym-cafe, #4A3728); }
.argym-radio-dot.active::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: var(--argym-cafe, #4A3728);
    border-radius: 50%;
}
.argym-delivery-icon {
    width: 44px;
    height: 44px;
    background: var(--argym-crema, #E8DFD0);
    border-radius: var(--argym-radius-md, 10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--argym-cafe, #4A3728);
    flex-shrink: 0;
}
.argym-delivery-option.selected .argym-delivery-icon {
    background: var(--argym-cafe, #4A3728);
    color: white;
}
.argym-delivery-info { flex: 1; }
.argym-delivery-info h3 { font-size: 1rem; font-weight: 600; color: var(--argym-cafe-dark, #3a2a1c); margin: 0 0 4px; }
.argym-delivery-info p { font-size: 0.85rem; color: var(--argym-text-muted, #8a7a6d); margin: 0 0 10px; }
.argym-delivery-details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--argym-cafe-light, #7a6a5a);
}
.argym-delivery-details span { display: flex; align-items: center; gap: 4px; }
.argym-delivery-coming-soon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--argym-crema, #E8DFD0);
    border-radius: var(--argym-radius-md, 10px);
    font-size: 0.8rem;
    color: var(--argym-cafe, #4A3728);
    font-weight: 500;
}
.argym-delivery-price { flex-shrink: 0; text-align: right; }
.argym-free-badge {
    background: var(--argym-verde-salvia, #7A8B6F);
    color: white;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
/* ========== PRODUCT RELEASE ========== */
.product-card-surprise .product-image {
    position: relative;
}
.product-surprise-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--argym-cafe, #4A3728) 0%, var(--argym-cafe-dark, #3a2a1c) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    font-weight: 600;
    z-index: 2;
    border-radius: inherit;
}
.product-surprise-overlay i {
    font-size: 2.5rem;
    opacity: 0.6;
}
.product-surprise-overlay span {
    font-size: 0.9rem;
}
.product-countdown {
    font-family: monospace;
    font-size: 1.1rem !important;
    background: rgba(255,255,255,0.15);
    padding: 6px 16px;
    border-radius: 999px;
    letter-spacing: 1px;
}
.release-badge {
    background: var(--argym-cafe, #4A3728) !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    z-index: 3;
}

.argym-coming-soon-badge {
    background: var(--argym-crema, #E8DFD0);
    color: var(--argym-cafe, #4A3728);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────
   FLEX-SHRINK FIX FOR DASHBOARD WIDGETS
   The default `min-width: auto` on flex items refuses to shrink below
   their intrinsic content width. When a "Top Producto" row has a long
   product name + a fixed-width metrics column + an 80px progress bar,
   the row can exceed iPhone-SE (375px). Resetting min-width to 0 lets
   each child shrink and the long text wraps via overflow-wrap.
   ──────────────────────────────────────────────────────────────────── */

.argym-top-product,
.argym-alert-row,
.argym-catalog-item {
    min-width: 0;
}

.argym-top-product > *,
.argym-alert-row > *,
.argym-catalog-item > * {
    min-width: 0;
}

.argym-top-product .rank,
.argym-top-product .product-thumb,
.argym-top-product .product-progress {
    flex-shrink: 0;
}

.argym-top-product .product-info,
.argym-alert-row .alert-info,
.argym-catalog-item .argym-catalog-data,
.argym-catalog-item .argym-catalog-details {
    flex: 1 1 0;
    min-width: 0;
}

.argym-alert-row .product-name,
.argym-catalog-item .argym-catalog-label,
.argym-catalog-item .argym-catalog-value {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Cards never push wider than their parent */
.argym-card,
.argym-stat-card,
.argym-chart-card {
    max-width: 100%;
    min-width: 0;
}

/* ────────── Compress dashboard widgets at iPhone-SE width ────────── */
@media (max-width: 480px) {
    .argym-top-product {
        gap: 0.5rem;
        padding: 0.5rem 0;
    }
    .argym-top-product .rank {
        width: 20px;
        height: 20px;
        font-size: 0.7rem;
    }
    .argym-top-product .product-thumb {
        width: 36px;
        height: 36px;
    }
    .argym-top-product .product-metrics {
        min-width: 0;
        text-align: right;
    }
    .argym-top-product .product-progress {
        display: none;             /* decorative; drop on narrow viewports */
    }

    .argym-alert-row {
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .argym-catalog-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .argym-catalog-item .argym-catalog-icon {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    .argym-catalog-item .argym-catalog-details {
        flex-basis: 100%;          /* details drop below on narrow */
        font-size: 0.75rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   ACTION GROUPS WRAP ON NARROW VIEWPORTS
   The icon-only ActionButtonGroup and any other inline button row
   should wrap cleanly instead of pushing the parent wider.
   Inside data tables the wrapper already provides horizontal scroll,
   so keep the icon row on a single line there.
   ──────────────────────────────────────────────────────────────────── */
.argym-action-group,
.argym-page-header-actions {
    flex-wrap: wrap;
}

.argym-data-table .argym-action-group {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.argym-data-table .argym-action-btn {
    flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────────
   VISUALLY HIDDEN FILE INPUT
   `display: none` makes iOS Safari refuse to open the file picker even
   when triggered via <label for>. This pattern keeps the input in the
   DOM, focusable, and reachable by labels — but invisible.
   ──────────────────────────────────────────────────────────────────── */
.argym-upload-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Labels acting as buttons need `display: block` to take the upload zone size */
label.argym-upload-zone {
    display: block;
}

/* Pointer affordance when the add-image element is a label, not a button */
label.argym-add-image {
    cursor: pointer;
}

/* ──────────────────────────────────────────────────────────────────────
   FORM INPUT MOBILE SAFETY
   - Inputs always carry their own colour pair (no inheriting white text
     from a darker wrapper, the "input shows white" symptom)
   - 16px font on phones to defeat iOS Safari's zoom-on-focus
   - Native <select> never overflows a narrow form column
   ──────────────────────────────────────────────────────────────────── */
.argym-form-input,
.argym-form-select,
.argym-form-textarea,
.argym-tags-input input,
.argym-input-group input,
.argym-icon-picker-search input,
.argym-topbar-search input {
    color: var(--argym-text);
    background-color: var(--argym-white);
    -webkit-text-fill-color: var(--argym-text);
    max-width: 100%;
    box-sizing: border-box;
}

.argym-form-input::placeholder,
.argym-form-textarea::placeholder,
.argym-tags-input input::placeholder {
    color: var(--argym-text-muted);
    opacity: 1;
}

@media (max-width: 768px) {
    .argym-form-input,
    .argym-form-select,
    .argym-form-textarea,
    .argym-tags-input input,
    .argym-input-group input,
    .argym-icon-picker-search input {
        font-size: 16px;
    }

    /* Input group: keep prefix / input / suffix on one row so short
       symbols like "$" or "%" sit beside the input — never stacked. */
    .argym-input-group {
        flex-wrap: nowrap;
        width: 100%;
    }
    .argym-input-group .prefix,
    .argym-input-group .suffix {
        flex: 0 0 auto;
        padding: 0.75rem 0.6rem;
        white-space: nowrap;
    }
    .argym-input-group input {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Custom dropdown: pin its options panel to the form width, never
       wider than the trigger, so the menu doesn't blow out the layout. */
    .argym-select,
    .argym-select-trigger,
    .argym-select-options {
        max-width: 100%;
    }

    /* Size selector / palette / radio rows wrap by default on small. */
    .argym-size-options,
    .argym-status-radio-group,
    .argym-color-selector,
    .argym-checkbox-list {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Inventory + variant editors expose a horizontal scroll on phones
       rather than overflowing the page. */
    .argym-inventory-table-wrapper,
    .argym-variant-editor {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .argym-inventory-table {
        min-width: 540px;
    }

    /* RichEditor toolbar wraps so buttons remain visible and tappable. */
    .argym-rich-editor-toolbar {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* ImageUpload zone shrinks padding on phones; preview grid sizing
       is handled in the dedicated .argym-image-previews block. */
    .argym-upload-zone {
        width: 100%;
        padding: 1.5rem 1rem;
    }
    .argym-upload-zone i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}

/* Mobile admin: page header titles wrap, action buttons drop full-width */
@media (max-width: 480px) {
    .argym-page-title {
        font-size: 1.2rem;
    }
    .argym-page-header-actions > .argym-button,
    .argym-page-header-actions > .btn {
        width: 100%;
    }
    .argym-form-row,
    .argym-edit-layout {
        grid-template-columns: 1fr !important;
    }
}
