:root {
    --bg: #0f172a;
    --card: #1e293b;
    --card-hover: #243347;
    --border: #334155;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 25px 50px -12px rgba(0,0,0,.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif;
    background: var(--bg);
    background-image: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.08) 0%, transparent 60%);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ===== Контейнер ===== */
.container {
    width: 100%;
    max-width: 520px;
    margin: auto;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

/* ===== Заголовок ===== */
h1 {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: -.3px;
}

h1 .icon { font-size: 1.6rem; }

/* ===== Поля ===== */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: .8rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.field input,
.field select {
    width: 100%;
    padding: 14px 16px;
    min-height: 48px; /* touch target */
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

.field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.field input::placeholder {
    color: #475569;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    min-height: 52px;
    background: var(--accent);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: var(--accent-hover); box-shadow: 0 4px 20px rgba(99,102,241,.3); }
.btn:active { transform: scale(.97); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #16a34a; box-shadow: 0 4px 20px rgba(34,197,94,.3); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 20px rgba(239,68,68,.3); }
.btn-sm {
    width: auto;
    padding: 8px 14px;
    min-height: 36px;
    font-size: .8rem;
    border-radius: 8px;
}

/* ===== Сообщения ===== */
.msg {
    padding: 14px 16px;
    border-radius: 10px;
    font-size: .875rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.msg-error {
    background: rgba(239,68,68,.08);
    border: 1px solid rgba(239,68,68,.25);
    color: #fca5a5;
}

.msg-success {
    background: rgba(34,197,94,.08);
    border: 1px solid rgba(34,197,94,.25);
    color: #86efac;
    margin-top: 20px;
}

.msg-success strong { color: #fff; }

/* ===== Курс (опционально) ===== */
.rate-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    color: var(--muted);
}

.rate-box strong { color: var(--text); font-size: 1rem; }

/* ===== Админка ===== */
.admin-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -24px;
    padding: 0 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
    min-width: 600px;
}

th {
    text-align: left;
    padding: 12px 10px;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(51,65,85,.5);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(99,102,241,.04); }

.wallet-cell {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: .78rem;
    color: var(--muted);
}

/* ===== Бейджи ===== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.badge-pending  { background: rgba(245,158,11,.12); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.badge-paid     { background: rgba(99,102,241,.12); color: #a5b4fc; border: 1px solid rgba(99,102,241,.3); }
.badge-done     { background: rgba(34,197,94,.12);  color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.badge-rejected { background: rgba(239,68,68,.12);  color: var(--danger); border: 1px solid rgba(239,68,68,.3); }

/* ===== Действия в таблице ===== */
.actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.actions form { display: flex; gap: 6px; align-items: center; }

.actions input[type="text"] {
    width: 80px;
    padding: 6px 8px;
    min-height: 36px;
    font-size: .75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
}

/* ===== Логин ===== */
.login-card {
    max-width: 380px;
    margin: auto;
}

/* ===== Мобильные ===== */
@media (max-width: 480px) {
    html { font-size: 15px; }
    body { padding: 12px; }
    .card { padding: 20px 16px; border-radius: 14px; }
    h1 { font-size: 1.25rem; margin-bottom: 20px; }
    .field { margin-bottom: 14px; }
    .field input, .field select { font-size: 1rem; padding: 14px 14px; }
    .btn { padding: 16px; font-size: 1rem; }
    .admin-table-wrap { margin: 0 -16px; padding: 0 16px; }
    .actions { flex-direction: column; align-items: stretch; }
    .actions form { flex-wrap: wrap; }
    .actions .btn-sm { width: 100%; }
}

@media (max-width: 360px) {
    .card { padding: 16px 12px; }
    .field input, .field select { font-size: .95rem; }
}

/* ===== Анимации ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeInUp .4s ease-out; }

/* ===== Scrollbar (WebKit) ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }   