/* ════════════════════════════════════════════════════════════
   Ietres × Factorial Admin — UI Premium
   ════════════════════════════════════════════════════════════ */

:root {
    /* Paleta refinada */
    --c-primary:        #0F1B36;
    --c-primary-soft:   #1d2c52;
    --c-primary-hover:  #182646;
    --c-accent:         #E94560;
    --c-success:        #1f7a3a;
    --c-success-soft:   #e8f5ec;
    --c-warning:        #b87a00;
    --c-warning-soft:   #fff8e6;
    --c-error:          #b3261e;
    --c-error-soft:     #fdecea;
    --c-bg:             #f4f6fa;
    --c-card:           #ffffff;
    --c-border:         #e5e8ef;
    --c-border-strong:  #d3d7e0;
    --c-text:           #1a1f2e;
    --c-text-muted:     #6b7280;
    --c-text-subtle:    #9aa1ad;

    /* Sombra suave en capas */
    --shadow-1: 0 1px 2px rgba(15,27,54,0.04), 0 1px 3px rgba(15,27,54,0.03);
    --shadow-2: 0 4px 12px rgba(15,27,54,0.05), 0 2px 4px rgba(15,27,54,0.04);
    --shadow-3: 0 12px 32px rgba(15,27,54,0.08), 0 4px 8px rgba(15,27,54,0.05);

    /* Border radius */
    --r-sm: 4px;
    --r-md: 6px;
    --r-lg: 10px;
    --r-xl: 14px;

    /* Transiciones */
    --t-fast: 0.12s cubic-bezier(.4,0,.2,1);
    --t-base: 0.2s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--c-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, Helvetica, sans-serif;
    color: var(--c-text);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.fop-page { background: var(--c-bg); min-height: 100vh; }
.fop-container { max-width: 1140px; margin: 0 auto; padding: 28px 20px 96px; }

/* === Header ============================================== */
.fop-header {
    background: var(--c-card);
    border-bottom: 1px solid var(--c-border);
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    box-shadow: var(--shadow-1);
}
.fop-header h1 {
    margin: 0;
    font-size: 17px;
    color: var(--c-primary);
    font-weight: 600;
    letter-spacing: -0.01em;
}
.fop-header-left { display: flex; align-items: center; gap: 14px; }
.fop-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
}
.fop-header-right a {
    color: var(--c-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--t-fast);
}
.fop-header-right a:hover { color: var(--c-accent); }
.fop-user { color: var(--c-text-muted); font-size: 13px; }
.fop-logout { color: var(--c-error) !important; }
.fop-logout:hover { color: #8c1d17 !important; }

.fop-role-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.fop-role-factorial { background: #fce4ec; color: #ad1457; }
.fop-role-ietres    { background: #e3f2fd; color: #0d47a1; }

/* === Intro ============================================== */
.fop-intro {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-left: 3px solid var(--c-primary);
    padding: 16px 20px;
    margin-bottom: 22px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-1);
}
.fop-intro p { margin: 0; font-size: 14px; color: var(--c-text); }
.fop-intro p + p { margin-top: 10px; }
.fop-intro-shipping {
    padding: 12px 14px;
    background: var(--c-warning-soft);
    border-left: 3px solid var(--c-warning);
    border-radius: var(--r-sm);
    font-size: 13px;
    color: #6c5d2e;
}
.fop-intro-shipping strong { color: #856404; }

/* === Cards ============================================== */
.fop-card {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 24px 26px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-1);
    transition: box-shadow var(--t-base);
}
.fop-card:hover { box-shadow: var(--shadow-2); }

.fop-card legend {
    font-weight: 700;
    color: var(--c-primary);
    padding: 4px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: var(--c-primary);
    color: white;
    border: none;
    border-radius: 100px;
}

.fop-section-help {
    color: var(--c-text-muted);
    font-size: 13px;
    margin: 14px 0 18px;
    line-height: 1.55;
}
.fop-section-help code {
    background: var(--c-bg);
    padding: 2px 7px;
    border-radius: var(--r-sm);
    font-size: 12px;
    color: var(--c-primary);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.fop-subhead {
    font-size: 12px;
    font-weight: 700;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 22px 0 12px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
}

/* === Form ============================================== */
.fop-form { display: flex; flex-direction: column; gap: 14px; }
.fop-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 10px;
}
.fop-row.fop-row-3 { grid-template-columns: repeat(3, 1fr); }
.fop-row:last-child { margin-bottom: 0; }

.fop-field { display: flex; flex-direction: column; }
.fop-field-wide { grid-column: 1 / -1; }

.fop-field label {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--c-text);
    letter-spacing: -0.005em;
}

.fop-field input,
.fop-field select,
.fop-field textarea {
    padding: 10px 13px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    font-size: 14px;
    background: white;
    color: var(--c-text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    font-family: inherit;
}
.fop-field input::placeholder { color: var(--c-text-subtle); }
.fop-field input:focus,
.fop-field select:focus,
.fop-field textarea:focus {
    outline: none;
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(15,27,54,0.10);
}
.fop-field input:disabled,
.fop-field select:disabled {
    background: var(--c-bg);
    color: var(--c-text-muted);
    cursor: not-allowed;
}

.fop-field small {
    color: var(--c-text-muted);
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.45;
}
.fop-field-actions {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

/* === Buttons =========================================== */
.fop-btn {
    padding: 10px 20px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: white;
    color: var(--c-text);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
    font-family: inherit;
}
.fop-btn:hover {
    border-color: var(--c-primary);
    color: var(--c-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-1);
}
.fop-btn:active { transform: translateY(0); }

.fop-btn-primary {
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
    box-shadow: var(--shadow-1);
}
.fop-btn-primary:hover {
    background: var(--c-primary-hover);
    border-color: var(--c-primary-hover);
    color: white;
    box-shadow: var(--shadow-2);
}
.fop-btn-block { display: block; width: 100%; padding: 12px; font-size: 15px; }
.fop-btn-create { padding: 12px 26px; font-size: 15px; font-weight: 600; }
.fop-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.fop-btn-link {
    background: transparent;
    border-color: transparent;
    color: var(--c-text-muted);
    padding: 10px 14px;
}
.fop-btn-link:hover {
    color: var(--c-primary);
    border-color: transparent;
    text-decoration: underline;
    box-shadow: none;
    transform: none;
}
.fop-btn-flash {
    background: var(--c-success) !important;
    color: white !important;
    border-color: var(--c-success) !important;
}

/* === Search productos ================================== */
.fop-search-wrapper { position: relative; }

#fop-product-search {
    padding: 13px 16px;
    font-size: 14px;
    width: 100%;
    border-radius: var(--r-md);
}

.fop-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    list-style: none;
    margin: 0;
    padding: 4px;
    max-height: 380px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-3);
    display: none;
}
.fop-search-results.fop-active { display: block; }
.fop-search-results li {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: background var(--t-fast);
}
.fop-search-results li:hover { background: var(--c-bg); }

