:root {
    --bg: #f4f6f8;
    --card: #ffffff;
    --text: #1a1d21;
    --muted: #6b7280;
    --border: #e3e6ea;
    --primary: #0d6e4f;
    --primary-dark: #0a5a40;
    --danger: #b3261e;
    --warning: #8a5a00;
    --warning-bg: #fff4d6;
    --radius: 14px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171a;
        --card: #1f2327;
        --text: #eef1f3;
        --muted: #9aa3ab;
        --border: #2c3136;
        --primary: #33c48f;
        --primary-dark: #29a87a;
        --danger: #ff6b63;
        --warning: #ffcf5c;
        --warning-bg: #3a2f0a;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.topbar-link { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 18px 16px 40px;
}

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

h1 { font-size: 1.4rem; margin: 0 0 6px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
p { margin: 0 0 12px; color: var(--text); }
.muted { color: var(--muted); font-size: 0.9rem; }

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 4px; margin-top: 14px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 14px 18px;
    border-radius: 10px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { background: var(--muted); cursor: not-allowed; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: var(--danger); }

.btn-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-success { background: #dff3e8; color: #0d6e4f; }
.alert-error { background: #fbe3e1; color: var(--danger); }
.alert-info { background: var(--warning-bg); color: var(--warning); }

.tariff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.tariff-option {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    background: var(--bg);
}
.tariff-option.selected { border-color: var(--primary); background: rgba(13, 110, 79, 0.08); }
.tariff-option .name { font-weight: 700; font-size: 0.95rem; }
.tariff-option .sub { font-size: 0.75rem; color: var(--muted); }
.tariff-option .price { font-size: 0.85rem; margin-top: 4px; }

.status-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.status-row:last-child { border-bottom: none; }
.status-row .val { font-weight: 700; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; }
.badge-free { background: #dff3e8; color: var(--primary); }
.badge-busy { background: var(--warning-bg); color: var(--warning); }
.badge-mine { background: #dbe9ff; color: #1d4ed8; }

.balance { font-size: 1.8rem; font-weight: 700; }

.topup-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.topup-option {
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    background: var(--bg);
    font-weight: 700;
}
.topup-option.selected { border-color: var(--primary); background: rgba(13, 110, 79, 0.08); }

.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: var(--muted);
}
.footer a { color: var(--muted); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table th, table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); }
