:root {
    --bg: #05080f;
    --surface: #101827;
    --surface-2: #151f2f;
    --border: #223249;
    --text: #edf2ff;
    --soft: #94a5c1;
    --primary: #f4b300;
    --primary-2: #ffc73c;
    --success: #22c55e;
    --danger: #ef4444;
    --radius: 16px;
    --space-1: 8px;
    --space-2: 12px;
    --space-3: 16px;
    --space-4: 20px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        radial-gradient(circle at 10% 10%, #15253f 0%, transparent 34%),
        radial-gradient(circle at 90% 20%, #3b220e 0%, transparent 30%),
        var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.4;
}

.page {
    min-height: 100dvh;
    padding: 24px 16px 100px;
}

.app {
    max-width: 980px;
    margin: 0 auto;
}

.panel {
    background: linear-gradient(180deg, rgba(16,24,39,0.96) 0%, rgba(8,12,20,0.96) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
}

.panel h1, .panel h2 { margin: 0 0 8px; }
.meta { margin: 0 0 14px; color: var(--soft); font-size: 14px; }
.title { margin: 0; font-size: 24px; line-height: 1.15; }
.presence { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.match, .card, .item { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid #2b3b54; margin-top: 10px; }
.wallet { margin-top: 10px; padding: 14px; border-radius: 12px; background: linear-gradient(145deg, #1cba72, #0f8754); color: #eafff3; font-weight: 800; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px 12px;
    align-items: end;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.span-2 { grid-column: span 2; }

label {
    color: #bfd0ec;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .03em;
}

input, select {
    width: 100%;
    height: 46px;
    border-radius: 10px;
    border: 1px solid #2b3b54;
    background: var(--surface-2);
    color: var(--text);
    padding: 0 12px;
    outline: none;
}

input:focus, select:focus {
    border-color: #4d6a98;
    box-shadow: 0 0 0 2px rgba(116, 154, 219, 0.22);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #9db0cb 50%), linear-gradient(135deg, #9db0cb 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.btn {
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    padding: 0 16px;
}

.btn-primary {
    background: linear-gradient(180deg, var(--primary-2) 0%, var(--primary) 100%);
    color: #10151f;
}

.btn-outline-success { border: 1px solid #245738; color: #7dedaa; background: var(--surface-2); }
.btn-outline-danger { border: 1px solid #5f2632; color: #ff98a8; background: var(--surface-2); }
.btn-yes { border: 1px solid #245738; color: #7dedaa; background: var(--surface-2); }
.btn-no { border: 1px solid #5f2632; color: #ff98a8; background: var(--surface-2); }

.message-ok { margin-top: 12px; color: #86efac; }
.message-error { margin-top: 12px; color: #fda4af; }
.badge {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #2d3e5e;
    border-radius: 10px;
    background: #141f31;
    font-size: 12px;
    font-weight: 700;
}
.status-badge {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #2d3e5e;
    border-radius: 10px;
    background: #141f31;
    color: #d1def4;
    font-size: 12px;
    font-weight: 700;
}
.status-error {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #5f2632;
    border-radius: 10px;
    background: #141f31;
    color: #fda4af;
    font-size: 12px;
    font-weight: 700;
}

.table { width: 100%; border-collapse: collapse; margin-top: 14px; }
.table th, .table td { padding: 12px 10px; border-bottom: 1px solid #213149; text-align: left; font-size: 14px; }
.table th { color: #9db0cb; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
.table-inline-form { display: flex; gap: 8px; align-items: center; }
.table-inline-form select { height: 38px; font-size: 13px; padding: 0 10px; }
.btn-sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.status-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border: 1px solid transparent; }
.pill-active { color: #86efac; background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.35); }
.pill-inactive { color: #fde68a; background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.35); }
.pill-blocked { color: #fda4af; background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.35); }
.pill-paid { color: #86efac; background: rgba(34,197,94,.15); border-color: rgba(34,197,94,.35); }
.pill-unpaid { color: #fda4af; background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.35); }

.module-grid { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.module { min-height: 96px; padding: 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.08); display: flex; align-items: end; font-weight: 700; color: #f4f8ff; text-decoration: none; }
.m-blue { background: linear-gradient(145deg, #2754f0, #1937a8); }
.m-green { background: linear-gradient(145deg, #1cba72, #0f8754); }
.m-orange { background: linear-gradient(145deg, #f59e0b, #c47400); }
.m-purple { background: linear-gradient(145deg, #9f4cff, #7131c0); }

.lineup { display: grid; gap: 8px; margin-top: 8px; }
.player { background: #0f2331; border: 1px solid #1d3a52; border-radius: 12px; padding: 11px 12px; display: flex; justify-content: space-between; align-items: center; }
.player span { color: var(--soft); font-size: 12px; }
.tag { min-width: 28px; min-height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #113527; color: #89f0b5; border: 1px solid #255b44; }

.nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(980px, calc(100% - 18px));
    padding: 10px;
    border-radius: 16px;
    border: 1px solid #213149;
    background: rgba(10, 16, 26, 0.95);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    backdrop-filter: blur(8px);
}

.nav a {
    min-height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #9db0cb;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.nav a.active {
    background: #1a2840;
    color: #ffcb46;
    border: 1px solid #364f73;
}

@media (max-width: 768px) {
    .page { padding: 16px 12px 98px; }
    .panel { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .field.span-2 { grid-column: auto; }
    .presence, .row, .module-grid { grid-template-columns: 1fr; }
    .table th, .table td { padding: 10px 8px; font-size: 13px; }
}