.fop-search-result-name {
    font-weight: 500;
    color: var(--c-text);
    margin-bottom: 4px;
    line-height: 1.35;
}
.fop-search-result-meta {
    font-size: 12px;
    color: var(--c-text-muted);
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.fop-search-result-meta strong {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--c-primary);
    font-size: 11px;
    background: var(--c-bg);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    font-weight: 600;
}
.fop-search-result-price {
    color: var(--c-success);
    font-weight: 600;
    margin-left: auto;
}
.fop-search-empty {
    color: var(--c-text-muted);
    font-style: italic;
    cursor: default !important;
    text-align: center;
    padding: 20px !important;
}
.fop-search-empty:hover { background: white !important; }

/* === Items ============================================= */
.fop-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.fop-item {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 1.6fr 90px 130px 120px 36px;
    gap: 14px;
    align-items: end;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.fop-item:hover {
    border-color: var(--c-border-strong);
    box-shadow: var(--shadow-1);
}

.fop-item-info { font-size: 14px; align-self: center; }
.fop-item-name { font-weight: 500; margin-bottom: 5px; line-height: 1.35; }
.fop-item-sku {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--c-primary);
    background: var(--c-bg);
    padding: 1px 7px;
    border-radius: var(--r-sm);
    display: inline-block;
    font-weight: 600;
}
.fop-item-price-info { font-size: 12px; color: var(--c-text-muted); margin-top: 6px; }

