/* ===================================================
   EXTERNAL FORMS STYLES  –  Prefix: fxef-
   Matches FiberX city-zones (fxcz-) design system
   =================================================== */

/* ===== Page Header ===== */
.fxef-page-header {
    position: relative;
    background: linear-gradient(135deg, #2D2350 0%, #4B3E7B 55%, #6B5B9A 100%);
    border-radius: 0 0 32px 32px;
    padding: 28px 28px 0;
    overflow: hidden;
    margin-bottom: 24px;
}

.fxef-page-header-glow {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 80% 20%, rgba(255,120,80,.20) 0%, transparent 50%),
        radial-gradient(circle at 5% 80%, rgba(139,92,246,.25) 0%, transparent 50%);
    pointer-events: none;
}

.fxef-page-header-content {
    position: relative;
    display: flex; align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
    padding-bottom: 20px;
}

.fxef-page-header-left { display: flex; align-items: center; gap: 16px; }

.fxef-page-icon {
    width: 52px; height: 52px; border-radius: 16px;
    background: rgba(255,255,255,.12);
    border: 1.5px solid rgba(255,255,255,.22);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.fxef-page-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 900; font-size: 22px; color: #fff; margin: 0 0 3px;
}

.fxef-page-sub {
    font-size: 12px; font-weight: 600;
    color: rgba(255,255,255,.55); margin: 0;
}

.fxef-page-header-right { display: flex; gap: 10px; flex-wrap: wrap; }

