/* ============================================
   ADMIN PANEL - OPTION 3: WARM & ORGANIC
   Friendly, rounded, approachable design
   ============================================ */

:root {
    /* Brand Colors */
    --beige: #F5F5DC;
    --beige-light: #FAFAF2;
    --cafe: #8B7355;
    --cafe-light: #C4A77D;
    --blanco: #FFFFFF;

    /* Neutral */
    --dark: #3D3D3D;
    --gray: #6B6B6B;
    --gray-light: #A0A0A0;
    --border: #E8E4D9;
    --bg: #FAF8F5;

    /* Status */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

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

    /* Layout */
    --sidebar-width: 280px;
    --topbar-height: 70px;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 50px;
    --shadow: 0 4px 20px rgba(139, 115, 85, 0.08);
    --shadow-hover: 0 8px 30px rgba(139, 115, 85, 0.12);
    --transition: 0.3s ease;
}

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

body {
    font-family: var(--font-primary);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.5;
}

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

/* ========== SIDEBAR ========== */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--blanco);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo {
    height: 50px;
}

.admin-tag {
    background: var(--beige);
    color: var(--cafe);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.user-card {
    margin: 1.5rem;
    padding: 1rem;
    background: var(--beige-light);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

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

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

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

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

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-group-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 0.25rem;
}

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

.nav-link.active {
    background: var(--cafe);
    color: var(--blanco);
}

.nav-link.active .nav-icon {
    background: rgba(255, 255, 255, 0.2);
}

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

.nav-link:hover .nav-icon {
    background: var(--beige);
}

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

.badge.warning {
    background: #FEF3C7;
    color: #D97706;
}

.badge.primary {
    background: var(--cafe);
    color: var(--blanco);
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
}

.store-link {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--beige);
    color: var(--cafe);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.store-link:hover {
    background: var(--cafe);
    color: var(--blanco);
}

.logout-btn {
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.logout-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ========== MAIN ========== */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
}

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

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

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

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

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

.topbar-search input::placeholder {
    color: var(--gray-light);
}

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

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

.topbar-btn {
    position: relative;
    width: 44px;
    height: 44px;
    background: var(--beige-light);
    border: none;
    border-radius: 50%;
    color: var(--gray);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

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

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

/* ========== PAGE CONTENT ========== */
.page-content {
    padding: 2rem;
}

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

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

.wave {
    font-size: 2.5rem;
}

.greeting h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.greeting p {
    color: var(--gray);
    font-size: 0.95rem;
}

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

.date-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--blanco);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.date-selector:hover {
    border-color: var(--cafe);
}

.btn-add {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--cafe);
    color: var(--blanco);
    border: none;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-add:hover {
    background: var(--cafe-light);
    transform: translateY(-2px);
}

/* ========== STATS CARDS ========== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--blanco);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

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

.stat-card.orders .stat-icon {
    background: rgba(196, 167, 125, 0.2);
    color: var(--cafe-light);
}

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

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

.stat-details {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
}

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

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

.stat-graph {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 50px;
    opacity: 0.7;
}

/* ========== DASHBOARD LAYOUT ========== */
.dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.dashboard-card {
    background: var(--blanco);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-title p {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 400;
    margin-top: 0.25rem;
}

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

.view-all:hover {
    gap: 0.5rem;
}

.chart-tabs {
    display: flex;
    gap: 0.25rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.tab:hover,
.tab.active {
    background: var(--cafe);
    border-color: var(--cafe);
    color: var(--blanco);
}

.card-body {
    padding: 1.5rem;
}

/* ========== SALES CHART ========== */
.chart-card {
    grid-column: span 2;
}

.sales-chart {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.chart-info {
    display: flex;
    gap: 2rem;
}

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

.info-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.info-dot.current {
    background: var(--cafe);
}

.info-dot.previous {
    background: var(--beige);
}

.info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
}

.info-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.chart-bars-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    padding-top: 1rem;
}

.chart-bar-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.bar-pair {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 180px;
}

.bar {
    width: 20px;
    border-radius: 6px 6px 0 0;
    transition: var(--transition);
}

.bar.previous {
    background: var(--beige);
}

.bar.current {
    background: var(--cafe);
}

.chart-bar-wrapper.highlight .bar.current {
    background: linear-gradient(to top, var(--cafe) 0%, var(--cafe-light) 100%);
}

.bar-day {
    font-size: 0.75rem;
    color: var(--gray);
}

/* ========== ORDERS ========== */
.orders-list {
    display: flex;
    flex-direction: column;
}

.order-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

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

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

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dark);
}

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

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

.order-number {
    font-size: 0.75rem;
    color: var(--gray);
}

.order-amount {
    font-weight: 600;
    min-width: 80px;
    text-align: right;
}

.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
}

.status-badge.pending {
    background: #FEF3C7;
    color: #D97706;
}

.status-badge.processing {
    background: #DBEAFE;
    color: #2563EB;
}

.status-badge.shipped {
    background: #E0E7FF;
    color: #5B21B6;
}

.status-badge.completed {
    background: #D1FAE5;
    color: #059669;
}

/* ========== TOP PRODUCTS ========== */
.top-products-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.top-product:hover {
    background: var(--beige);
}

.rank {
    width: 28px;
    height: 28px;
    background: var(--cafe);
    color: var(--blanco);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.product-thumb {
    width: 40px;
    height: 40px;
    background: var(--blanco);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
}

.product-info {
    flex: 1;
}

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

.product-category {
    font-size: 0.75rem;
    color: var(--gray);
}

.product-metrics {
    text-align: center;
    min-width: 60px;
}

.metric-value {
    display: block;
    font-weight: 700;
    font-size: 1rem;
}

.metric-label {
    font-size: 0.65rem;
    color: var(--gray);
}

.product-progress {
    width: 60px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--cafe);
    border-radius: 3px;
}

