/* ── Platform Module CSS (plt.css) ── */

.plt-card { border-radius: .75rem; border: 1px solid #e2e8f0; background: #fff; padding: 1.25rem 1.5rem; transition: box-shadow .15s; }
.plt-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }

.plt-stat-val { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.plt-stat-lbl { font-size: .8rem; color: #64748b; margin-top: .25rem; }

.plt-icon-wrap { width: 3rem; height: 3rem; border-radius: .6rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.plt-icon-wrap--sm { width: 2rem; height: 2rem; font-size: .9rem; }

.plt-badge { font-size: .72rem; padding: .2rem .55rem; border-radius: 1rem; font-weight: 600; }
.plt-badge--pending  { background: #fef9c3; color: #854d0e; }
.plt-badge--active   { background: #dcfce7; color: #166534; }
.plt-badge--inactive { background: #f1f5f9; color: #475569; }

.plt-active-dot { font-size: .5rem; }

.plt-company-meta { font-size: .72rem; }

.plt-req-name { font-size: .82rem; }
.plt-req-meta { font-size: .73rem; }

.plt-btn-xs { font-size: .72rem; padding: .15rem .5rem; }

.plt-filter-narrow { max-width: 360px; }
.plt-text-xs { font-size: .72rem; }
.plt-text-sm { font-size: .75rem; }
.plt-text-md { font-size: .78rem; }
.plt-text-lg { font-size: .82rem; }
.plt-note-box { font-size: .82rem; }
.plt-uppercase { text-transform: uppercase; }
.plt-purple { color: #7c3aed; }
.plt-purple-outline { color: #7c3aed; border-color: #7c3aed; }
.plt-purple-btn { background: #7c3aed; color: #fff; border: none; }
.plt-purple-btn:hover { background: #6d28d9; color: #fff; }
.plt-dashboard-toolbar { gap: .75rem; }
.plt-dashboard-actions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
}
.plt-card-tabs-shell { border-top-left-radius: 0; border-top-right-radius: 0; }
.plt-inline-form { display: inline; }
.plt-hidden { display: none; }
.plt-nowrap { white-space: nowrap; }
.plt-col-id { width: 36px; }
.plt-col-sort { width: 60px; }
.plt-truncate-sm { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plt-truncate-md { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plt-ltr-value { direction: ltr; text-align: right; }
.plt-code-editor { direction: ltr; font-family: monospace; font-size: .78rem; }
.plt-pre-rtl { font-size: .75rem; white-space: pre-wrap; direction: rtl; }

.plt-co-card { border: 1px solid #e2e8f0; border-radius: .6rem; transition: box-shadow .15s; }
.plt-co-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.plt-co-badge-active,
.plt-co-badge-inactive { font-size: .72rem; padding: .18rem .55rem; border-radius: 1rem; font-weight: 600; }
.plt-co-badge-active { background: #dcfce7; color: #166534; }
.plt-co-badge-inactive { background: #f1f5f9; color: #64748b; }
.plt-co-note-success { background: #f0fdf4; font-size: .76rem; }
.plt-co-note-warning { background: #fefce8; font-size: .76rem; }

.plt-support-session-active { border-right: 3px solid #22c55e; }

.plt-badge--new      { background: #dbeafe; color: #1e40af; }
.plt-badge--review   { background: #fef3c7; color: #92400e; }
.plt-badge--planned  { background: #ede9fe; color: #5b21b6; }
.plt-badge--done     { background: #d1fae5; color: #065f46; }
.plt-badge--rejected { background: #fee2e2; color: #991b1b; }
.plt-priority--critical { color: #dc2626; font-weight: 600; }
.plt-priority-text--critical { color: #dc2626; font-weight: 600; }
.plt-priority-text--high { color: #ea580c; font-weight: 600; }
.plt-priority-text--normal { color: #4b5563; }
.plt-priority-text--low { color: #9ca3af; }
.plt-req-desc { font-size: .78rem; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.plt-stat-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 4px 14px; font-size: .82rem; font-weight: 500; cursor: pointer; border: 2px solid transparent; transition: all .15s; }
.plt-stat-pill.active { border-color: currentColor; }
.plt-stat-pill--all      { background: #f3f4f6; color: #374151; }
.plt-stat-pill--new      { background: #dbeafe; color: #1e40af; }
.plt-stat-pill--review   { background: #fef3c7; color: #92400e; }
.plt-stat-pill--planned  { background: #ede9fe; color: #5b21b6; }
.plt-stat-pill--done     { background: #d1fae5; color: #065f46; }
.plt-stat-pill--rejected { background: #fee2e2; color: #991b1b; }
.plt-stat-count--new      { background: #1e40af; }
.plt-stat-count--review   { background: #92400e; }
.plt-stat-count--planned  { background: #5b21b6; }
.plt-stat-count--done     { background: #065f46; }
.plt-stat-count--rejected { background: #991b1b; }

.plt-progress-xs { height: 6px; }
.plt-progress-sm { height: 8px; border-radius: 4px; }
.plt-min-progress { min-width: 120px; }

.ws-score-ring { width: 100px; height: 100px; position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ws-score-ring svg { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }
.ws-score-val { font-size: 1.6rem; font-weight: 700; }
.ws-check-item { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: .6rem .9rem; margin-bottom: .5rem; display: flex; align-items: center; gap: .75rem; transition: background .15s; }
.ws-check-item:hover { background: var(--bs-light); }
.ws-check-done { opacity: .6; }
.ws-check-icon { font-size: 1.2rem; flex-shrink: 0; }
.ws-import-card { border: 1px dashed var(--bs-border-color); border-radius: .5rem; padding: 1rem; background: var(--bs-light); text-align: center; }
.ws-cmp-row td { vertical-align: middle; }

/* ── Platform journey ── */
.plt-flow-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
}

.plt-flow-step {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: #475569;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 600;
}

.plt-flow-step:hover { color: var(--bs-primary); }

.plt-flow-step--active { color: var(--bs-primary); }

.plt-flow-arrow {
    color: #94a3b8;
    font-size: .8rem;
}

@media (max-width: 767.98px) {
    .plt-dashboard-toolbar {
        align-items: stretch !important;
        flex-direction: column;
    }

    .plt-dashboard-actions {
        justify-content: flex-start;
    }
}

/* ── Customers Screen ── */
.plt-status-pill          { font-size: .78rem; }

.plt-cust-table           { font-size: .82rem; }
.plt-cust-row             { cursor: default; }
.plt-cust-row--warning td { background-color: #fff8f0 !important; }
.plt-cust-code            { font-family: monospace; font-size: .8rem; color: #475569; }

.plt-count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.4rem; height: 1.4rem; border-radius: 50%;
    background: #e2e8f0; color: #475569; font-size: .72rem; font-weight: 600;
}

.plt-lic-badge {
    display: inline-block; font-size: .72rem; font-weight: 700;
    padding: .15rem .5rem; border-radius: .35rem;
}
.plt-lic-badge--finance { background: #dbeafe; color: #1d4ed8; }
.plt-lic-badge--scm     { background: #dcfce7; color: #15803d; }

.plt-fateen-balance { font-size: .75rem; font-weight: 600; color: #7c3aed; }

/* حالة الاشتراك */
.plt-badge--sub-active    { background: #dcfce7; color: #166534; }
.plt-badge--sub-trial     { background: #fef9c3; color: #854d0e; }
.plt-badge--sub-grace     { background: #fed7aa; color: #9a3412; }
.plt-badge--sub-suspended { background: #fee2e2; color: #991b1b; }
.plt-badge--sub-expired   { background: #f1f5f9; color: #64748b; }
.plt-badge--sub-cancelled { background: #f1f5f9; color: #94a3b8; }

/* ── Customer Details Screen ── */
.plt-details-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: .75rem 1.25rem;
    margin-bottom: 1rem;
}

.plt-details-name   { font-size: 1.1rem; font-weight: 700; }
.plt-details-code   { font-family: monospace; font-size: .78rem; color: #64748b; }
.plt-details-meta   { font-size: .78rem; color: #64748b; }

/* شريط التبويبات */
.plt-details-tabs .nav-link {
    font-size: .82rem;
    padding: .45rem .9rem;
    color: #475569;
    border-bottom: 2px solid transparent;
}
.plt-details-tabs .nav-link.active {
    color: var(--bs-primary);
    border-bottom-color: var(--bs-primary);
    background: transparent;
    font-weight: 600;
}
.plt-details-tabs .nav-link:hover:not(.active) { color: #1e293b; }

/* بطاقات الملخص (التراخيص / فطين) */
.plt-summary-card {
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    padding: 1rem 1.25rem;
    background: #fff;
    height: 100%;
}
.plt-summary-card .plt-summary-val {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.1;
}
.plt-summary-card .plt-summary-lbl {
    font-size: .75rem;
    color: #64748b;
    margin-top: .2rem;
}
.plt-summary-card--finance { border-top: 3px solid #3b82f6; }
.plt-summary-card--scm     { border-top: 3px solid #22c55e; }
.plt-summary-card--free    { border-top: 3px solid #f59e0b; }
.plt-summary-card--paid    { border-top: 3px solid #8b5cf6; }
.plt-summary-card--balance { border-top: 3px solid #7c3aed; }
.plt-summary-card--consumed{ border-top: 3px solid #ef4444; }
.plt-summary-card--credited{ border-top: 3px solid #10b981; }

/* جدول الشركات */
.plt-co-table   { font-size: .82rem; }
.plt-co-primary { font-size: .7rem; background: #dbeafe; color: #1d4ed8; padding: .1rem .4rem; border-radius: .25rem; font-weight: 600; }

/* جدول الطلبات */
.plt-req-table  { font-size: .82rem; }

/* شارة نوع الطلب */
.plt-req-type--bug         { background: #fee2e2; color: #991b1b; }
.plt-req-type--feature     { background: #dcfce7; color: #166534; }
.plt-req-type--support     { background: #dbeafe; color: #1d4ed8; }
.plt-req-type--report      { background: #fef9c3; color: #854d0e; }
.plt-req-type--internal    { background: #f1f5f9; color: #475569; }

/* شارة أولوية الطلب */
.plt-priority--high   { background: #fee2e2; color: #991b1b; font-size: .7rem; padding: .1rem .4rem; border-radius: .25rem; font-weight: 600; }
.plt-priority--normal { background: #f1f5f9; color: #475569; font-size: .7rem; padding: .1rem .4rem; border-radius: .25rem; }
.plt-priority--low    { background: #f0fdf4; color: #166534; font-size: .7rem; padding: .1rem .4rem; border-radius: .25rem; }

/* شارة حالة الطلب */
.plt-req-status--new       { background: #dbeafe; color: #1d4ed8; }
.plt-req-status--inreview  { background: #fef9c3; color: #854d0e; }
.plt-req-status--planned   { background: #ede9fe; color: #6d28d9; }
.plt-req-status--done      { background: #dcfce7; color: #166534; }
.plt-req-status--rejected  { background: #f1f5f9; color: #64748b; }

/* محفظة فطين */
.plt-wallet-balance {
    font-size: 2rem;
    font-weight: 800;
    color: #7c3aed;
    line-height: 1;
}
.plt-wallet-status--active    { background: #dcfce7; color: #166534; }
.plt-wallet-status--suspended { background: #fee2e2; color: #991b1b; }
.plt-wallet-status--depleted  { background: #f1f5f9; color: #64748b; }

/* بيانات الاشتراك */
.plt-sub-field-lbl { font-size: .75rem; color: #64748b; margin-bottom: .1rem; }
.plt-sub-field-val { font-size: .9rem; font-weight: 500; }

/* ── Access Center ── */
.plt-access-filter .form-label { font-size: .76rem; font-weight: 600; color: #475569; }
.plt-access-checks { display: flex; flex-wrap: wrap; gap: .25rem .75rem; font-size: .78rem; }
.plt-access-table-card { padding: 0; overflow: hidden; }
.plt-access-table { font-size: .78rem; }
.plt-access-table th { white-space: nowrap; color: #475569; font-weight: 700; }
/* ‏البند 498: تمرير أفقي منضبط. كان شريط التمرير في أسفل الجدول كله، خلف عشرات الصفوف، فبدا العمود الأخير مقصوصاً.
   ‏فالصندوق بارتفاع الشاشة يُظهر شريطه دائماً، والرأس يثبت أعلاه */
.plt-access-table-card > .table-responsive { max-height: calc(100vh - 13rem); min-height: 18rem; overflow: auto; }
.plt-access-table thead th { position: sticky; top: 0; z-index: 1; }
/* ‏وتحت 1600 تلتفّ العناوين وتضيق الملخصات، فيتّسع الجدول بأعمدته العشرة لعرض 1440 بلا تمرير */
@media (max-width: 1599.98px) {
    .plt-access-table th { white-space: normal; }
    .plt-access-table .plt-access-summary { min-width: 104px; }
    .plt-access-table td .small { overflow-wrap: anywhere; }
}
.plt-access-table td { vertical-align: top; }
.plt-access-summary { min-width: 150px; max-width: 260px; }
.plt-access-fields { font-size: .84rem; }

/* ── Webhooks ── */
.plt-webhook-pane { min-height: 640px; }
.plt-webhook-pane-head,
.plt-webhook-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}
.plt-webhook-section {
    border: 1px solid #e2e8f0;
    border-radius: .5rem;
    background: #fff;
    overflow: hidden;
}
.plt-webhook-form { padding: 1rem; }
.plt-webhook-empty { padding: 1.25rem; color: #64748b; font-size: .85rem; }
.plt-webhook-url {
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    direction: ltr;
    text-align: left;
    font-size: .78rem;
}
.plt-webhook-events {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-top: .25rem;
}
.plt-webhook-events span,
.plt-webhook-status {
    display: inline-flex;
    align-items: center;
    border-radius: .35rem;
    padding: .12rem .45rem;
    font-size: .7rem;
    font-weight: 700;
}
.plt-webhook-events span { background: #eff6ff; color: #1d4ed8; }
.plt-webhook-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .5rem;
}
.plt-webhook-event-grid label {
    display: flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid #e2e8f0;
    border-radius: .35rem;
    padding: .45rem .6rem;
    background: #f8fafc;
    direction: ltr;
}
.plt-webhook-log { font-size: .78rem; }
.plt-webhook-status--delivered { background: #dcfce7; color: #166534; }
.plt-webhook-status--pending { background: #dbeafe; color: #1d4ed8; }
.plt-webhook-status--failed { background: #fef9c3; color: #854d0e; }
.plt-webhook-status--dead { background: #fee2e2; color: #991b1b; }
.plt-webhook-reason { margin-top: .2rem; color: #991b1b; min-width: 9rem; }

/* ── بطاقتا الباقة في شاشة الرخص (نموذج التسعير) ── */
.plt-pkg-price { font-size: 1.15rem; color: #1e293b; }
.plt-pkg-note  { font-size: .72rem; }

/* ── لوحة فطين الأسبوعية (خطة فطين 1.0، الخطوة 5.1) ── */
.eval-kpi { height: 100%; padding: 1rem 1.15rem; }
.eval-kpi__label { font-size: .78rem; color: #64748b; }
.eval-kpi__value { font-size: 1.75rem; font-weight: 700; color: #1e293b; line-height: 1.2; margin: .2rem 0; }
.eval-kpi__sub { font-size: .75rem; color: #64748b; min-height: 1.1rem; }
.eval-kpi__delta { direction: ltr; unicode-bidi: isolate; margin-inline-start: .35rem; }
.eval-chart { position: relative; height: 260px; }
.eval-float-clear { height: 200px; }

/* بطاقة جدول قصير في صفحة فيها أكثر من بطاقة (فوترة الاشتراك P2-01): تأخذ ارتفاع محتواها، لا الحد الأدنى لقائمة الصفحة الواحدة في gl.css. */
.gl-list-card.plt-card--fit {
  min-height: 0;
  max-height: none;
}

/* التجربة المجانية الذاتية (P2-03، الشريحة الثانية) */
/* مصيدة الروبوتات: حقل خارج الشاشة، لا display:none الذي تتخطّاه بعض الروبوتات */
.trial-hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.trial-card {
  max-width: 760px;
}

.trial-password {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem .75rem;
  border: 1px dashed var(--bs-border-color);
  border-radius: .5rem;
}

.trial-password code {
  font-size: 1.1rem;
  user-select: all;
}