/* ==========================================================================
   PAINEL ADMINISTRATIVO - GESTÃO DE CUPONS DE DESCONTO (adminCoupons.css)
   Orderly Coupons Architecture - Mobile-First & Desktop Grid
   ========================================================================== */

/* 1. MÉTRICAS RÁPIDAS DOS CUPONS */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin-bottom: 1.15rem;
    width: 100%;
}

@media (min-width: 680px) {
    .admin-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.85rem;
    }
}

.admin-stat-card {
    background: #f8fafc;
    border: 1.5px solid var(--color-border);
    border-radius: 14px;
    padding: 0.75rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    box-sizing: border-box;
    min-width: 0;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.stat-label {
    font-size: 0.68rem;
    color: var(--color-text-secondary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--color-primary-dark);
    line-height: 1.2;
}

/* 2. BARRA DE AÇÕES (NOVO CUPOM & BUSCA) */
.admin-actions-bar {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.15rem;
    width: 100%;
}

@media (min-width: 680px) {
    .admin-actions-bar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.btn-create-product {
    width: 100%;
    height: 44px;
    background: var(--color-primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.92rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
    white-space: nowrap;
}

@media (min-width: 680px) {
    .btn-create-product {
        width: auto;
        padding: 0 1.5rem;
    }
}

.btn-create-product:hover {
    background: var(--color-primary-gradient-hover);
    transform: translateY(-1px);
}

.admin-search-box {
    position: relative;
    width: 100%;
}

@media (min-width: 680px) {
    .admin-search-box {
        max-width: 320px;
    }
}

.search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    color: #94a3b8;
    pointer-events: none;
}

.admin-search-input {
    width: 100%;
    padding: 0.65rem 0.9rem 0.65rem 2.4rem;
    border: 1.5px solid var(--color-border);
    border-radius: 12px;
    font-size: 0.88rem;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.admin-search-input:focus {
    border-color: var(--color-primary);
}

/* 3. CHIPS DE FILTRO RÁPIDO DE CUPONS */
.coupons-filter-chips {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-bottom: 1.15rem;
    width: 100%;
}

.coupons-filter-chips::-webkit-scrollbar {
    display: none;
}

.coupons-chip {
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1.5px solid var(--color-border);
    background: #ffffff;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-text-secondary);
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.coupons-chip:hover {
    border-color: var(--color-primary);
    color: var(--color-primary-dark);
}

.coupons-chip.active {
    background: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* 4. GRID DE CARDS DE CUPONS */
.admin-coupons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    width: 100%;
    align-items: start;
}

@media (min-width: 640px) {
    .admin-coupons-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1024px) {
    .admin-coupons-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.15rem;
    }
}

/* 5. CARD INDIVIDUAL DE CUPOM */
.coupon-admin-card {
    background: #ffffff;
    border: 1.5px solid var(--color-border);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    box-shadow: var(--shadow-xs);
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    box-sizing: border-box;
    width: 100%;
}

.coupon-admin-card:hover {
    transform: translateY(-2px);
    border-color: #fed7aa;
    box-shadow: var(--shadow-md);
}

.coupon-admin-card.inactive {
    background: #f8fafc;
    border-style: dashed;
    opacity: 0.8;
}

/* Cabeçalho do Card: Código & Switch */
.coupon-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.coupon-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff7ed;
    color: #c2410c;
    border: 1.5px dashed #f97316;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease;
}

.coupon-code-pill:hover {
    background: #ffedd5;
}

.coupon-status-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.coupon-status-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #16a34a;
}

.coupon-admin-card.inactive .coupon-status-label {
    color: #94a3b8;
}

/* Tags de Benefício */
.coupon-benefit-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.coupon-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.22rem 0.6rem;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 800;
}

.coupon-type-tag.percent {
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.coupon-type-tag.fixed {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.coupon-type-tag.shipping {
    background: #fef9c3;
    color: #a16207;
    border: 1px solid #fef08a;
}

.coupon-type-tag.combo {
    background: #f3e8ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.coupon-type-tag.gift {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #fbcfe8;
}

.coupon-card-description {
    font-size: 0.84rem;
    color: var(--color-text-secondary);
    line-height: 1.35;
    margin: 0;
}

/* Metadados (Mínimo e Usos) */
.coupon-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--color-border);
}

.coupon-meta-item {
    display: flex;
    flex-direction: column;
}

.coupon-meta-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-text-secondary);
}

.coupon-meta-value {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-top: 1px;
}

/* Ações do Card (Editar / Excluir) */
.coupon-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 0.45rem;
    border-top: 1px solid var(--color-border);
}

.btn-coupon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.65rem;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.btn-coupon-action.edit {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}

.btn-coupon-action.edit:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-coupon-action.delete {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}

.btn-coupon-action.delete:hover {
    background: #fee2e2;
    color: #b91c1c;
}

/* 6. SWITCH TOGGLE (ATIVAR / DESATIVAR) */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.switch-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 20px;
}

.switch-toggle .slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .25s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch-toggle input:checked + .slider {
    background-color: #16a34a;
}

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

/* 7. ESTILOS DE FORMULÁRIO DO MODAL DE CUPOM */
.form-control.uppercase {
    text-transform: uppercase;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
}