.fop-item-field { display: flex; flex-direction: column; }
.fop-item-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.fop-item-field input {
    padding: 8px 11px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-sm);
    font-size: 13px;
}

.fop-item-line-total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.fop-item-line-total label {
    font-size: 11px;
    font-weight: 600;
    color: var(--c-text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.fop-item-line-total strong {
    font-size: 16px;
    color: var(--c-primary);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.fop-item-remove {
    background: transparent;
    border: 1px solid var(--c-border-strong);
    color: var(--c-error);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    line-height: 1;
    align-self: center;
    transition: all var(--t-fast);
}
.fop-item-remove:hover {
    background: var(--c-error);
    color: white;
    border-color: var(--c-error);
}

.fop-empty-items {
    text-align: center;
    color: var(--c-text-muted);
    padding: 32px 24px;
    font-style: italic;
    background: var(--c-bg);
    border: 1px dashed var(--c-border-strong);
    border-radius: var(--r-md);
    margin-top: 18px;
}

/* === Margin bar (3%) =================================== */
.fop-margin-bar {
    margin-top: 20px;
    padding: 15px 18px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border: 1px solid #f5d76e;
    border-radius: var(--r-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}
.fop-margin-info { flex: 1; min-width: 250px; }
.fop-margin-info strong {
    display: block;
    color: #6b4f00;
    font-size: 14px;
    margin-bottom: 3px;
    font-weight: 700;
}
.fop-margin-info span { color: #8a6f1c; font-size: 12px; line-height: 1.4; }
.fop-margin-actions { display: flex; gap: 8px; }
.fop-btn-margin {
    background: var(--c-warning);
    color: white;
    border-color: var(--c-warning);
    font-weight: 600;
}
.fop-btn-margin:hover {
    background: #946100;
    color: white;
    border-color: #946100;
}

/* === Summary =========================================== */
.fop-summary {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: sticky;
    bottom: 18px;
    box-shadow: var(--shadow-3);
    margin-top: 18px;
}
.fop-totals { display: flex; flex-direction: column; gap: 4px; min-width: 260px; }
.fop-total-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    font-size: 13px;
    color: var(--c-text-muted);
}
.fop-total-line.fop-total-final {
    font-size: 18px;
    color: var(--c-primary);
    font-weight: 700;
    padding-top: 8px;
    border-top: 1px solid var(--c-border);
    margin-top: 4px;
    letter-spacing: -0.01em;
}
.fop-actions { display: flex; gap: 10px; }

/* === Errores / Success ================================= */
.fop-error {
    background: var(--c-error-soft);
    color: var(--c-error);
    padding: 14px 16px;
    border-radius: var(--r-md);
    margin-top: 14px;
    font-size: 14px;
    border-left: 3px solid var(--c-error);
    white-space: pre-wrap;
    line-height: 1.5;
}

.fop-success-card {
    background: var(--c-card);
    border: 1px solid var(--c-success);
    border-radius: var(--r-lg);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-2);
}
.fop-success-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--c-success);
    color: white;
    font-size: 38px;
    line-height: 72px;
    margin: 0 auto 18px;
    box-shadow: 0 6px 16px rgba(31,122,58,0.25);
}
.fop-success-card h2 {
    color: var(--c-success);
    margin: 0 0 24px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.fop-success-card dl {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 11px 22px;
    max-width: 560px;
    margin: 0 auto 18px;
    text-align: left;
}
.fop-success-card dt {
    color: var(--c-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 2px;
    font-weight: 600;
}
.fop-success-card dd { margin: 0; font-weight: 500; font-size: 14px; }
.fop-dt-total {
    font-weight: 700 !important;
    color: var(--c-primary) !important;
    font-size: 13px !important;
    padding-top: 12px !important;
    border-top: 2px solid var(--c-border);
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
}
.fop-dd-total {
    font-weight: 700 !important;
    color: var(--c-primary);
    font-size: 19px !important;
    padding-top: 12px !important;
    border-top: 2px solid var(--c-border);
    letter-spacing: -0.01em;
}
.fop-shipping-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: var(--c-primary);
    color: white;
    border-radius: 100px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    vertical-align: middle;
}
.fop-success-note {
    color: var(--c-text-muted);
    font-size: 13px;
    margin: 18px auto 0;
    max-width: 480px;
    line-height: 1.6;
}
.fop-success-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

/* === Login ============================================== */
.fop-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at top, rgba(233,69,96,0.08), transparent 50%),
        linear-gradient(135deg, #0F1B36 0%, #1d2c52 100%);
}
.fop-login-card {
    background: white;
    border-radius: var(--r-xl);
    padding: 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
}
.fop-login-header { text-align: center; margin-bottom: 32px; }
.fop-login-header h1 {
    margin: 0;
    color: var(--c-primary);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.fop-login-header p {
    color: var(--c-text-muted);
    margin: 6px 0 0;
    font-size: 13px;
}
.fop-login-form .fop-field { margin-bottom: 18px; }
.fop-login-help {
    text-align: center;
    color: var(--c-text-muted);
    font-size: 12px;
    margin-top: 26px;
}
.fop-login-help a { color: var(--c-primary); font-weight: 500; }

/* === History (table) ==================================== */
.fop-filters { padding: 18px 22px !important; margin-bottom: 18px !important; }
.fop-results {
    background: var(--c-card);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-1);
}
.fop-loading {
    padding: 40px;
    text-align: center;
    color: var(--c-text-muted);
    font-style: italic;
}
.fop-table { width: 100%; border-collapse: collapse; }
.fop-table th,
.fop-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--c-border);
}
.fop-table th {
    background: var(--c-bg);
    font-weight: 700;
    color: var(--c-text);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.fop-table tr:last-child td { border-bottom: none; }
.fop-table tr:hover td { background: #fafbfc; }
.fop-table .fop-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--c-primary);
}
.fop-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.fop-status-pending { background: var(--c-warning-soft); color: var(--c-warning); }
.fop-status-paid    { background: var(--c-success-soft); color: var(--c-success); }
.fop-status-failed  { background: var(--c-error-soft);   color: var(--c-error); }
.fop-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 18px;
}

