/* ── exakt Avon — Frontend Shortcode (Responsive) ───────────────────── */

/* ── Reset & base ─────────────────────────────────────────────────────── */
.ea-fe-wrap * {
    box-sizing: border-box;
}

.ea-fe-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #1a1a2e;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 12px 40px;
}

/* ── Header ────────────────────────────────────────────────────────────── */
.ea-fe-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 0 16px;
    border-bottom: 3px solid #e31e79;
    margin-bottom: 20px;
    position: relative;
}

.ea-fe-header h1 {
    margin: 8px 0 2px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.2;
}

.ea-fe-logo {
    max-height: 56px;
    max-width: 160px;
    object-fit: contain;
}

.ea-fe-subhead {
    font-size: 12px;
    color: #888;
    letter-spacing: 0.5px;
}

.ea-fe-back {
    position: absolute;
    left: 0;
    top: 28px;
    font-size: 14px;
    color: #e31e79;
    text-decoration: none;
    font-weight: 600;
}

.ea-fe-back:hover { text-decoration: underline; }

/* ── Card ──────────────────────────────────────────────────────────────── */
.ea-fe-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ea-fe-card-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e31e79;
    margin-bottom: 14px;
}

/* ── Notice ────────────────────────────────────────────────────────────── */
.ea-fe-notice,
.ea-fe-empty {
    color: #888;
    font-size: 14px;
    text-align: center;
    padding: 12px 0;
}

/* ── Form ──────────────────────────────────────────────────────────────── */
.ea-fe-label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 12px;
    gap: 5px;
}

.ea-fe-input {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 7px;
    font-size: 15px;
    width: 100%;
    background: #fafafa;
    color: #1a1a2e;
    -webkit-appearance: none;
    appearance: none;
}

