/* ================================================
   ANF COLOR PALETTE
   Paleta: Rosa medio + Azul medio + Gris (Slate)
   ================================================ */
:root {
    /* Rosa medio (acento principal) */
    --anf-rose: #c96b7e;
    --anf-rose-soft: #faf0f2;
    --anf-rose-border: #f0c4cc;
    --anf-rose-deep: #a85568;

    /* Azul medio (acento secundario) */
    --anf-blue: #5b8db8;
    --anf-blue-soft: #f0f5fb;
    --anf-blue-border: #b8d4ec;
    --anf-blue-deep: #3d6f96;

    /* Gris (base neutra - Slate) */
    --anf-gray-50: #f8fafc;
    --anf-gray-100: #f1f5f9;
    --anf-gray-200: #e2e8f0;
    --anf-gray-300: #cbd5e1;
    --anf-gray-400: #94a3b8;
    --anf-gray-500: #64748b;
    --anf-gray-600: #475569;
    --anf-gray-700: #334155;
    --anf-gray-800: #1e293b;
}

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

body {
    background: #eef0f3;
}

/* ================================================
   CardBase - estilo reusable para tarjetas/bloques
   ================================================ */
.card-base {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: none;
}

.card.card-base:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card-base + .card-base {
    margin-top: 0.75rem;
}

/* ================================================
   PRO SIDEBAR - Global Styles
   Based on BlazorProSidebar pattern
   ================================================ */

/* Bootstrap Icons base alignment fix */
.bi {
    display: inline-block;
    vertical-align: -0.125em;
    fill: currentColor;
    line-height: 1;
}

/* SIDEBAR STYLES MOVED TO NavMenu.razor.css FOR SCOPED ISOLATION */
/* All sidebar-specific styles are now in the scoped CSS file to avoid conflicts */

a, .btn-link {
    color: var(--anf-blue-deep);
}

