@import url("https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css");

:root {
    --bg: #0a0a0a;
    --bg-card: #161616;
    --bg-card-2: #1e1e1e;
    --border: #2a2a2a;
    --text: #f5f5f5;
    --text-dim: #9a9a9a;
    --white: #ffffff;
    --green-bg: rgba(46, 204, 113, 0.10);
    --green-text: #2ecc71;
    --red-bg: rgba(231, 76, 60, 0.10);
    --red-text: #e74c3c;
    --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    text-align: right;
    -webkit-tap-highlight-color: transparent;
}

body {
    padding: 16px;
    padding-bottom: 32px;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
}

.header {
    text-align: center;
    padding: 12px 0 18px;
}
.header h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    letter-spacing: .5px;
}
.header p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-dim);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
}
.card .label {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.card .value {
    font-size: 18px;
    font-weight: 700;
}

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 14px;
}

.tx-row {
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.tx-row.credit { background: var(--green-bg); }
.tx-row.debit { background: var(--red-bg); }
.tx-row.pending { background: rgba(243, 156, 18, 0.12); }
.tx-row .tx-desc { color: var(--text); }
.tx-row .tx-date { color: var(--text-dim); font-size: 11px; display: block; margin-top: 2px; }
.tx-row .tx-amount.credit { color: var(--green-text); font-weight: 700; }
.tx-row .tx-amount.debit { color: var(--red-text); font-weight: 700; }
.tx-row .tx-amount.pending { color: #f39c12; font-weight: 700; }
.tx-row .tx-suffix-note { color: var(--text-dim); font-size: 10px; text-align: left; margin-top: 2px; }

.btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 14px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    background: var(--white);
    color: #0a0a0a;
    margin-top: 10px;
}
.btn.secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn:disabled { opacity: .4; }

input[type="text"], input[type="tel"], textarea {
    width: 100%;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 15px;
    padding: 14px;
    text-align: center;
    direction: ltr;
}
textarea { text-align: right; direction: rtl; min-height: 90px; resize: vertical; }

.copy-box {
    background: var(--bg-card-2);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 14px;
    text-align: center;
    font-size: 17px;
    letter-spacing: 1px;
    direction: ltr;
    cursor: pointer;
    position: relative;
}
.copy-box .copy-hint {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: var(--text-dim);
    direction: rtl;
}
.copy-box.copied { border-color: var(--green-text); }

.muted { color: var(--text-dim); font-size: 12px; }
.center { text-align: center; }
.mt8 { margin-top: 8px; }
.mt16 { margin-top: 16px; }

.empty-state {
    text-align: center;
    color: var(--text-dim);
    padding: 40px 10px;
    font-size: 13px;
}

.badge {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid var(--border);
}
.badge.open { color: #f39c12; border-color: #f39c12; }
.badge.answered { color: var(--green-text); border-color: var(--green-text); }
.badge.closed { color: var(--text-dim); }

.ticket-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}
.ticket-item .t-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ticket-item .t-sub { margin-top: 4px; font-size: 13px; color: var(--text-dim); }

.bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.6;
}
.bubble.user { background: var(--white); color: #0a0a0a; margin-right: auto; border-bottom-right-radius: 4px; }
.bubble.admin { background: var(--bg-card-2); color: var(--text); margin-left: auto; border-bottom-left-radius: 4px; }

.loader {
    width: 22px; height: 22px;
    border: 3px solid var(--border);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    color: #0a0a0a;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 700;
    opacity: 0;
    transition: opacity .25s;
    pointer-events: none;
    z-index: 999;
}
.toast.show { opacity: 1; }