/* ========== ALERTS ========== */
.alert-count {
    font-size: 0.8rem;
    color: var(--gray);
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.alert-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid;
}

.alert-row.critical {
    border-left-color: var(--danger);
}

.alert-row.warning {
    border-left-color: var(--warning);
}

.alert-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.alert-thumb {
    width: 38px;
    height: 38px;
    background: var(--blanco);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-light);
}

.alert-info {
    display: flex;
    flex-direction: column;
}

.alert-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.alert-sku {
    font-size: 0.7rem;
    color: var(--gray);
}

.alert-stock {
    text-align: center;
    min-width: 50px;
}

.stock-num {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
}

.stock-label {
    font-size: 0.65rem;
    color: var(--gray);
}

.restock-btn {
    width: 36px;
    height: 36px;
    background: var(--blanco);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

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

.restock-all-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--beige);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--cafe);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.restock-all-btn:hover {
    background: var(--cafe);
    color: var(--blanco);
}

/* ========== QUICK ACTIONS ========== */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--beige-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.quick-action:hover {
    background: var(--cafe);
    border-color: var(--cafe);
    border-style: solid;
}

.quick-action:hover .action-icon {
    background: rgba(255, 255, 255, 0.2);
    color: var(--blanco);
}

.quick-action:hover span {
    color: var(--blanco);
}

.action-icon {
    width: 48px;
    height: 48px;
    background: var(--beige);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--cafe);
    transition: var(--transition);
}

.quick-action span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
}

/* ========== CATEGORIES CHART ========== */
.categories-chart {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.donut-container {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.donut-container svg {
    transform: rotate(-90deg);
}

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

.total-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 500;
}

.total-label {
    font-size: 0.7rem;
    color: var(--gray);
}

.categories-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.categories-list .category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.cat-name {
    flex: 1;
    font-size: 0.85rem;
}

.cat-percent {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 35px;
}

.cat-value {
    font-size: 0.8rem;
    color: var(--gray);
    min-width: 60px;
    text-align: right;
}

/* ========== PAGE TITLE ========== */
.page-header h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--gray);
    font-size: 0.95rem;
}

/* ========== BUTTONS ========== */
.btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--blanco);
    color: var(--dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

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

/* ========== FILTERS ROW ========== */
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.6rem 2rem 0.6rem 1rem;
    background: var(--blanco);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236B6B6B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 10px;
}

.filter-select:hover,
.filter-select:focus {
    border-color: var(--cafe);
    outline: none;
}

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

.data-table thead {
    background: var(--beige-light);
}

.data-table th {
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--cafe);
    cursor: pointer;
}

.order-id {
    font-weight: 600;
    color: var(--cafe);
}

.location {
    color: var(--gray);
    font-size: 0.85rem;
}

.location i {
    margin-right: 0.25rem;
}

.orders-count {
    font-weight: 600;
}

.total-spent {
    font-weight: 600;
    color: var(--cafe);
}

.date {
    color: var(--gray);
    font-size: 0.85rem;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    background: var(--beige-light);
    border: none;
    border-radius: 50%;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.payment-badge.paid {
    background: #D1FAE5;
    color: #059669;
}

.payment-badge.pending {
    background: #FEF3C7;
    color: #D97706;
}

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

.segment-badge.vip {
    background: #FEF3C7;
    color: #D97706;
}

.segment-badge.premium {
    background: #E0E7FF;
    color: #5B21B6;
}

.segment-badge.regular {
    background: var(--beige);
    color: var(--cafe);
}

.segment-badge.new {
    background: #DBEAFE;
    color: #2563EB;
}

/* ========== PAGINATION ========== */
.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding: 1rem 0;
}

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

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

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

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

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

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

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

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

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

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

.back-link:hover {
    gap: 0.75rem;
}

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

.form-group:last-child {
    margin-bottom: 0;
}

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

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--cafe);
    background: var(--blanco);
}

.form-input::placeholder {
    color: var(--gray-light);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .prefix,
.input-group .suffix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    background: var(--beige);
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 500;
}

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

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

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

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--gray);
}

.form-select {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%236B6B6B' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
}

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

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

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

.editor-toolbar button {
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.editor-toolbar button:hover {
    background: var(--beige);
    color: var(--dark);
}

.editor-content {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: none;
    resize: vertical;
    font-size: 0.9rem;
}

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

/* ========== UPLOAD ZONE ========== */
.upload-zone {
    padding: 2.5rem;
    background: var(--beige-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 1.5rem;
}

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

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

.upload-zone h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--gray);
}

.upload-zone span {
    color: var(--cafe);
    font-weight: 500;
}

.upload-zone small {
    display: block;
    margin-top: 0.5rem;
    color: var(--gray-light);
    font-size: 0.75rem;
}