.fxef-btn-create {
    background: linear-gradient(135deg, #FF7850, #FF9575) !important;
    color: #fff !important; border: none !important;
    border-radius: 12px !important; font-weight: 800 !important;
    font-size: 13px !important; padding: 0 20px !important;
    height: 40px !important; letter-spacing: .4px !important;
    box-shadow: 0 4px 16px rgba(255,120,80,.35) !important;
}
.fxef-btn-create:hover { filter: brightness(1.08) !important; }

.fxef-btn-refresh {
    border-color: rgba(255,255,255,.35) !important; color: #fff !important;
    border-radius: 12px !important; font-weight: 700 !important;
    font-size: 13px !important; height: 40px !important; padding: 0 18px !important;
}
.fxef-btn-refresh:hover { background: rgba(255,255,255,.1) !important; }

/* ===== Stats Row ===== */
.fxef-stats-row {
    position: relative;
    display: flex; gap: 12px; flex-wrap: wrap;
    padding: 0 0 20px;
}

.fxef-stat {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px; padding: 6px 14px;
}

.fxef-stat-num {
    font-family: 'Poppins', sans-serif;
    font-weight: 900; font-size: 18px; color: #fff;
}

.fxef-stat-label {
    font-size: 11px; font-weight: 600; color: rgba(255,255,255,.5);
    text-transform: uppercase; letter-spacing: .5px;
}

.fxef-clr-green { color: #4ADE80 !important; }
.fxef-clr-amber { color: #FBBF24 !important; }
.fxef-clr-muted { color: rgba(255,255,255,.4) !important; }

/* ===== Filters ===== */
.fxef-top {
    background: #fff;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.fxef-filters {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}

.fxef-search { flex: 1; min-width: 200px; }
.fxef-status-filter { width: 160px; }

/* ===== Table ===== */
.fxef-table-wrap {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.fxef-table-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(45,35,80,.2) transparent;
}

.fxef-table {
    width: 100%; border-collapse: collapse;
    font-family: 'Poppins', sans-serif;
}

.fxef-th {
    padding: 14px 12px;
    font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .6px;
    color: #fff !important;
    background: linear-gradient(135deg, #2D2350, #4B3E7B) !important;
    white-space: nowrap;
    text-align: left;
}

.fxef-tr {
    transition: background .15s;
}
.fxef-tr:hover {
    background: rgba(75,62,123,.04);
}

.fxef-td {
    padding: 12px;
    font-size: 13px; font-weight: 500;
    color: #2D2350;
    border-bottom: 1px solid rgba(0,0,0,.04);
    vertical-align: middle;
}

/* ===== Name Cell ===== */
.fxef-name-cell { display: flex; flex-direction: column; gap: 2px; }
.fxef-name-en { font-weight: 700; font-size: 13px; color: #2D2350; }
.fxef-name-ar { font-family: 'Cairo', sans-serif; font-size: 12px; color: #6B7280; direction: rtl; }

/* ===== Slug ===== */
.fxef-slug {
    background: rgba(75,62,123,.06);
    color: #4B3E7B;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 600;
}

.fxef-muted { color: #D1D5DB; font-size: 12px; }

/* ===== Badges ===== */
.fxef-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 800;
    white-space: nowrap; border: 1px solid transparent;
}

.fxef-badge-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; flex-shrink: 0;
}

.fxef-badge-published { color: #15803D; background: rgba(34,197,94,.10); border-color: rgba(34,197,94,.20); }
.fxef-badge-draft { color: #B45309; background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.20); }
.fxef-badge-archived { color: #6B7280; background: rgba(107,114,128,.10); border-color: rgba(107,114,128,.20); }

.fxef-badge-field-type { color: #6D28D9; background: rgba(109,40,217,.08); font-weight: 700; font-size: 10px; }
.fxef-badge-required { color: #DC2626; background: rgba(220,38,38,.08); font-weight: 700; font-size: 10px; }
.fxef-badge-rtl { color: #0369A1; background: rgba(3,105,161,.08); font-weight: 700; font-size: 10px; }
.fxef-badge-api { color: #059669; background: rgba(5,150,105,.08); font-weight: 700; font-size: 10px; }

/* ===== Count Pills ===== */
.fxef-count-pill {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 24px; padding: 0 8px;
    border-radius: 8px; font-size: 12px; font-weight: 800;
    background: rgba(75,62,123,.08); color: #4B3E7B;
}

.fxef-count-sub { background: rgba(14,165,233,.08); color: #0369A1; }

/* ===== Actions ===== */
.fxef-actions { display: flex; gap: 2px; }

/* ===== Loading & Empty ===== */
.fxef-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 16px; padding: 80px 24px;
    font-family: 'Poppins', sans-serif; font-size: 14px;
    font-weight: 600; color: #9CA3AF;
}

.fxef-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 12px; padding: 80px 24px;
    text-align: center; font-family: 'Poppins', sans-serif;
}

.fxef-empty-icon { font-size: 64px !important; opacity: .3; color: #9CA3AF !important; }
.fxef-empty-title { font-weight: 800; font-size: 18px; color: #2D2350; }
.fxef-empty-sub { font-size: 13px; color: #9CA3AF; max-width: 360px; }

/* ===== Pagination ===== */
.fxef-pg-container {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px; margin-top: 20px; padding: 16px 20px;
    background: #fff; border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
    font-family: 'Poppins', sans-serif;
}

.fxef-pg-left { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.fxef-pg-right { display: flex; align-items: center; gap: 8px; }
.fxef-pg-muted { color: #9CA3AF; font-weight: 500; }
.fxef-pg-strong { color: #2D2350; font-weight: 800; }

.fxef-pg-pill {
    background: rgba(75,62,123,.08); color: #4B3E7B;
    padding: 4px 14px; border-radius: 8px;
    font-size: 12px; font-weight: 800;
}

.fxef-pg-btn {
    color: #4B3E7B !important; font-weight: 700 !important;
    font-size: 12px !important; text-transform: none !important;
}

/* ===== Dialog Styles ===== */
.fxef-dialog { border-radius: 16px !important; overflow: hidden !important; }

.fxefd-header {
    display: flex; align-items: center; gap: 14px;
    background: linear-gradient(135deg, #2D2350, #4B3E7B);
    margin: -24px -24px 0; padding: 20px 24px;
}

.fxefd-header-icon {
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(255,255,255,.15);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.fxefd-header-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 800; font-size: 16px; color: #fff;
}

.fxefd-header-sub { font-size: 12px; color: rgba(255,255,255,.55); font-weight: 500; }

.fxefd-body { padding: 20px 4px 8px; }

.fxefd-actions {
    display: flex; justify-content: center; gap: 12px;
    padding: 8px 16px 16px; width: 100%;
}

.fxefd-btn-cancel {
    color: #6B7280 !important; font-weight: 700 !important;
    font-size: 13px !important; text-transform: none !important;
    border-radius: 10px !important;
}

.fxefd-btn-save {
    background: linear-gradient(135deg, #FF7850, #FF9575) !important;
    color: #fff !important; border: none !important;
    border-radius: 10px !important; font-weight: 800 !important;
    font-size: 13px !important; padding: 0 24px !important;
    height: 38px !important;
    box-shadow: 0 4px 12px rgba(255,120,80,.3) !important;
}
.fxefd-btn-save:hover { filter: brightness(1.06) !important; }

/* ===== Fields List (ManageFieldsDialog) ===== */
.fxef-fields-list {
    display: flex; flex-direction: column; gap: 8px;
}

.fxef-field-card {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 16px;
    background: #FAFAFA; border: 1px solid #F3F4F6;
    border-radius: 12px; transition: all .15s;
}
.fxef-field-card:hover {
    background: #F5F3FF; border-color: rgba(75,62,123,.15);
}

.fxef-field-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }

.fxef-field-order {
    width: 32px; height: 32px; border-radius: 8px;
    background: rgba(75,62,123,.08); color: #4B3E7B;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-weight: 900; font-size: 13px; flex-shrink: 0;
}

.fxef-field-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.fxef-field-label {
    font-weight: 700; font-size: 13px; color: #2D2350;
    display: flex; align-items: center; gap: 8px;
}

.fxef-field-label-ar {
    font-family: 'Cairo', sans-serif; font-size: 12px;
    color: #6B7280; direction: rtl;
}

.fxef-field-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}

.fxef-field-actions { display: flex; gap: 2px; flex-shrink: 0; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .fxef-page-header-content { flex-direction: column; align-items: flex-start; }
    .fxef-page-header-right { width: 100%; }
    .fxef-stats-row { flex-direction: row; overflow-x: auto; }
    .fxef-filters { flex-direction: column; }
    .fxef-search { min-width: 100%; }
    .fxef-status-filter { width: 100%; }
    .fxef-hide-sm { display: none !important; }

    .fxef-table thead { display: none; }
    .fxef-tr {
        display: flex; flex-direction: column;
        padding: 12px; border-bottom: 2px solid #F3F4F6;
    }
    .fxef-td {
        display: flex; justify-content: space-between; align-items: center;
        padding: 6px 0; border: none;
    }
    .fxef-td::before {
        content: attr(data-label);
        font-weight: 800; font-size: 11px;
        color: #9CA3AF; text-transform: uppercase; letter-spacing: .5px;
    }

    .fxef-field-card { flex-direction: column; align-items: flex-start; }
    .fxef-field-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 1024px) {
    .fxef-hide-md { display: none !important; }
}
