/**
 * eTenders WhatsApp - Public/Frontend Styles
 * Modern WhatsApp-inspired design
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================
   CSS VARIABLES
   ========================================== */
:root {
    --etw-primary: #8e9100;
    --etw-primary-dark: #747600;
    --etw-primary-light: #e6e6c6;
    --etw-primary-bg: #f5f6ea;
    --etw-secondary: #636500;
    --etw-accent: #474800;
    --etw-danger: #dc3545;
    --etw-danger-light: #f8d7da;
    --etw-text: #1a1a2e;
    --etw-text-secondary: #6c757d;
    --etw-border: #e2e8f0;
    --etw-bg: #f8fafc;
    --etw-white: #ffffff;
    --etw-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --etw-shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --etw-shadow-lg: 0 10px 40px rgba(0,0,0,0.15);
    --etw-radius-sm: 6px;
    --etw-radius-md: 10px;
    --etw-radius-lg: 16px;
    --etw-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   SIGNUP WRAPPER
   ========================================== */
.etw-signup-wrapper {
    max-width: 620px;
    margin: 30px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--etw-text);
}

/* ==========================================
   HEADER
   ========================================== */
.etw-signup-header {
    text-align: center;
    margin-bottom: 32px;
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--etw-accent), var(--etw-secondary), var(--etw-primary));
    border-radius: var(--etw-radius-lg);
    color: var(--etw-white);
    position: relative;
    overflow: hidden;
}

.etw-signup-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.etw-signup-header::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 160px;
    height: 160px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.etw-signup-title {
    font-size: 1.7em;
    font-weight: 800;
    color: var(--etw-white);
    margin: 0 0 10px 0;
    position: relative;
    z-index: 1;
}

.etw-signup-description {
    font-size: 0.95em;
    color: rgba(255,255,255,0.9);
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* ==========================================
   FORM
   ========================================== */
.etw-signup-form {
    background: var(--etw-white);
    border: 1px solid var(--etw-border);
    border-radius: var(--etw-radius-lg);
    padding: 32px;
    box-shadow: var(--etw-shadow-md);
}

/* ==========================================
   FORM GROUP
   ========================================== */
.etw-form-group {
    margin-bottom: 24px;
}

.etw-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--etw-text);
}

.etw-required {
    color: var(--etw-danger);
}

/* ==========================================
   INPUTS
   ========================================== */
.etw-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--etw-border);
    border-radius: var(--etw-radius-sm);
    font-size: 15px;
    transition: var(--etw-transition);
    box-sizing: border-box;
    outline: none;
    background: var(--etw-white);
    color: var(--etw-text);
}

.etw-input:focus {
    border-color: var(--etw-primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.etw-input::placeholder {
    color: #aaa;
}

/* Phone Input */
.etw-phone-input {
    display: flex;
    align-items: center;
    border: 2px solid var(--etw-border);
    border-radius: var(--etw-radius-sm);
    overflow: hidden;
    transition: var(--etw-transition);
}

.etw-phone-input:focus-within {
    border-color: var(--etw-primary);
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
}

.etw-phone-prefix {
    padding: 12px 14px;
    background: var(--etw-primary-bg);
    border-right: 2px solid var(--etw-border);
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    color: var(--etw-accent);
}

.etw-phone-input .etw-input {
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.etw-phone-input .etw-input:focus {
    box-shadow: none;
}

.etw-help-text {
    display: block;
    margin-top: 6px;
    font-size: 0.8em;
    color: var(--etw-text-secondary);
}

/* ==========================================
   CATEGORIES GRID
   ========================================== */
/* ==========================================
   CATEGORY CARD PICKER
   ========================================== */
.etw-cats-help {
    margin-top: 4px;
    margin-bottom: 12px;
}

.etw-cat-selection-bar {
    font-size: 0.85em;
    color: var(--etw-text-secondary);
    background: var(--etw-bg);
    border: 1px solid var(--etw-border);
    border-radius: var(--etw-radius-sm);
    padding: 8px 14px;
    margin-bottom: 14px;
    min-height: 36px;
    line-height: 1.5;
    transition: var(--etw-transition);
}

.etw-cat-selection-bar.has-selection {
    border-color: var(--etw-primary);
    color: var(--etw-accent);
    font-weight: 600;
}

.etw-category-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.etw-cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 6px 8px;
    background: var(--etw-white);
    border: 2px solid var(--etw-border);
    border-radius: var(--etw-radius-md);
    cursor: pointer;
    transition: var(--etw-transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 68px;
}

.etw-cat-card:hover {
    border-color: var(--etw-primary);
    background: var(--etw-primary-bg);
}

.etw-cat-card.etw-cat-selected {
    background: var(--etw-primary-bg);
    border-color: var(--etw-primary);
    border-width: 2px;
}

.etw-cat-checkbox {
    display: none;
}

/* Checkmark icon — hidden until selected */
.etw-cat-check-icon {
    display: none;
    position: absolute;
    top: 5px;
    right: 6px;
    width: 15px;
    height: 15px;
    background: var(--etw-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 9px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.etw-cat-card.etw-cat-selected .etw-cat-check-icon {
    display: block;
}

/* Emoji — visible until selected */
.etw-cat-emoji {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 5px;
    display: block;
    transition: var(--etw-transition);
}

.etw-cat-card.etw-cat-selected .etw-cat-emoji {
    font-size: 16px;
    margin-bottom: 4px;
}

.etw-cat-name {
    font-size: 0.7em;
    color: var(--etw-text);
    line-height: 1.2;
    word-break: break-word;
    transition: var(--etw-transition);
}

.etw-cat-card.etw-cat-selected .etw-cat-name {
    color: var(--etw-accent);
    font-weight: 600;
}

/* ==========================================
   SUBMIT BUTTON
   ========================================== */
.etw-submit-group {
    margin-top: 28px;
}

.etw-submit-btn {
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--etw-primary), var(--etw-secondary));
    color: #fff;
    border: none;
    border-radius: var(--etw-radius-sm);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--etw-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.etw-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.etw-submit-btn:hover {
    background: linear-gradient(135deg, var(--etw-primary-dark), var(--etw-accent));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
}

.etw-submit-btn:hover::before {
    left: 100%;
}

.etw-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.25);
}

.etw-submit-btn:disabled {
    background: #a0d9b5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.etw-submit-btn:disabled::before {
    display: none;
}

/* Spinner */
.etw-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: etw-spin 0.6s linear infinite;
}

@keyframes etw-spin {
    to { transform: rotate(360deg); }
}

/* ==========================================
   SUCCESS MESSAGE
   ========================================== */
.etw-success-message {
    background: var(--etw-white);
    border: 2px solid var(--etw-primary);
    border-radius: var(--etw-radius-lg);
    padding: 36px;
    text-align: center;
    box-shadow: var(--etw-shadow-md);
    animation: etw-fadeInUp 0.4s ease;
}

@keyframes etw-fadeInUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.etw-success-icon {
    font-size: 3.5em;
    margin-bottom: 14px;
    display: block;
}

.etw-success-title {
    font-size: 1.3em;
    color: var(--etw-primary-dark);
    margin: 0 0 24px 0;
    font-weight: 700;
}

/* Group Links */
.etw-group-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
}

.etw-group-link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--etw-primary-bg);
    border: 1px solid var(--etw-primary-light);
    border-radius: var(--etw-radius-md);
    transition: var(--etw-transition);
}

.etw-group-link-item:hover {
    background: #e2f5e9;
    transform: translateX(4px);
    box-shadow: var(--etw-shadow-sm);
}

.etw-group-link-info {
    text-align: left;
}

.etw-group-link-name {
    font-weight: 700;
    color: var(--etw-text);
    display: block;
    font-size: 0.95em;
}

.etw-group-link-category {
    font-size: 0.82em;
    color: var(--etw-text-secondary);
    margin-top: 2px;
}