.ea-fe-input:focus {
    outline: none;
    border-color: #e31e79;
    background: #fff;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.ea-fe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.ea-fe-btn:active { transform: scale(0.97); }

.ea-fe-btn-primary {
    background: #e31e79;
    color: #fff;
    width: 100%;
    margin-top: 4px;
    font-size: 15px;
    padding: 13px;
}

.ea-fe-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.ea-fe-btn-outline {
    background: #fff;
    color: #1a1a2e;
    border: 1.5px solid #ccc;
    padding: 9px 14px;
}

.ea-fe-btn-outline:hover { border-color: #e31e79; color: #e31e79; }

.ea-fe-btn-wa {
    background: #25D366;
    color: #fff;
    padding: 9px 16px;
}

.ea-fe-btn-wa:disabled { opacity: 0.6; }

/* ── Upload result ─────────────────────────────────────────────────────── */
#ea-fe-upload-result {
    margin-top: 10px;
    font-size: 14px;
    border-radius: 6px;
}

.ea-fe-msg-ok  { color: #155724; background: #d4edda; padding: 10px 14px; border-radius: 6px; }
.ea-fe-msg-err { color: #721c24; background: #f8d7da; padding: 10px 14px; border-radius: 6px; }

/* ── Campaign list row ─────────────────────────────────────────────────── */
.ea-fe-campaign-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 4px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
}

.ea-fe-campaign-row:last-child { border-bottom: none; }
.ea-fe-campaign-row:hover, .ea-fe-campaign-row:active { background: #fdf0f7; }

.ea-fe-campaign-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ea-fe-campaign-info strong { font-size: 15px; color: #1a1a2e; }
.ea-fe-campaign-info span  { font-size: 13px; color: #888; }

.ea-fe-campaign-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ea-fe-badge {
    background: #e31e79;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 12px;
    padding: 2px 9px;
}

.ea-fe-chevron {
    font-size: 20px;
    color: #ccc;
    font-weight: 300;
}

/* ── Client list row ───────────────────────────────────────────────────── */
.ea-fe-client-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 8px;
}

.ea-fe-client-row:last-child { border-bottom: none; }

.ea-fe-client-info {
    flex: 1;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.ea-fe-client-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ea-fe-client-meta {
    display: flex;
    gap: 8px;
    margin-top: 2px;
    font-size: 12px;
}

.ea-fe-client-nr    { color: #888; }
.ea-fe-client-total { color: #e31e79; font-weight: 700; }

.ea-fe-client-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.ea-fe-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #e8e8e8;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.ea-fe-icon-btn:hover { border-color: #e31e79; }
.ea-fe-icon-btn:active { transform: scale(0.93); }
.ea-fe-icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ea-fe-wa-icon-btn {
    background: #25D366;
    border-color: #25D366;
    color: #fff;
}
.ea-fe-wa-icon-btn:hover { border-color: #128C7E; background: #128C7E; }
.ea-fe-wa-icon-btn svg { display: block; }

.ea-fe-btn-wa svg { vertical-align: middle; margin-right: 4px; }

/* ── Action bar (invoice view) ─────────────────────────────────────────── */
.ea-fe-action-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ea-fe-action-bar .ea-fe-btn {
    flex: 1;
    min-width: 100px;
}

/* ── Responsive grid: tablet ───────────────────────────────────────────── */
@media (min-width: 600px) {
    .ea-fe-wrap {
        padding: 0 24px 48px;
    }

    .ea-fe-header {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        text-align: left;
        gap: 16px;
        padding: 28px 0 20px;
    }

    .ea-fe-header h1 { font-size: 26px; }

    .ea-fe-back {
        position: static;
        margin-right: auto;
    }

    .ea-fe-card {
        padding: 22px 24px;
    }

    .ea-fe-btn-primary {
        width: auto;
        padding: 12px 28px;
    }

    .ea-fe-action-bar .ea-fe-btn {
        flex: 0 0 auto;
        min-width: 120px;
    }

    /* Two-column form on tablet+ */
    .ea-fe-form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
    }
}

/* ── Responsive grid: desktop ──────────────────────────────────────────── */
@media (min-width: 900px) {
    .ea-fe-wrap { padding: 0 0 56px; }
    .ea-fe-header h1 { font-size: 28px; }
    .ea-fe-logo { max-height: 64px; }
}

/* ── Edit invoice ─────────────────────────────────────────────────────────── */

.ea-fe-edit-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
}

.ea-fe-edit-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 16px;
    border-radius: 6px;
    border: 1px solid #eee;
}

.ea-fe-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 480px;
}

.ea-fe-edit-table thead tr {
    background: #1a1a2e;
    color: #fff;
}

.ea-fe-edit-table thead th {
    padding: 9px 8px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ea-fe-edit-table tbody tr { border-bottom: 1px solid #f0f0f0; }
.ea-fe-edit-table tbody tr:nth-child(even) { background: #fdf9fb; }

.ea-fe-edit-table td { padding: 5px 4px; vertical-align: middle; }

.ea-fe-et-col-code  { width: 100px; }
.ea-fe-et-col-qty   { width: 58px;  }
.ea-fe-et-col-price { width: 90px;  }
.ea-fe-et-col-del   { width: 40px;  }

.ea-fe-et-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 7px 8px;
    font-size: 13px;
    color: #1a1a2e;
    background: #fff;
    width: 100%;
    -webkit-appearance: none;
}
.ea-fe-et-input:focus { outline: none; border-color: #e31e79; box-shadow: 0 0 0 2px rgba(227,30,121,.1); }

.ea-fe-et-input-code  { font-family: monospace; }
.ea-fe-et-input-qty   { text-align: center; }
.ea-fe-et-input-price { text-align: right; }

.ea-fe-et-del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #a00;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.ea-fe-et-del-btn:hover { background: #fff0f0; border-color: #a00; }

.ea-fe-edit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ea-fe-msg-ok {
    margin-top: 12px;
    padding: 10px 14px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    color: #155724;
    font-size: 14px;
}

.ea-fe-msg-err {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8d7da;
    border: 1px solid #f1b0b7;
    border-radius: 6px;
    color: #721c24;
    font-size: 14px;
}

/* ── Print: hide all page chrome, show only the invoice ─────────────────── */
@media print {
    /* Hide everything on the page first */
    body * {
        visibility: hidden;
    }

    /* Then make the invoice and all its descendants visible */
    .avon-invoice,
    .avon-invoice * {
        visibility: visible;
    }

    /* Position the invoice at the top-left of the page */
    .avon-invoice {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        padding: 0;
        max-width: 100%;
    }

    /* Match PDF paper size */
    @page {
        size: A4 portrait;
        margin: 15mm 18mm;
    }
}

/* v1.0.17 — Client search row */
.ea-fe-client-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ea-fe-client-search .ea-fe-input { flex: 1 1 200px; }
