/* ============================================================
   Utility classes — replaces inline style= attributes (M2 CSP fix)
   Generated to eliminate style-src-attr 'unsafe-inline' from CSP.
   ============================================================ */

/* Display */
.d-none     { display: none; }
.d-block    { display: block; }
.d-inline   { display: inline; }
.d-flex     { display: flex; }

/* Display + layout combos */
.d-block-mt4  { display: block; margin-top: 4px; }
.flex-row-check { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; cursor: pointer; }
.flex-gap-mb3   { display: flex; gap: 10px; margin-bottom: 12px; }
.flex-col-gap6  { display: flex; flex-direction: column; gap: 6px; }

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.active { display: flex; }

/* Flex utilities */
.flex-1  { flex: 1; }
.flex-2  { flex: 2; }

/* Margin utilities */
.m-0   { margin: 0; }
.mt-1  { margin-top: 6px; }
.mt-2  { margin-top: 8px; }
.mt-3  { margin-top: 14px; }
.mt-4  { margin-top: 16px; }
.mb-2  { margin-bottom: 8px; }
.mb-3  { margin-bottom: 12px; }
.mb-10 { margin-bottom: 10px; }
.mb-4  { margin-bottom: 16px; }

/* Padding utilities */
.p-2   { padding: 8px; }
.p-3   { padding: 12px; }

/* Sizing */
.w-full     { width: 100%; }
.icon-sm    { width: 18px; height: 18px; }
.min-w-120  { min-width: 120px; }

/* Table cell patterns */
.td-cell        { padding: 8px; border-bottom: 1px solid var(--border); }
.td-center      { padding: 10px; text-align: center; }
.td-center-cell { padding: 8px; border-bottom: 1px solid var(--border); text-align: center; }
.td-padded      { padding: 9px 10px; border-bottom: 1px solid var(--border); }
.td-bold        { padding: 10px; font-weight: 700; }
.td-muted-sm    { padding: 10px; color: var(--text-soft); font-size: .84rem; }

/* Card / bordered cell */
.card-cell      { padding: 12px; border: 1px solid var(--border); }
.card-cell-bold { padding: 12px; border: 1px solid var(--border); font-weight: 700; }