.etw-join-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--etw-primary), var(--etw-secondary));
    color: #fff !important;
    text-decoration: none !important;
    border-radius: var(--etw-radius-sm);
    font-weight: 700;
    font-size: 0.9em;
    transition: var(--etw-transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.etw-join-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.etw-join-btn:hover {
    background: linear-gradient(135deg, var(--etw-primary-dark), var(--etw-accent));
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.etw-join-btn:hover::before {
    left: 100%;
}

/* ==========================================
   ERROR TOAST NOTIFICATION
   ========================================== */
.etw-error-message {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 99999;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 14px;
    box-shadow:
        0 4px 6px rgba(0,0,0,0.04),
        0 12px 40px rgba(220, 53, 69, 0.18),
        0 0 0 1px rgba(220, 53, 69, 0.1);
    overflow: hidden;
    /* Always in the DOM, slid off-screen when hidden */
    display: block !important;
    pointer-events: none;
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition:
        transform 0.48s cubic-bezier(0.34, 1.52, 0.64, 1),
        opacity   0.3s  ease;
}

.etw-error-message.etw-toast-visible {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.etw-error-message.etw-toast-hiding {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.4, 0, 1, 1),
        opacity   0.22s ease;
}

.etw-toast-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 16px 20px;
}

.etw-toast-icon-wrap {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #ff6b6b, #dc3545);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.etw-toast-body {
    flex: 1;
    min-width: 0;
}

.etw-toast-title {
    font-weight: 700;
    font-size: 0.78em;
    color: #dc3545;
    margin: 0 0 3px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.etw-error-text {
    font-size: 0.9em;
    color: #3d1a1e;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

.etw-toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #bbb;
    font-size: 16px;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    margin-top: -2px;
}

.etw-toast-close:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.08);
}

.etw-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: rgba(220, 53, 69, 0.1);
}

.etw-toast-progress-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff6b6b, #dc3545);
    transform-origin: left;
    transform: scaleX(0);
    transition: none;
}

.etw-toast-progress-bar.etw-progress-running {
    transform: scaleX(1);
    transition: transform 5s linear;
}

/* Reverse direction on mobile — drop from top */
@media screen and (max-width: 600px) {
    .etw-error-message {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: 100%;
        transform: translateY(-130%);
        transition:
            transform 0.45s cubic-bezier(0.34, 1.52, 0.64, 1),
            opacity   0.3s  ease;
    }

    .etw-error-message.etw-toast-visible {
        transform: translateY(0);
    }

    .etw-error-message.etw-toast-hiding {
        transform: translateY(-130%);
        transition:
            transform 0.32s cubic-bezier(0.4, 0, 1, 1),
            opacity   0.22s ease;
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media screen and (max-width: 600px) {
    .etw-signup-wrapper {
        margin: 10px;
    }

    .etw-signup-header {
        padding: 24px 18px;
    }

    .etw-signup-title {
        font-size: 1.4em;
    }

    .etw-signup-form {
        padding: 22px;
    }

    .etw-category-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .etw-group-link-item {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .etw-group-link-info {
        text-align: center;
    }

    .etw-join-btn {
        width: 100%;
        justify-content: center;
    }
}
/* ==========================================
   MANAGE FORM - INLINE ERRORS
   ========================================== */
.etw-inline-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 16px;
    background: #fff5f5;
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-left: 4px solid var(--etw-danger);
    border-radius: var(--etw-radius-sm);
    animation: etw-fadeInUp 0.3s ease;
}

.etw-inline-error-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    margin-top: 1px;
}

.etw-inline-error .etw-error-text {
    color: #721c24;
    font-size: 0.9em;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
}

/* ==========================================
   MANAGE FORM
   ========================================== */
.etw-manage-wrapper {}

.etw-manage-greeting {
    font-size: 1em;
    color: var(--etw-text);
    margin: 0 0 20px 0;
    padding: 14px 18px;
    background: var(--etw-primary-bg);
    border-left: 4px solid var(--etw-primary);
    border-radius: var(--etw-radius-sm);
    font-weight: 600;
}

.etw-label-help {
    display: block;
    font-weight: 400;
    color: var(--etw-text-secondary);
    margin-top: 2px;
}

.etw-manage-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 28px;
}

.etw-cancel-btn {
    width: 100%;
    padding: 13px 20px;
    background: transparent;
    color: var(--etw-danger);
    border: 2px solid var(--etw-danger);
    border-radius: var(--etw-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--etw-transition);
}

.etw-cancel-btn:hover {
    background: var(--etw-danger);
    color: #fff;
}