/* ========== IMAGE PREVIEWS ========== */
.image-previews {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.image-preview {
    width: 100px;
    height: 100px;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-preview.main {
    border: 2px solid var(--cafe);
}

.image-preview .placeholder {
    color: var(--gray-light);
    font-size: 1.5rem;
}

.image-preview .label {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--cafe);
    color: var(--blanco);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
}

.add-image {
    width: 100px;
    height: 100px;
    background: var(--beige-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.add-image:hover {
    border-color: var(--cafe);
    color: var(--cafe);
}

.add-image i {
    font-size: 1.5rem;
    color: var(--gray);
}

/* ========== VARIANTS ========== */
.variant-section {
    margin-bottom: 1.5rem;
}

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

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

.variant-header label {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
}

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

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

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

.variant-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
}

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

.variant-item input {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-size: 0.9rem;
}

.variant-item input:focus {
    outline: none;
    background: var(--blanco);
    border-color: var(--border);
}

.remove-btn {
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    border-radius: 50%;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

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

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

.size-option {
    cursor: pointer;
}

.size-option input {
    display: none;
}

.size-option span {
    display: block;
    min-width: 44px;
    padding: 0.5rem 0.75rem;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    transition: var(--transition);
}

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

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

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

.inventory-table th {
    padding: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    background: var(--beige-light);
    border-bottom: 1px solid var(--border);
}

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

.inventory-table input {
    width: 100%;
    padding: 0.5rem;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
}

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

.inventory-total {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: right;
}

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

/* ========== STATUS RADIO ========== */
.status-radio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.status-radio:last-child {
    margin-bottom: 0;
}

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

.status-radio input {
    accent-color: var(--cafe);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

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

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

/* ========== TAGS ========== */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--beige-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: var(--cafe);
    color: var(--blanco);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
}

.tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: var(--transition);
}

.tag button:hover {
    opacity: 1;
}

.tags-container input {
    flex: 1;
    min-width: 100px;
    padding: 0.35rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
}

.tags-container input:focus {
    outline: none;
}

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

.add-link:hover {
    text-decoration: underline;
}

/* ========== CHECKBOX ITEM ========== */
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    cursor: pointer;
}

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

.checkbox-item span {
    font-size: 0.9rem;
}

/* ========== STATS CARDS 4 COLUMN ========== */
.stats-cards.stats-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ========== DASHBOARD CHARTS ========== */
.argym-charts-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.argym-chart-card {
    overflow: hidden;
}

/* -- Bar Chart -- */
.argym-sales-chart {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.argym-chart-legend {
    display: flex;
    gap: 2rem;
}

.argym-legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.argym-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.argym-legend-dot.current {
    background: var(--cafe);
}

.argym-legend-dot.previous {
    background: var(--beige);
}

.argym-legend-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray);
}

.argym-legend-value {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.argym-bar-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 200px;
    padding-top: 1rem;
}

.argym-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.argym-bar-pair {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 180px;
}

.argym-bar {
    width: 20px;
    border-radius: 6px 6px 0 0;
    transition: var(--transition);
    min-height: 4px;
}

.argym-bar.previous {
    background: var(--beige);
}

.argym-bar.current {
    background: var(--cafe);
}

.argym-bar-group.highlight .argym-bar.current {
    background: linear-gradient(to top, var(--cafe) 0%, var(--cafe-light) 100%);
}

.argym-bar-label {
    font-size: 0.75rem;
    color: var(--gray);
}

.argym-chart-tabs {
    display: flex;
    gap: 0.25rem;
}

.argym-chart-tab {
    padding: 0.5rem 1rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray);
}

.argym-chart-tab:hover,
.argym-chart-tab.active {
    background: var(--cafe);
    border-color: var(--cafe);
    color: var(--blanco);
}

/* -- Donut Chart -- */
.argym-donut-chart {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.argym-donut-container {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

.argym-donut-container svg {
    width: 100%;
    height: 100%;
}

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

.argym-donut-value {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 500;
}

.argym-donut-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray);
}

.argym-donut-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

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

.argym-donut-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.argym-donut-name {
    flex: 1;
    font-size: 0.85rem;
}

.argym-donut-percent {
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 35px;
}

.argym-donut-amount {
    font-size: 0.8rem;
    color: var(--gray);
    min-width: 60px;
    text-align: right;
}

/* ========== DASHBOARD GRID ========== */
.argym-dashboard-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* ========== CATALOG OVERVIEW ========== */
.argym-catalog-overview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.argym-catalog-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
}

.argym-catalog-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blanco);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.argym-catalog-data {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.argym-catalog-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.argym-catalog-label {
    font-size: 0.75rem;
    color: var(--gray);
}

.argym-catalog-details {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
}

.argym-catalog-details span {
    font-size: 0.75rem;
    color: var(--gray);
}

/* ========== SETTINGS ========== */
.argym-settings-alert {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.argym-settings-alert.warning {
    background: #FEF3C7;
    color: #92400E;
}

.argym-settings-alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.argym-settings-section {
    padding: 1rem 0;
}

.argym-settings-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--beige-light);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin: 1rem 0;
}

.argym-settings-info i {
    color: var(--info);
}

/* ========== COLOR PALETTES ========== */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.argym-color-input {
    width: 44px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    flex-shrink: 0;
}