/* === Responsive ========================================= */
@media (max-width: 768px) {
    .fop-row, .fop-row.fop-row-3 { grid-template-columns: 1fr; }
    .fop-item { grid-template-columns: 1fr; gap: 8px; }
    .fop-item-line-total { align-items: flex-start; }
    .fop-success-card dl { grid-template-columns: 1fr; }
    .fop-table { font-size: 12px; }
    .fop-table th, .fop-table td { padding: 8px 10px; }
    .fop-summary { flex-direction: column; align-items: stretch; }
    .fop-totals { min-width: 0; }
    .fop-card { padding: 18px; }
}

/* === Brand logos en header ============================== */
.fop-brands {
    display: flex;
    align-items: center;
    gap: 14px;
}
.fop-logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}
.fop-logo-ietres { height: 26px; }
.fop-logo-factorial { height: 22px; }
.fop-brands-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: var(--c-border-strong);
}

/* Login: logos centrados y un poco mas grandes */
.fop-brands-login {
    justify-content: center;
    margin-bottom: 14px;
    gap: 16px;
}
.fop-brands-login .fop-logo-ietres { height: 32px; }
.fop-brands-login .fop-logo-factorial { height: 28px; }
.fop-brands-login .fop-brands-divider { height: 28px; }

/* === Page title (debajo header, dentro container) ======= */
.fop-page-title {
    margin: 0 0 22px 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--c-primary);
    letter-spacing: -0.02em;
}

