/* AURA CHESS — admin: creator / affiliate codes (Addition #2).
   Logical properties only: the page serves Arabic (RTL) and English (LTR). */

.ac-page {
    --ac-bg: #0b101b;
    --ac-panel: rgba(21, 31, 52, 0.72);
    --ac-line: rgba(148, 163, 184, 0.18);
    --ac-text: #e2e8f0;
    --ac-muted: #94a3b8;
    --ac-cyan: #06b6d4;
    --ac-green: #34d399;
    --ac-amber: #fbbf24;
    --ac-red: #f87171;
    --ac-focus: #e0f2fe;
    max-width: 1180px;
    margin-inline: auto;
    padding: 96px 16px 64px;
    color: var(--ac-text);
    font-family: 'Cairo', sans-serif;
}
@media (min-width: 768px) { .ac-page { padding-inline: 24px; } }

.ac-page [hidden],
.ac-modal[hidden] { display: none !important; }

.ac-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.ac-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-block-end: 8px;
}
.ac-head h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; color: #fff; }
.ac-head p { margin: 0; color: var(--ac-muted); font-size: 0.9rem; }
.ac-clock { margin: 0 0 16px; color: var(--ac-muted); font-size: 0.8rem; }

.ac-panel {
    margin-block-start: 16px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--ac-line);
    background: var(--ac-panel);
}
@media (min-width: 768px) { .ac-panel { padding: 20px 24px; } }

.ac-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-block-end: 12px;
}
.ac-search { flex: 1 1 260px; }
.ac-search input,
.ac-field input,
.ac-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--ac-line);
    background: rgba(7, 11, 17, 0.7);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
}
.ac-field textarea { resize: vertical; min-height: 72px; }
.ac-search input:focus-visible,
.ac-field input:focus-visible,
.ac-field textarea:focus-visible,
.ac-btn:focus-visible,
.ac-chip:focus-visible,
.ac-link:focus-visible { outline: 2px solid var(--ac-focus); outline-offset: 2px; }

.ac-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--ac-line);
    background: transparent;
    color: var(--ac-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.ac-chip[aria-pressed="true"] { border-color: var(--ac-cyan); background: rgba(6, 182, 212, 0.14); color: #fff; }

.ac-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--ac-line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--ac-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.ac-btn:hover { background: rgba(255, 255, 255, 0.1); }
.ac-btn:disabled { opacity: 0.55; cursor: wait; }
.ac-btn-primary { border-color: transparent; background: linear-gradient(90deg, #06b6d4, #4f46e5); color: #fff; }
.ac-btn-primary:hover { filter: brightness(1.1); background: linear-gradient(90deg, #06b6d4, #4f46e5); }
.ac-btn-danger { border-color: rgba(248, 113, 113, 0.45); color: #fecaca; }
.ac-btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.ac-link { background: none; border: 0; padding: 0; color: #67e8f9; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.ac-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ac-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.86rem; }
.ac-table th {
    padding: 10px 12px;
    text-align: start;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ac-muted);
    border-block-end: 1px solid var(--ac-line);
    white-space: nowrap;
}
.ac-table td { padding: 10px 12px; border-block-end: 1px solid rgba(255, 255, 255, 0.05); vertical-align: middle; }
.ac-table tr.is-open td { background: rgba(6, 182, 212, 0.07); }
.ac-code { font-family: 'Space Mono', ui-monospace, monospace; font-weight: 700; color: #fff; direction: ltr; unicode-bidi: isolate; }
.ac-num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ac-sub { display: block; color: var(--ac-muted); font-size: 0.75rem; }
.ac-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.ac-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: rgba(148, 163, 184, 0.12);
    color: var(--ac-muted);
}
.ac-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ac-badge[data-state="active"],
.ac-badge[data-state="converted"] { background: rgba(16, 185, 129, 0.14); color: var(--ac-green); }
.ac-badge[data-state="scheduled"],
.ac-badge[data-state="pending"] { background: rgba(6, 182, 212, 0.14); color: #67e8f9; }
.ac-badge[data-state="expired"],
.ac-badge[data-state="not_counted"] { background: rgba(245, 158, 11, 0.14); color: var(--ac-amber); }
.ac-badge[data-state="disabled"],
.ac-badge[data-state="failed"] { background: rgba(248, 113, 113, 0.12); color: var(--ac-red); }

.ac-empty { margin: 16px 0 4px; color: var(--ac-muted); text-align: center; }
.ac-error { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: rgba(248, 113, 113, 0.1); color: #fecaca; font-size: 0.85rem; }

.ac-detail { outline: none; }
.ac-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-block-end: 12px; }
.ac-detail-head h2 { margin: 0; font-size: 1.3rem; font-family: 'Space Mono', ui-monospace, monospace; color: #fff; }
.ac-detail-head .ac-btn { margin-inline-start: auto; }
.ac-detail h3 { margin: 20px 0 8px; font-size: 0.95rem; color: #fff; }
.ac-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 10px 20px; margin: 0; }
.ac-facts div { min-width: 0; }
.ac-facts dt { font-size: 0.75rem; color: var(--ac-muted); }
.ac-facts dd { margin: 2px 0 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.ac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; margin-block-start: 16px; }
.ac-stat { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--ac-line); background: rgba(7, 11, 17, 0.5); }
.ac-stat span { display: block; font-size: 0.72rem; color: var(--ac-muted); }
.ac-stat strong { display: block; margin-block-start: 2px; font-size: 1.2rem; color: #fff; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ac-stat.is-key strong { color: var(--ac-green); }
.ac-finance-link { margin: 12px 0 0; font-size: 0.85rem; }

.ac-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}
.ac-dialog {
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--ac-line, rgba(148, 163, 184, 0.18));
    background: #0f1626;
    color: #e2e8f0;
    font-family: 'Cairo', sans-serif;
}
.ac-dialog h2 { margin: 0 0 14px; font-size: 1.2rem; color: #fff; }
.ac-field { margin-block-end: 12px; }
.ac-field label { display: block; margin-block-end: 4px; font-size: 0.82rem; font-weight: 700; color: #cbd5e1; }
.ac-field input,
.ac-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(7, 11, 17, 0.7);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
}
.ac-field input:disabled { opacity: 0.65; }
.ac-field input[aria-invalid="true"] { border-color: #f87171; }
.ac-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 0 12px; }
.ac-hint { margin: 4px 0 0; font-size: 0.75rem; color: #94a3b8; }
.ac-form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 16px; }
.ac-dialog .ac-error { margin: 8px 0 0; padding: 8px 12px; border-radius: 8px; background: rgba(248, 113, 113, 0.1); color: #fecaca; font-size: 0.85rem; }
.ac-dialog .ac-btn { padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(148, 163, 184, 0.25); background: rgba(255, 255, 255, 0.05); color: #e2e8f0; font: inherit; font-weight: 700; cursor: pointer; }
.ac-dialog .ac-btn-primary { border-color: transparent; background: linear-gradient(90deg, #06b6d4, #4f46e5); color: #fff; }
.ac-dialog .ac-btn:focus-visible,
.ac-dialog input:focus-visible,
.ac-dialog textarea:focus-visible { outline: 2px solid #e0f2fe; outline-offset: 2px; }