.etw-cancel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* ===========================================
   FRONTEND DISTRIBUTION PANEL
   [tender_whatsapp_panel]
   =========================================== */

/* -- Locked state ---------------------------------------- */
.etwp-locked {
    max-width: 480px;
    margin: 40px auto;
    text-align: center;
    padding: 40px 24px;
    background: var(--etw-white);
    border-radius: var(--etw-radius-lg);
    box-shadow: var(--etw-shadow-md);
    font-family: 'Inter', -apple-system, sans-serif;
}
.etwp-locked-icon { font-size: 3rem; margin-bottom: 16px; }
.etwp-locked-msg  { color: var(--etw-text-secondary); margin-bottom: 20px; }
.etwp-login-btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--etw-primary);
    color: var(--etw-white);
    border-radius: var(--etw-radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

/* -- Outer wrapper --------------------------------------- */
.etwp-wrap {
    max-width: 700px;
    margin: 0 auto 40px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--etw-text);
}

/* -- Header --------------------------------------------- */
.etwp-header {
    background: linear-gradient(135deg, var(--etw-accent), var(--etw-secondary), var(--etw-primary));
    border-radius: var(--etw-radius-lg);
    padding: 22px 20px 18px;
    margin-bottom: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
}
.etwp-header::before {
    content: '';
    position: absolute;
    top: -40%; right: -20%;
    width: 180px; height: 180px;
    background: rgba(255,255,255,0.07);
    border-radius: 50%;
    pointer-events: none;
}
.etwp-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.etwp-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0 0 4px;
    color: #fff;
}
.etwp-subtitle {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    margin: 0;
}
.etwp-header-count {
    text-align: right;
    flex-shrink: 0;
}
.etwp-count-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}
.etwp-count-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* -- Search bar ----------------------------------------- */
.etwp-search-bar {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: var(--etw-radius-md);
    padding: 0 12px;
    gap: 8px;
}
.etwp-search-icon { font-size: 1rem; flex-shrink: 0; }
.etwp-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.95rem;
    font-family: inherit;
    padding: 11px 0;
    min-width: 0;
}
.etwp-search-input::placeholder { color: rgba(255,255,255,0.65); }
.etwp-search-clear {
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}

/* -- Loading -------------------------------------------- */
.etwp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 30px;
    color: var(--etw-text-secondary);
    font-size: 0.9rem;
}
.etwp-spinner {
    width: 22px; height: 22px;
    border: 3px solid var(--etw-border);
    border-top-color: #25d366;
    border-radius: 50%;
    animation: etwp-spin 0.75s linear infinite;
}
@keyframes etwp-spin { to { transform: rotate(360deg); } }

/* -- Empty state ---------------------------------------- */
.etwp-empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--etw-text-secondary);
}
.etwp-empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* -- Tender card ---------------------------------------- */
.etwp-card {
    background: var(--etw-white);
    border-radius: var(--etw-radius-lg);
    box-shadow: var(--etw-shadow-sm);
    border: 1.5px solid var(--etw-border);
    padding: 16px;
    margin-bottom: 14px;
    transition: var(--etw-transition);
}
.etwp-card:last-child { margin-bottom: 0; }
.etwp-card--urgent  { border-left: 4px solid #ff6b35; }
.etwp-card--featured { border-left: 4px solid #f5c518; }

/* Card header row */
.etwp-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}
.etwp-card-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.etwp-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
}
.etwp-badge--featured { background: #fff8e1; color: #b7860b; }
.etwp-badge--urgent   { background: #fff0ec; color: #c0392b; }
.etwp-badge--expired  { background: #f5f5f5; color: #888; }
.etwp-card-date { font-size: 0.75rem; color: var(--etw-text-secondary); white-space: nowrap; flex-shrink: 0; }

/* Title */
.etwp-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
    color: var(--etw-text);
}
.etwp-card-title a {
    color: inherit;
    text-decoration: none;
}
.etwp-card-title a:hover { text-decoration: underline; color: var(--etw-primary); }

/* Deadline */
.etwp-card-deadline {
    font-size: 0.82rem;
    color: var(--etw-text-secondary);
    margin-bottom: 10px;
}
.etwp-card-deadline--expired { color: var(--etw-danger); }

/* Category tags */
.etwp-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 14px;
}
.etwp-cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    background: var(--etw-primary-bg);
    color: var(--etw-secondary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* -- Actions section ------------------------------------ */
.etwp-actions { display: flex; flex-direction: column; gap: 10px; }

.etwp-action-row {
    background: var(--etw-bg);
    border: 1.5px solid var(--etw-border);
    border-radius: var(--etw-radius-md);
    padding: 12px;
}
.etwp-action-row--all {
    background: #fffef0;
    border-color: #f5c518;
}

.etwp-action-meta { margin-bottom: 10px; }
.etwp-action-cat {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--etw-text);
    margin-bottom: 6px;
}

/* Group chips */
.etwp-group-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.etwp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    background: var(--etw-white);
    border: 1px solid var(--etw-border);
    border-radius: 20px;
    font-size: 0.72rem;
    color: var(--etw-text-secondary);
    white-space: nowrap;
}
.etwp-chip small { opacity: 0.75; }