.argym-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.argym-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.palette-preview {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.palette-preview-small {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    vertical-align: middle;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-cards.stats-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .chart-card {
        grid-column: span 1;
    }

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

    .edit-sidebar {
        order: -1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

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

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }
}

@media (max-width: 767px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }

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

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .topbar-search {
        display: none;
    }

    .page-content {
        padding: 1rem;
    }

    .admin-topbar {
        padding: 0 1rem;
    }

    .greeting .wave {
        display: none;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
    }

    .categories-chart,
    .argym-donut-chart {
        flex-direction: column;
    }

    .argym-donut-container {
        margin: 0 auto;
    }

    .chart-bars-container {
        height: 150px;
    }

    .argym-bar-chart {
        height: 150px;
    }

    .argym-bar-pair {
        height: 130px;
    }

    .argym-bar {
        width: 14px;
    }

    .argym-chart-tabs {
        display: none;
    }

    .bar-pair {
        height: 130px;
    }

    .bar {
        width: 14px;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-tabs {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

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

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

    .data-table {
        display: block;
        overflow-x: auto;
    }

    .pagination-row {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* ============================================
   ADMIN ORDERS
   ============================================ */

.admin-order-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
    flex-wrap: wrap;
}

.admin-order-info { flex: 1; min-width: 180px; }
.admin-order-number {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--admin-text, #4A3728);
}
.admin-order-date {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.admin-order-customer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.admin-order-customer i { font-size: 1rem; }

.admin-order-delivery {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
    margin-bottom: 16px;
}

.admin-order-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
}

.admin-order-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-order-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-bg-subtle, #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.admin-order-item-img img { width: 100%; height: 100%; object-fit: cover; }
.admin-order-item-img i { font-size: 1.1rem; opacity: 0.3; }

.admin-order-item-info { flex: 1; min-width: 0; }
.admin-order-item-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-text, #4A3728);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-order-item-variant {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.admin-order-item-qty {
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
    flex-shrink: 0;
}

.admin-order-item-price {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-text, #4A3728);
    flex-shrink: 0;
    min-width: 80px;
    text-align: right;
}

.admin-order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-order-total span {
    color: var(--admin-text-muted, #8a7a6d);
    margin-right: 8px;
}
.admin-order-total strong {
    font-size: 1.1rem;
    color: var(--admin-text, #4A3728);
}

.admin-order-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-order-delivered-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #27ae60;
}

/* ============================================
   ADMIN ORDER DETAIL
   ============================================ */

.order-detail-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.order-detail-status-date {
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
}

/* Items */
.order-detail-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.order-detail-item {
    display: flex;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
}
.order-detail-item:last-child { border-bottom: none; }

.order-detail-item-img {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--admin-bg-subtle, #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.order-detail-item-img img { width: 100%; height: 100%; object-fit: cover; }
.order-detail-item-img i { font-size: 1.5rem; opacity: 0.25; }

.order-detail-item-body { flex: 1; min-width: 0; }

.order-detail-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}
.order-detail-item-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--admin-text, #4A3728);
}
.order-detail-item-total {
    font-weight: 700;
    font-size: 1rem;
    color: var(--admin-text, #4A3728);
    flex-shrink: 0;
}

.order-detail-item-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.order-detail-item-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.order-detail-item-variants {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.order-detail-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    background: var(--admin-bg-subtle, #f5f0e8);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--admin-text, #4A3728);
}
.order-detail-tag i { font-size: 0.75rem; opacity: 0.6; }
.order-detail-tag.discount {
    background: rgba(196, 112, 75, 0.12);
    color: var(--terracota, #C4704B);
}

/* Summary */
.order-detail-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.order-detail-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.order-detail-summary-row.total {
    padding-top: 12px;
    border-top: 2px solid var(--admin-border, #e8e0d4);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
}

/* Customer */
.order-detail-customer {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-detail-customer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--admin-text, #4A3728);
}
.order-detail-customer-row i {
    font-size: 1rem;
    color: var(--admin-text-muted, #8a7a6d);
    width: 20px;
    text-align: center;
}

/* Delivery */
.order-detail-delivery-method {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}
.order-detail-delivery-method i {
    font-size: 1.3rem;
    color: var(--admin-text, #4A3728);
}
.order-detail-delivery-method strong {
    display: block;
    color: var(--admin-text, #4A3728);
}
.order-detail-delivery-method span {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

/* IDs */
.order-detail-ids {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order-detail-id-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
.order-detail-id-row span {
    color: var(--admin-text-muted, #8a7a6d);
}
.order-detail-id-row code {
    background: var(--admin-bg-subtle, #f5f0e8);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--admin-text, #4A3728);
    word-break: break-all;
}

/* ============================================
   SMART SEARCH DROPDOWN
   ============================================ */

.smart-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 998;
}

.smart-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--admin-card-bg, #fff);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 999;
    padding: 8px;
}

.smart-search-group {
    margin-bottom: 4px;
}

.smart-search-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted, #8a7a6d);
}

.smart-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
.smart-search-item:hover {
    background: var(--admin-bg-subtle, #f5f0e8);
}

.smart-search-item-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-bg-subtle, #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.smart-search-item-img img { width: 100%; height: 100%; object-fit: cover; }
.smart-search-item-img i { font-size: 0.9rem; opacity: 0.4; }

.smart-search-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--admin-bg-subtle, #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.smart-search-item-info { flex: 1; min-width: 0; }
.smart-search-item-title {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--admin-text, #4A3728);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.smart-search-item-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.smart-search-item-detail {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
    flex-shrink: 0;
    text-align: right;
}

.smart-search-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    color: var(--admin-text-muted, #8a7a6d);
    font-size: 0.85rem;
}
.smart-search-empty i { font-size: 1.2rem; opacity: 0.4; }

.smart-search-footer {
    text-align: center;
    padding: 8px;
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
    border-top: 1px solid var(--admin-border, #e8e0d4);
    margin-top: 4px;
}

/* ============================================
   DARK MODE
   ============================================ */

[data-theme="dark"] {
    --admin-text: #F5F5F0;
    --admin-text-muted: #A0998F;
    --admin-bg-subtle: #2A2520;
    --admin-border: #4A433C;
    --admin-card-bg: #1E1B18;
}

[data-theme="dark"] .smart-search-dropdown {
    background: #1E1B18;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

[data-theme="dark"] .smart-search-item:hover {
    background: #2A2520;
}

[data-theme="dark"] .smart-search-item-img,
[data-theme="dark"] .smart-search-item-icon {
    background: #2A2520;
}

[data-theme="dark"] .smart-search-item-title {
    color: #F5F5F0;
}

[data-theme="dark"] .admin-order-header,
[data-theme="dark"] .admin-order-items,
[data-theme="dark"] .order-detail-item {
    border-color: #4A433C;
}

[data-theme="dark"] .admin-order-number,
[data-theme="dark"] .admin-order-item-name,
[data-theme="dark"] .admin-order-item-price,
[data-theme="dark"] .admin-order-total strong,
[data-theme="dark"] .order-detail-item-name,
[data-theme="dark"] .order-detail-item-total {
    color: #F5F5F0;
}

[data-theme="dark"] .admin-order-date,
[data-theme="dark"] .admin-order-customer,
[data-theme="dark"] .admin-order-delivery,
[data-theme="dark"] .admin-order-item-variant,
[data-theme="dark"] .admin-order-item-qty,
[data-theme="dark"] .admin-order-total span,
[data-theme="dark"] .order-detail-item-meta span,
[data-theme="dark"] .order-detail-status-date,
[data-theme="dark"] .order-detail-summary-row,
[data-theme="dark"] .order-detail-customer-row,
[data-theme="dark"] .order-detail-customer-row i,
[data-theme="dark"] .order-detail-delivery-method span,
[data-theme="dark"] .order-detail-id-row span {
    color: #A0998F;
}

[data-theme="dark"] .admin-order-item-img,
[data-theme="dark"] .order-detail-item-img {
    background: #2A2520;
}

[data-theme="dark"] .order-detail-tag {
    background: #2A2520;
    color: #D4BC96;
}

[data-theme="dark"] .order-detail-tag.discount {
    background: rgba(196, 112, 75, 0.2);
    color: #e8956a;
}

[data-theme="dark"] .order-detail-summary-row.total {
    border-color: #4A433C;
    color: #F5F5F0;
}

[data-theme="dark"] .order-detail-id-row code {
    background: #2A2520;
    color: #D4BC96;
}

[data-theme="dark"] .order-detail-delivery-method i,
[data-theme="dark"] .order-detail-delivery-method strong {
    color: #F5F5F0;
}

.order-status-badge.cancelled {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
}

[data-theme="dark"] .order-status-badge.cancelled {
    background: rgba(220, 53, 69, 0.2);
    color: #ff6b7a;
}

[data-theme="dark"] .order-status-badge.processing {
    background: rgba(241, 196, 15, 0.2);
    color: #f0d060;
}

[data-theme="dark"] .order-status-badge.ready {
    background: rgba(196, 167, 125, 0.2);
    color: #D4BC96;
}

[data-theme="dark"] .order-status-badge.delivered {
    background: rgba(39, 174, 96, 0.2);
    color: #5cd88a;
}

[data-theme="dark"] .argym-color-swatch {
    border-color: rgba(255,255,255,0.15);
}

/* ============================================
   POINT OF SALE
   ============================================ */

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.pos-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
    margin: 0;
}
.pos-subtitle {
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
}

/* Search results */
.pos-search-results {
    margin-top: 12px;
    border-top: 1px solid var(--admin-border, #e8e0d4);
}
.pos-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
}
.pos-search-item:hover { background: var(--admin-bg-subtle, #f5f0e8); }
.pos-search-item:last-child { border-bottom: none; }

.pos-search-img {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-bg-subtle, #f5f0e8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pos-search-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-search-img i { font-size: 1rem; opacity: 0.3; }

.pos-search-info { flex: 1; min-width: 0; }
.pos-search-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-text, #4A3728);
}
.pos-search-meta {
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.pos-search-price {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--admin-text, #4A3728);
    flex-shrink: 0;
}

/* Two-column layout: products on the left, cart rail on the right.
   The rail is sticky so the cashier always sees the running total and
   the Completar Venta button without scrolling. */
.pos-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.25rem;
    align-items: start;
}
.pos-main { min-width: 0; }

.pos-cart {
    display: flex;
    flex-direction: column;
    background: var(--admin-card-bg, #fff);
    border: 1px solid var(--admin-border, #e8e0d4);
    border-radius: 14px;
    overflow: hidden;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
}

.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
}
.pos-cart-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.pos-cart-count {
    background: var(--admin-bg-subtle, #f5f0e8);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--admin-text-muted, #8a7a6d);
}
.pos-cart-clear {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--admin-text-muted, #8a7a6d);
    padding: 6px 8px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
}
.pos-cart-clear:hover {
    background: var(--admin-bg-subtle, #f5f0e8);
    color: #c0392b;
}

.pos-cart-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px;
}
.pos-cart-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.pos-cart-empty i {
    font-size: 2.2rem;
    opacity: 0.2;
    display: block;
    margin-bottom: 0.5rem;
}
.pos-cart-empty p { margin: 0; font-size: 0.85rem; }

.pos-cart-row {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}
.pos-cart-row + .pos-cart-row { border-top: 1px solid var(--admin-border, #e8e0d4); }
.pos-cart-row-info { min-width: 0; }
.pos-cart-row-info strong {
    display: block;
    font-size: 0.9rem;
    color: var(--admin-text, #4A3728);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-cart-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
    margin-top: 2px;
}
.pos-cart-row-price {
    display: block;
    font-size: 0.7rem;
    color: var(--admin-text-muted, #8a7a6d);
    margin-top: 2px;
}
.pos-cart-row-qty {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px;
    background: var(--admin-bg-subtle, #f5f0e8);
    border-radius: 8px;
}
.pos-cart-row-qty span { min-width: 22px; text-align: center; font-weight: 700; font-size: 0.85rem; }
.pos-cart-row-total { font-weight: 700; font-size: 0.95rem; min-width: 70px; text-align: right; }
.pos-cart-row-remove {
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--admin-text-muted, #8a7a6d);
    padding: 4px 6px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.pos-cart-row-remove:hover { background: var(--admin-bg-subtle, #f5f0e8); color: #c0392b; }

.pos-qty-btn {
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 6px;
    background: var(--admin-card-bg, #fff);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--admin-text, #4A3728);
    transition: background 0.15s;
}
.pos-qty-btn:hover:not(:disabled) { background: var(--admin-border, #e8e0d4); }
.pos-qty-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Sticky footer inside the rail: totals + payment + checkout. */
.pos-cart-foot {
    border-top: 1px solid var(--admin-border, #e8e0d4);
    padding: 14px 18px;
    background: var(--admin-bg-subtle, #f5f0e8);
}
.pos-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 0.85rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.pos-summary-row.total {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
    padding-top: 10px;
    margin-top: 4px;
    border-top: 2px solid var(--admin-border, #e8e0d4);
}
.pos-payment-row {
    display: flex;
    gap: 8px;
    margin: 12px 0 12px;
}

.pos-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    display: inline-block;
    flex-shrink: 0;
}
.pos-search-variant-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--admin-bg-subtle, #f5f0e8);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--admin-text-muted, #8a7a6d);
}

/* Payment buttons */
.pos-payment-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid var(--admin-border, #e8e0d4);
    border-radius: 10px;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--admin-text-muted, #8a7a6d);
    transition: all 0.2s;
}
.pos-payment-btn:hover { border-color: var(--admin-text, #4A3728); color: var(--admin-text, #4A3728); }
.pos-payment-btn.active {
    border-color: var(--cafe, #4A3728);
    background: var(--cafe, #4A3728);
    color: white;
}

.pos-checkout-btn {
    width: 100%;
    padding: 16px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
.pos-checkout-btn:hover:not(:disabled) { background: #219a52; }
.pos-checkout-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* POS Categories */
.pos-categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--admin-border, #e8e0d4);
}
.pos-cat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--admin-border, #e8e0d4);
    border-radius: 999px;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--admin-text-muted, #8a7a6d);
    transition: all 0.2s;
}
.pos-cat-btn:hover { border-color: var(--admin-text, #4A3728); color: var(--admin-text, #4A3728); }
.pos-cat-btn.active {
    background: var(--cafe, #4A3728);
    border-color: var(--cafe, #4A3728);
    color: white;
}
.pos-cat-count {
    font-size: 0.65rem;
    background: rgba(0,0,0,0.08);
    padding: 1px 6px;
    border-radius: 10px;
}
.pos-cat-btn.active .pos-cat-count { background: rgba(255,255,255,0.2); }

/* POS Product Grid */
.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--admin-border, #e8e0d4);
}
.pos-grid-item {
    background: var(--admin-bg-subtle, #f5f0e8);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.pos-grid-item:hover { background: var(--admin-border, #e8e0d4); transform: translateY(-1px); }
.pos-grid-img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-card-bg, #fff);
    display: flex;
    align-items: center;
    justify-content: center;
}
.pos-grid-img img { width: 100%; height: 100%; object-fit: cover; }
.pos-grid-img i { font-size: 1rem; opacity: 0.2; }
.pos-grid-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--admin-text, #4A3728);
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pos-grid-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
}
.pos-grid-stock {
    font-size: 0.6rem;
    color: var(--admin-text-muted, #8a7a6d);
}

[data-theme="dark"] .pos-grid-item { background: #2A2520; }
[data-theme="dark"] .pos-grid-item:hover { background: #3D3630; }
[data-theme="dark"] .pos-grid-img { background: #1E1B18; }
[data-theme="dark"] .pos-cat-btn.active { background: #C4A77D; border-color: #C4A77D; color: #1E1B18; }

/* Variant picker matrix (modal opened from a product tile when 2+ profiles exist) */
.pos-variant-summary {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 0 14px;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
    margin-bottom: 14px;
}
.pos-variant-summary img {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
}
.pos-variant-summary-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
}
.pos-variant-summary-stock {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.pos-variant-matrix {
    display: grid;
    grid-template-columns: 120px repeat(var(--cols, 1), minmax(0, 1fr));
    gap: 6px;
}
.pos-vm-cell {
    min-height: 54px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border: 1px solid transparent;
}
.pos-vm-head {
    min-height: 28px;
    font-weight: 700;
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pos-vm-rowhead {
    justify-content: flex-start;
    flex-direction: row;
    gap: 6px;
    padding: 0 10px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--admin-text, #4A3728);
    text-align: left;
}
.pos-vm-pick {
    cursor: pointer;
    border: 1px solid var(--admin-border, #e8e0d4);
    background: var(--admin-card-bg, #fff);
    transition: transform 0.12s, border-color 0.12s, background 0.12s;
    padding: 4px;
}
.pos-vm-pick:hover:not(.disabled) {
    border-color: var(--cafe, #4A3728);
    background: var(--admin-bg-subtle, #f5f0e8);
    transform: translateY(-1px);
}
.pos-vm-pick.disabled {
    background: var(--admin-bg-subtle, #f5f0e8);
    color: var(--admin-text-muted, #8a7a6d);
    opacity: 0.45;
    cursor: not-allowed;
}
.pos-vm-stock { font-weight: 700; font-size: 1rem; color: var(--admin-text, #4A3728); }
.pos-vm-pick.disabled .pos-vm-stock { color: var(--admin-text-muted, #8a7a6d); }
.pos-vm-price { font-size: 0.7rem; color: var(--admin-text-muted, #8a7a6d); margin-top: 2px; }
.pos-vm-empty { opacity: 0.4; font-size: 1rem; }

/* POS method badge */
.pos-method-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.pos-method-badge.pos-cash { background: rgba(39,174,96,0.12); color: #27ae60; }
.pos-method-badge.pos-card { background: rgba(52,152,219,0.12); color: #2980b9; }

/* Dark mode */
[data-theme="dark"] .pos-cart { background: #1E1B18; border-color: #2A2520; }
[data-theme="dark"] .pos-cart-head,
[data-theme="dark"] .pos-cart-foot { border-color: #2A2520; }
[data-theme="dark"] .pos-cart-foot { background: #15120F; }
[data-theme="dark"] .pos-cart-row + .pos-cart-row { border-color: #2A2520; }
[data-theme="dark"] .pos-cart-count,
[data-theme="dark"] .pos-cart-row-qty,
[data-theme="dark"] .pos-search-variant-pill { background: #2A2520; }
[data-theme="dark"] .pos-qty-btn { background: #1E1B18; }
[data-theme="dark"] .pos-qty-btn:hover:not(:disabled) { background: #3D3630; }
[data-theme="dark"] .pos-search-item:hover { background: #2A2520; }
[data-theme="dark"] .pos-payment-btn.active { background: #C4A77D; border-color: #C4A77D; color: #1E1B18; }
[data-theme="dark"] .pos-vm-pick { background: #2A2520; border-color: #3D3630; }
[data-theme="dark"] .pos-vm-pick:hover:not(.disabled) { background: #3D3630; border-color: #C4A77D; }
[data-theme="dark"] .pos-vm-pick.disabled { background: #1E1B18; }
[data-theme="dark"] .pos-vm-stock { color: #E8DCC8; }

/* ============================================
   REPORTS
   ============================================ */

.report-kpi {
    background: var(--admin-card-bg, #fff);
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.report-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--admin-text, #4A3728);
}
.report-kpi-label {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}

/* Bar Chart */
.report-chart { padding: 10px 0; }
.report-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding-bottom: 24px;
    position: relative;
}
.report-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    cursor: pointer;
    position: relative;
}
.report-bar {
    width: 80%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--cafe, #4A3728) 0%, var(--cafe-light, #7a6a5a) 100%);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}
.report-bar-col:hover .report-bar { opacity: 0.8; }
.report-bar-label {
    font-size: 0.6rem;
    color: var(--admin-text-muted, #8a7a6d);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

/* Table */
.report-table { overflow-x: auto; }
.report-table-header,
.report-table-row {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    font-size: 0.85rem;
}
.report-table-header {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-text-muted, #8a7a6d);
    border-bottom: 2px solid var(--admin-border, #e8e0d4);
}
.report-table-row {
    color: var(--admin-text, #4A3728);
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
}
.report-table-header span,
.report-table-row span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Horizontal Bars */
.report-hbar-row {
    margin-bottom: 12px;
}
.report-hbar-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.report-hbar-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--admin-text, #4A3728);
}
.report-hbar-value {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.report-hbar-track {
    height: 8px;
    background: var(--admin-bg-subtle, #f5f0e8);
    border-radius: 4px;
    overflow: hidden;
}
.report-hbar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--cafe, #4A3728), var(--terracota, #C4704B));
    border-radius: 4px;
    transition: width 0.5s;
}

/* Stat Rows */
.report-stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--admin-border, #e8e0d4);
}
.report-stat-row:last-child { border-bottom: none; }
.report-stat-row span:first-child {
    font-weight: 600;
    color: var(--admin-text, #4A3728);
}
.report-stat-row span:last-child {
    color: var(--admin-text-muted, #8a7a6d);
}

/* Dark mode */
[data-theme="dark"] .report-kpi { background: #1E1B18; }
[data-theme="dark"] .report-kpi-value { color: #F5F5F0; }
[data-theme="dark"] .report-bar { background: linear-gradient(180deg, #C4A77D, #A68B6A); }
[data-theme="dark"] .report-hbar-track { background: #2A2520; }
[data-theme="dark"] .report-hbar-fill { background: linear-gradient(90deg, #C4A77D, #e8956a); }
[data-theme="dark"] .report-table-row, [data-theme="dark"] .report-stat-row span:first-child, [data-theme="dark"] .report-hbar-name { color: #F5F5F0; }

/* ============================================
   ERROR LOG CARDS
   ============================================ */

.error-log-card {
    background: var(--admin-card-bg, #fff);
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 8px;
    border-left: 4px solid var(--admin-border, #e8e0d4);
}
.error-log-card.critical { border-left-color: #dc3545; }
.error-log-card.error { border-left-color: #e67e22; }
.error-log-card.warning { border-left-color: #f1c40f; }
.error-log-card.information { border-left-color: #3498db; }
.error-log-card.debug { border-left-color: #95a5a6; }

.error-log-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.error-log-level {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.error-log-level.critical { background: rgba(220,53,69,0.15); color: #dc3545; }
.error-log-level.error { background: rgba(230,126,34,0.15); color: #e67e22; }
.error-log-level.warning { background: rgba(241,196,15,0.15); color: #c9a90a; }
.error-log-level.information { background: rgba(52,152,219,0.15); color: #3498db; }
.error-log-level.debug { background: rgba(149,165,166,0.15); color: #7f8c8d; }

.error-log-date {
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
}

.error-log-message {
    font-size: 0.9rem;
    color: var(--admin-text, #4A3728);
    margin: 0 0 8px;
    word-break: break-word;
}

.error-log-meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--admin-text-muted, #8a7a6d);
}
.error-log-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-log-trace {
    margin-top: 10px;
}
.error-log-trace summary {
    font-size: 0.8rem;
    color: var(--admin-text-muted, #8a7a6d);
    cursor: pointer;
    font-weight: 500;
}
.error-log-trace pre {
    font-size: 0.7rem;
    background: var(--admin-bg-subtle, #f5f0e8);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-top: 8px;
    max-height: 300px;
    color: var(--admin-text, #4A3728);
}

[data-theme="dark"] .error-log-card {
    background: #1E1B18;
}
[data-theme="dark"] .error-log-message { color: #F5F5F0; }
[data-theme="dark"] .error-log-trace pre { background: #2A2520; color: #D4BC96; }

/* ──────────────────────────────────────────────────────────────────────
   Mobile sidebar backdrop
   El sidebar admin (z-index 100) cubre el botón hamburger del topbar
   en mobile. Cuando el sidebar está abierto en viewports ≤ 1024px,
   este backdrop se renderiza encima del contenido principal y permite
   cerrar el sidebar con un tap fuera de él.
   ──────────────────────────────────────────────────────────────────── */
.argym-admin-sidebar-backdrop {
    display: none;
}

@media (max-width: 1024px) {
    .argym-admin-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(20, 16, 12, 0.45);
        z-index: 90;          /* topbar=50 < backdrop=90 < sidebar=100 */
        cursor: pointer;
        animation: admin-backdrop-fade 150ms ease-out;
    }
}

@keyframes admin-backdrop-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Asegura que la página admin no se desborde horizontalmente en mobile.
   Ciertos componentes (data tables, charts) tienen ancho intrínseco
   mayor; aquí evitamos que estiren el viewport completo. */
@media (max-width: 767px) {
    .argym-page-content {
        overflow-x: hidden;
    }
    .argym-page-content > * {
        max-width: 100%;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   RESPONSIVE — App-side admin overrides
   Sits on top of Argym.Components' safety net. Target baseline:
   iPhone SE (375×667). Breakpoints used: 991, 768, 576, 414.
   ──────────────────────────────────────────────────────────────────── */

/* Default safety: no element pushes the viewport wider than itself */
html, body {
    overflow-x: hidden;
}

/* Long error trace / search dropdown text can wrap inside their containers,
   but admin TABLE cells (admin-order-number, admin-order-customer) are
   excluded — narrow table columns would break those into single-character
   vertical columns. Tables get horizontal scroll instead. */
.error-log-trace {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.smart-search-item-title,
.smart-search-item-sub {
    overflow-wrap: anywhere;
    word-break: normal;
}
.admin-order-number,
.admin-order-customer {
    white-space: nowrap;
}

/* ────────── Admin Home / Dashboard ────────── */
@media (max-width: 991px) {
    .argym-charts-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .argym-dashboard-layout {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 576px) {
    .argym-bar-chart {
        gap: 0.25rem;
    }
    .argym-bar-label {
        font-size: 0.65rem;
    }
    .argym-donut-legend-item {
        font-size: 0.75rem;
    }
}

/* ────────── Admin Orders + Order Detail ────────── */
@media (max-width: 768px) {
    .admin-order-header,
    .admin-order-info,
    .admin-order-customer,
    .order-detail-customer-row,
    .order-detail-id-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    .admin-order-items,
    .order-detail-items-list {
        gap: 0.75rem;
    }
    .order-detail-item,
    .admin-order-item {
        flex-wrap: wrap;
    }
    .order-detail-item-img,
    .admin-order-item-img {
        width: 60px;
        height: 60px;
    }
    .order-detail-actions {
        flex-direction: column;
        width: 100%;
    }
    .order-detail-actions > * {
        width: 100%;
    }
}

/* ────────── Admin Filters / Tab strip ────────── */
@media (max-width: 768px) {
    .argym-filter-tab,
    .argym-filter-tabs {
        flex-wrap: wrap;
        gap: 0.375rem;
    }
}

/* ────────── POS — collapse the right rail under the products on narrow viewports ────────── */
@media (max-width: 1023px) {
    .pos-layout {
        grid-template-columns: 1fr;
    }
    .pos-cart {
        position: relative;       /* drop the sticky sidebar feel on tablet/phone */
        top: auto;
        max-height: none;
    }
}
@media (max-width: 575px) {
    .pos-cart-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info qty"
            "total remove";
        row-gap: 6px;
    }
    .pos-cart-row-info  { grid-area: info; }
    .pos-cart-row-qty   { grid-area: qty; }
    .pos-cart-row-total { grid-area: total; text-align: left; }
    .pos-cart-row-remove{ grid-area: remove; justify-self: end; }
    .pos-variant-matrix { grid-template-columns: 90px repeat(var(--cols, 1), minmax(0, 1fr)); }
}

/* ────────── Admin SmartSearch dropdown ────────── */
@media (max-width: 576px) {
    .smart-search-dropdown {
        max-height: 70vh;
    }
    .smart-search-item {
        padding: 0.5rem 0.75rem;
    }
    .smart-search-item-img {
        width: 36px;
        height: 36px;
    }
}

/* ────────── Stock alerts ────────── */
@media (max-width: 768px) {
    .stock-alert-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ────────── Reports / charts ────────── */
@media (max-width: 991px) {
    .reports-charts-grid,
    .reports-summary-row {
        grid-template-columns: 1fr;
    }
}

/* ────────── Discount code edit form ────────── */
@media (max-width: 576px) {
    .discount-date-row {
        grid-template-columns: 1fr;
    }
}

/* iPhone SE specific guards (≤ 414px) */
@media (max-width: 414px) {
    .argym-page-content {
        padding: 0.75rem;
    }
    .argym-card {
        padding: 0.875rem;
    }
    .argym-page-title {
        font-size: 1.25rem;
    }
}

/* ──────────────────────────────────────────────────────────────────────
   ORDER ACTION BUTTONS
   The footer row "price + action buttons" wraps on phone and the
   actions take the whole width below 576px so they don't squish.
   ──────────────────────────────────────────────────────────────────── */
.admin-order-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .admin-order-footer {
        align-items: stretch;
    }
    .admin-order-total {
        text-align: left;
    }
    .admin-order-actions {
        width: 100%;
        justify-content: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 576px) {
    .admin-order-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-order-actions > * {
        width: 100%;
    }
    /* When ArgymButton renders as <button>, force full-width text alignment */
    .admin-order-actions .argym-btn {
        width: 100%;
        justify-content: center;
    }
}

/* OrderDetail action row (same fix) */
@media (max-width: 576px) {
    .order-detail-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    .order-detail-actions > * {
        width: 100%;
    }
    .order-detail-actions .argym-btn {
        width: 100%;
        justify-content: center;
    }
}