/* Text / color */
.text-soft        { color: var(--text-soft); }
.text-accent      { color: var(--accent); }
.text-primary-dark { color: #0f4d44; }
.text-danger-bold { color: #dc2626; font-weight: 700; }
.text-sm-muted    { font-size: 13px; color: var(--text-muted); }
.text-xs-soft     { font-size: .75rem; color: var(--text-soft); }
.text-xs-soft-mt1 { font-size: .75rem; color: var(--text-soft); margin-top: 3px; }

/* Field label (12px bold gray) */
.field-label {
    font-size: 12px;
    font-weight: 700;
    color: #5a6a7a;
    margin-bottom: 4px;
    display: block;
}

/* Badges */
.badge-circle {
    min-width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.tag-gray {
    background: #e5e7eb;
    color: #374151;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
}

/* Overflow */
.overflow-x-auto { overflow-x: auto; }

/* Text-align dynamic helpers (for {{ ALIGN }} patterns) */
.u-ta-right  { text-align: right; }
.u-ta-left   { text-align: left; }
.u-ta-center { text-align: center; }

/* th/td header with dynamic align */
.th-align-r { text-align: right;  padding: 7px 10px; font-weight: 700; color: var(--text-soft); }
.th-align-l { text-align: left;   padding: 7px 10px; font-weight: 700; color: var(--text-soft); }
.th-align-c { text-align: center; padding: 7px 10px; font-weight: 700; color: var(--text-soft); }
.th-hdr     { padding: 7px 10px; font-weight: 700; color: var(--text-soft); }

/* Logical margin for RTL/LTR ({{ ALIGN }} direction-dependent) */
.ms-8   { margin-inline-start: 8px; }
.me-8   { margin-inline-end:   8px; }
.ms-auto { margin-inline-start: auto; }

/* ── Round 2 utilities ── */
/* Font weight */
.fw-700 { font-weight: 700; }
.fw-600 { font-weight: 600; }
.fw-800-fs105 { font-weight: 800; font-size: 1.05rem; }

/* Link-style button */
.link-btn { cursor: pointer; font-weight: 600; color: var(--primary); }

/* Margin extras */
.mt-0   { margin-top: 0; }
.mt-10  { margin-top: 10px; }
.mb-24  { margin-bottom: 24px; }
.mb-14  { margin-bottom: 14px; }
.my-2   { margin: 8px 0; }

/* Misc layout */
.pos-relative { position: relative; }
.bb-border    { border-bottom: 1px solid var(--border); }
.bg-soft      { background: var(--bg-soft); }

/* Typography extras */
.stat-value       { font-size: 1.2rem; font-weight: 800; color: var(--accent); }
.micro-label      { font-size: 10px; color: #64748b; font-weight: 700; margin-bottom: 3px; }
.micro-label-gray { font-size: .72rem; font-weight: 700; color: #64748b; margin-bottom: .4rem; }
.text-xs2-soft    { font-size: .78rem; color: var(--text-soft); }
.section-eyebrow  { font-size: .78rem; font-weight: 800; color: #0d6b5a; margin-bottom: .75rem; }
.text-85          { font-size: .85rem; }
.field-label-dark { font-size: 12px; font-weight: 700; color: #374151; display: block; margin-bottom: 4px; }
.subhead          { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.text-soft-sm-mb  { color: var(--text-soft); font-size: .85rem; margin: 0 0 10px; }
.ltr-hint         { margin-top: 4px; direction: ltr; font-size: .85rem; }

/* Padding extras */
.badge-sm   { padding: 4px 10px; font-size: 12px; }
.p-4-center { padding: 16px; text-align: center; }

/* Sizing extras */
.w-full-max400 { width: 100%; max-width: 400px; }
.w-full-mt1    { width: 100%; margin-top: 6px; }

/* Flex extras */
.flex-15       { flex: 1.5; }
.flex-row-mb2  { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.flex-wrap-gap2 { display: flex; gap: 8px; flex-wrap: wrap; }
.flex-row-gap10 { display: flex; align-items: center; gap: 10px; }
.flex-row-mt20  { display: flex; align-items: center; gap: 12px; margin-top: 20px; }

/* Card / box */
.soft-box        { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--bg-soft); }
.soft-box-center { background: var(--bg-soft); border-radius: 10px; padding: 12px; text-align: center; }
.card-default    { background: var(--bg-card, #fff); border-radius: 12px; padding: 1.25rem; box-shadow: 0 2px 12px rgba(0,0,0,.06); border: 1.5px solid var(--border, #e2e8f0); min-height: 200px; }

/* Buttons / interaction */
.icon-close-btn  { background: none; border: none; font-size: 22px; cursor: pointer; color: #64748b; line-height: 1; }
.text-red-border { color: #e05c5c; border-color: #e05c5c; }

/* Table */
.table-sm       { width: 100%; border-collapse: collapse; font-size: 13px; }
.nowrap-vmid    { white-space: nowrap; vertical-align: middle; }

/* List content */
.list-content-soft { padding: 12px 0 0; line-height: 2; color: var(--text-soft); }
.reset-overflow    { margin: 0; padding: 0; overflow: hidden; }

/* ── Phase 3b: dynamic → class conversions ── */

/* Text direction (replaces direction:rtl/ltr inline) */
.dir-rtl { direction: rtl; }
.dir-ltr { direction: ltr; }

/* Flex order (RTL/LTR layout toggle) */
.order-1 { order: 1; }
.order-2 { order: 2; }

/* Logical padding-inline-end (replaces padding-left:45px in AR / padding-right:45px in EN) */
.pie-45 { padding-inline-end: 45px; }

/* Logical padding-inline-start combos (replaces padding-right/left RTL pattern + other props) */
.ol-pis18 { margin: 0; padding-inline-start: 18px; font-size: .83rem; line-height: 2; color: var(--text-soft); }
.ol-pis20 { margin: 0; padding-inline-start: 20px; line-height: 1.8; color: var(--text-soft); }
.ol-pis20-soft { margin: 0; padding-inline-start: 20px; color: var(--text-soft); }
.lh2-pis20 { line-height: 2; padding-inline-start: 20px; margin: 0; }

/* Logical margin-inline-start */
.ms-10 { margin-inline-start: 10px; }

/* Logical margin-inline-end combos */
.accent-me8 { color: var(--accent); margin-inline-end: 8px; }

/* Logical border-inline-start card (replaces border-right/left RTL accent border) */
.info-card-bis {
  margin-bottom: 16px; padding: 14px; background: var(--bg-soft);
  border-radius: 10px; border-inline-start: 4px solid var(--primary);
}

/* Absolute-positioned elements with inset-inline-end (RTL-safe) */
.copy-btn-abs {
  position: absolute; top: 8px; inset-inline-end: 8px;
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 4px 10px; font-size: .78rem; cursor: pointer;
}
.abs-copy-label { position: absolute; top: 6px; inset-inline-end: 10px; font-size: .7rem; color: #64748b; }

/* Badges */
.badge-success-mis6 {
  font-size: .75rem; padding: 2px 8px; border-radius: 12px;
  background: #dcfce7; color: #166534; margin-inline-start: 6px; font-weight: 600;
}
.fcm-badge { font-size: .72rem; padding: 2px 10px; border-radius: 20px; color: #fff; background: #6b7280; font-weight: 600; margin-inline-start: 8px; }
.fcm-badge-primary { background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 20px; margin-inline-start: 8px; }

/* Padding */
.p-10 { padding: 10px; }

/* Width percentages */
.w-20 { width: 20%; }
.w-30 { width: 30%; }

/* Width fixed px */
.w-100px { width: 100px; }
.w-150px { width: 150px; }

/* Margin-bottom */
.mb-30 { margin-bottom: 30px; }

/* Card content blocks (replaces large style combos in modals/drawers) */
.draft-body {
  font-size: 13px; line-height: 1.7; color: #1e293b;
  white-space: pre-wrap; max-height: 200px; overflow-y: auto;
}
.w-full-13 { width: 100%; font-size: 13px; }
.modal-panel {
  background: #fff; border-radius: 18px; padding: 22px 24px;
  max-width: 860px; width: 96%; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 12px 50px rgba(0,0,0,.22);
}
.tpl-preview {
  font-size: 12px; color: #1e293b; line-height: 1.7;
  white-space: pre-wrap; max-height: 120px; overflow: hidden;
}