.btn-primary {
    color: #fff;
    background-color: var(--anf-blue);
    border-color: var(--anf-blue-deep);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* REQ-SPFY-ASG-001 & REQ-SPFY-ASG-002: Chat Components Styles */
.transfer-cart-chat, .assignation-chat {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background-color: #fff;
}

.chat-messages {
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.chat-message {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-system {
    border-left: 3px solid #6c757d;
}

.message-user {
    border-left: 3px solid #0dcaf0;
}

.message-text {
    word-wrap: break-word;
    white-space: pre-wrap;
}

.chat-input .input-group {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Transfer Cart Actions Styles */
.transfer-cart-actions {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background-color: #fff;
}

.action-buttons .btn {
    min-width: 120px;
}

/* Dashboard Metrics Card Styles */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Urgency Indicators */
.text-danger.fw-bold {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Table Row Expand Transition */
.table-active {
    background-color: #e7f3ff !important;
}

/* Modal Improvements */
.modal.show {
    display: block;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .transfer-cart-chat, .assignation-chat {
        padding: 0.75rem;
    }

    .chat-messages {
        max-height: 300px !important;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* ================================================
   TABLET ACTION BUTTON SYSTEM
   Touch-friendly buttons for warehouse operations
   ================================================ */

/* Base Action Button */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-action:active {
    transform: scale(0.97);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.btn-action:disabled {
    opacity: 0.55;
    pointer-events: none;
    box-shadow: none;
}

/* Size Variants */
.btn-action-sm {
    min-height: 40px;
    padding: 0.375rem 0.875rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.btn-action-lg {
    min-height: 56px;
    padding: 0.875rem 1.75rem;
    border-radius: 14px;
    font-size: 1.05rem;
}

.btn-action-icon {
    min-height: 48px;
    min-width: 48px;
    width: 48px;
    padding: 0;
    border-radius: 12px;
    gap: 0;
}

.btn-action-icon.btn-action-sm {
    min-height: 40px;
    min-width: 40px;
    width: 40px;
    border-radius: 10px;
}

/* Color Variants - Gradients */
.btn-action-success {
    background: linear-gradient(135deg, #28a745, #218838);
    color: #fff;
}

.btn-action-success:hover {
    background: linear-gradient(135deg, #218838, #1e7e34);
    color: #fff;
    box-shadow: 0 4px 8px rgba(40,167,69,0.3);
}

.btn-action-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: #fff;
}

.btn-action-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    color: #fff;
    box-shadow: 0 4px 8px rgba(220,53,69,0.3);
}

.btn-action-primary {
    background: linear-gradient(135deg, var(--anf-blue), var(--anf-blue-deep));
    color: #fff;
}

.btn-action-primary:hover {
    background: linear-gradient(135deg, var(--anf-blue-deep), #345e82);
    color: #fff;
    box-shadow: 0 4px 8px rgba(91,141,184,0.3);
}

.btn-action-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-action-warning:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    color: #212529;
    box-shadow: 0 4px 8px rgba(255,193,7,0.3);
}

.btn-action-ghost {
    background: transparent;
    color: #6c757d;
    box-shadow: none;
    border: 1px solid #dee2e6;
}

.btn-action-ghost:hover {
    background: #f8f9fa;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.btn-action-ghost.active {
    background: #e9ecef;
    color: #212529;
    border-color: #adb5bd;
}

.btn-action-outline-primary {
    background: #fff;
    color: var(--anf-blue);
    border: 2px solid var(--anf-blue);
    box-shadow: none;
}

.btn-action-outline-primary:hover {
    background: var(--anf-blue);
    color: #fff;
    box-shadow: 0 4px 8px rgba(91,141,184,0.25);
}

.btn-action-outline-danger {
    background: #fff;
    color: #dc3545;
    border: 2px solid #dc3545;
    box-shadow: none;
}

.btn-action-outline-danger:hover {
    background: #dc3545;
    color: #fff;
    box-shadow: 0 4px 8px rgba(220,53,69,0.25);
}

/* Layout Helpers */
.action-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.action-btn-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* Input-group override for btn-action inside input-groups */
.input-group .btn-action {
    border-radius: 0 12px 12px 0;
    min-height: 38px;
    box-shadow: none;
}

/* ================================================
   TOAST FEEDBACK SYSTEM
   ================================================ */
.toast-feedback {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1090;
    min-width: 300px;
    max-width: 420px;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: toastSlideIn 0.35s ease-out;
}

.toast-feedback i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-feedback-success {
    background: linear-gradient(135deg, #28a745, #218838);
}

.toast-feedback-error {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.toast-feedback-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.toast-feedback-info {
    background: linear-gradient(135deg, #0dcaf0, #0bb5d8);
    color: #212529;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

/* ================================================
   CONFIRM DIALOG (replaces JS confirm)
   ================================================ */
.modal-confirm .modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.modal-confirm .modal-header {
    border-bottom: none;
    padding: 1.5rem 1.5rem 0.75rem;
}

.modal-confirm .modal-body {
    padding: 0.75rem 1.5rem 1rem;
    text-align: center;
}

.modal-confirm .modal-body .confirm-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.modal-confirm .modal-footer {
    border-top: none;
    padding: 0.75rem 1.5rem 1.5rem;
    justify-content: center;
    gap: 0.75rem;
}

/* ================================================
   TABLET RESPONSIVE OVERRIDES
   ================================================ */
@media (min-width: 768px) and (max-width: 1024px) {
    .btn-action {
        min-height: 52px;
        font-size: 1rem;
    }

    .btn-action-sm {
        min-height: 44px;
    }

    .btn-action-lg {
        min-height: 60px;
    }

    .btn-action-icon {
        min-height: 52px;
        min-width: 52px;
        width: 52px;
    }
}

@media (max-width: 576px) {
    .action-btn-group {
        flex-direction: column;
    }

    .action-btn-group .btn-action {
        width: 100%;
    }

    .action-btn-stack .btn-action {
        width: 100%;
    }

    .action-toolbar {
        flex-direction: column;
    }

    .action-toolbar .btn-action {
        width: 100%;
    }

    .toast-feedback {
        left: 1rem;
        right: 1rem;
        min-width: auto;
        bottom: 1rem;
    }
}

/* ================================================
   SHOPIFY ORDER NAME BADGE  (.order-id-badge)
   Identidad visual para SpfyOrder.Name /
   PkpAsg.ShopifyOrderName en todas las vistas.
   Usa paleta --anf-blue-* del tema.
   ================================================ */
.order-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.6rem;
    background: linear-gradient(135deg, var(--anf-blue-soft), #edf2f7);
    border: 1px solid var(--anf-blue-border);
    border-radius: 6px;
    font-family: 'Cascadia Code', 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--anf-blue-deep);
    letter-spacing: -0.02em;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
    line-height: 1.5;
}

a .order-id-badge,
tr:hover .order-id-badge,
.order-id-badge:hover {
    background: linear-gradient(135deg, #dce8f5, #d0e0f0);
    border-color: var(--anf-blue);
}

.order-id-badge-lg {
    padding: 0.3rem 0.85rem;
    font-size: 1.15rem;
    border-radius: 8px;
    gap: 0.4rem;
}

.order-id-badge i,
.order-id-badge .bi {
    color: var(--anf-blue);
    font-size: 0.85em;
    opacity: 0.8;
}

.order-id-badge-lg i,
.order-id-badge-lg .bi {
    font-size: 0.9em;
}

/* ================================================
   PAGE HEADER
   Patron consistente para encabezados de pagina
   ================================================ */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #f1f5f9;
}

.page-header-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0.25rem 0 0;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn,
    .page-header-actions .btn-action {
        flex: 1;
    }
}

/* ================================================
   IMPROVED TABLE STYLES
   Tablas mas limpias y modernas
   ================================================ */
.table-anf {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.table-anf thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.65rem 0.75rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.table-anf tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    font-size: 0.9rem;
}

.table-anf tbody tr {
    transition: background 0.1s ease;
}

.table-anf tbody tr:hover {
    background: #f8fafc;
}

.table-anf tbody tr:last-child td {
    border-bottom: none;
}

.table-anf tbody tr[style*="cursor: pointer"]:active {
    background: #f1f5f9;
}

/* ================================================
   IMPROVED LOADING STATE
   ================================================ */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.loading-state .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 0.2rem;
    color: #94a3b8;
}

.loading-state-text {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ================================================
   IMPROVED EMPTY STATE
   ================================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #94a3b8;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}

.empty-state-hint {
    font-size: 0.825rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

/* ================================================
   DETAIL CARD HEADER
   Header mejorado para vistas de detalle
   ================================================ */
.detail-card-header {
    background: #fff;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 0.75rem;
}

.detail-card-header-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.detail-card-header-sub {
    font-size: 0.825rem;
    color: #64748b;
    margin: 0.15rem 0 0;
}

/* ================================================
   STATUS BADGE REFINEMENT
   ================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ================================================
   INFO ROW (label: value pairs)
   ================================================ */
.info-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #334155;
}

.info-row-label {
    font-weight: 600;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-width: fit-content;
}

.info-row-value {
    font-weight: 500;
    color: #1e293b;
}

/* ================================================
   NOTIFICATION CARD
   Tarjetas de notificación con hover interactivo
   ================================================ */
.notification-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.notification-card:hover {
    transform: translateX(4px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.12) !important;
}