/* Action buttons row */
.etwp-action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Base button */
.etwp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 14px;
    border-radius: var(--etw-radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    border: none;
    white-space: nowrap;
    transition: var(--etw-transition);
    -webkit-tap-highlight-color: transparent;
}

/* Copy button */
.etwp-btn--copy {
    background: var(--etw-bg);
    color: var(--etw-text-secondary);
    border: 1.5px solid var(--etw-border);
    min-width: 80px;
}
.etwp-btn--copy:active,
.etwp-btn--copy:hover { background: var(--etw-border); }
.etwp-btn--copied {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    border-color: #a5d6a7 !important;
}

/* Send / WhatsApp button */
.etwp-btn--send {
    flex: 1;
    background: #25d366;
    color: #fff;
    min-height: 44px; /* WCAG tap target */
    font-size: 0.9rem;
}
.etwp-btn--send:hover,
.etwp-btn--send:active { background: #1ebe5a; color: #fff; }

/* Send-to-ALL variant */
.etwp-btn--send-all {
    background: #075e54;
}
.etwp-btn--send-all:hover,
.etwp-btn--send-all:active { background: #054c44; color: #fff; }

/* No groups notice */
.etwp-no-groups {
    font-size: 0.82rem;
    color: var(--etw-text-secondary);
    font-style: italic;
    margin: 8px 0 0;
}

/* -- Message preview ------------------------------------ */
.etwp-preview {
    margin-top: 12px;
    border-top: 1px solid var(--etw-border);
    padding-top: 10px;
}
.etwp-preview-toggle {
    font-size: 0.8rem;
    color: var(--etw-text-secondary);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 5px;
}
.etwp-preview-toggle::-webkit-details-marker { display: none; }
.etwp-preview-text {
    margin: 10px 0 0;
    padding: 12px;
    background: var(--etw-bg);
    border: 1px solid var(--etw-border);
    border-radius: var(--etw-radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--etw-text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

/* -- Pagination ----------------------------------------- */
.etwp-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px 0 8px;
}
.etwp-page-btn {
    padding: 10px 20px;
    background: var(--etw-white);
    border: 1.5px solid var(--etw-border);
    border-radius: var(--etw-radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--etw-text);
    cursor: pointer;
    transition: var(--etw-transition);
    min-height: 44px;
}
.etwp-page-btn:hover:not(:disabled) { background: var(--etw-primary-bg); border-color: var(--etw-primary); color: var(--etw-primary-dark); }
.etwp-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.etwp-page-info { font-size: 0.85rem; color: var(--etw-text-secondary); white-space: nowrap; }

/* -- Mobile tweaks -------------------------------------- */
@media ( max-width: 480px ) {
    .etwp-header { padding: 18px 14px 14px; border-radius: var(--etw-radius-md); }
    .etwp-title  { font-size: 1.1rem; }
    .etwp-card   { padding: 14px; border-radius: var(--etw-radius-md); }
    .etwp-btn--send { font-size: 0.85rem; padding: 10px 10px; }
    .etwp-action-btns { flex-direction: column; }
    .etwp-btn--copy,
    .etwp-btn--send { width: 100%; }
}