/* === Boton + Nuevo pedido (header del historial) ======== */
/*
 * El botón <a class="fop-btn fop-btn-primary"> en el header tenia
 * problemas de contraste. Forzamos color blanco aqui de forma
 * explicita para garantizar legibilidad.
 */
.fop-btn.fop-btn-primary,
a.fop-btn.fop-btn-primary,
.fop-header-right a.fop-btn-primary {
    background: var(--c-primary) !important;
    color: white !important;
    border-color: var(--c-primary) !important;
    text-decoration: none;
    font-weight: 600;
}
.fop-btn.fop-btn-primary:hover,
a.fop-btn.fop-btn-primary:hover,
.fop-header-right a.fop-btn-primary:hover {
    background: var(--c-primary-hover) !important;
    color: white !important;
    border-color: var(--c-primary-hover) !important;
}
.fop-btn-new {
    padding: 9px 16px !important;
    font-size: 13px !important;
}

/* === Order link en historial ============================ */
.fop-order-link {
    color: var(--c-primary);
    text-decoration: none;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    background: var(--c-bg);
    border-radius: var(--r-sm);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all var(--t-fast);
    white-space: nowrap;
}
.fop-order-link:hover {
    background: var(--c-primary);
    color: white;
}
.fop-order-arrow {
    font-size: 10px;
    opacity: 0.7;
}

/* === Numeric column en tabla ============================ */
.fop-table .fop-numeric,
.fop-table th.fop-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* === Esconder badge "ietres" en historial =================
 * El operador ietres es interno; mostrar su username como
 * pill en cada fila no aporta nada y ensucia visualmente.
 * Solo mostramos el badge cuando es factorial (rol externo).
 */
.fop-role-badge.fop-role-ietres {
    display: none;
}

/* === Nuevos estilos de estado (state de Magento) =========== */
.fop-status-processing { background: #e3f2fd; color: #0d47a1; }
.fop-status-complete   { background: var(--c-success-soft); color: var(--c-success); font-weight: 700; }
.fop-status-closed     { background: #eceff1; color: #455a64; }

/* === Pill "pagado" =========================================
 * Pequeña indicacion visual cuando el total_paid del pedido
 * coincide con el grand_total. Util para el operador que ojea
 * el listado y quiere saber rapido si se cobro.
 */
.fop-paid-pill {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 7px;
    background: var(--c-success);
    color: white;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* === Stock badges en buscador =========================== */
.fop-stock-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}
.fop-stock-ok   { background: var(--c-success-soft); color: var(--c-success); }
.fop-stock-low  { background: #fff3e0; color: #e65100; }
.fop-stock-out  { background: var(--c-error-soft); color: var(--c-error); }

/* Resultado deshabilitado (sin stock) en buscador */
.fop-search-result-disabled {
    opacity: 0.55;
    cursor: not-allowed !important;
}
.fop-search-result-disabled .fop-search-result-name {
    text-decoration: line-through;
    color: var(--c-text-muted);
}
.fop-search-result-disabled:hover {
    background: var(--c-error-soft) !important;
}

/* === Warning de cantidad excede stock en items =========== */
.fop-item-warning {
    margin-top: 6px;
    padding: 4px 10px;
    background: var(--c-error-soft);
    color: var(--c-error);
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

/* === Operator badge en historial =========================
 * Clase distinta a .fop-role-badge porque esa esta oculta
 * en el header para el operador "ietres". En el historial
 * SI queremos ver siempre el operador.
 */
.fop-op-badge {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
}
.fop-op-factorial { background: #fce4ec; color: #ad1457; }
.fop-op-ietres    { background: #e3f2fd; color: #0d47a1; }
