/* ==========================================================
 * Gym Center: tema iron gelap dengan aksen kuning
 * Judul memakai Barlow Condensed, isi memakai Barlow
 * ========================================================== */

:root {
    --bg: #17191d;
    --surface: #1f2228;
    --surface-2: #272b33;
    --line: #343942;
    --text: #ecebe6;
    --muted: #9aa1ad;
    --accent: #f5b700;
    --accent-ink: #17191d;
    --danger: #ff6b4a;
    --radius: 6px;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Barlow", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 2.6rem);
    line-height: 1.1;
}

.container {
    flex: 1;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 48px;
}

.judul-halaman {
    margin-bottom: 24px;
}

.judul-halaman p,
.muted {
    margin: 6px 0 0;
    color: var(--muted);
}

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    text-decoration: none;
}

.brand span {
    color: var(--accent);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.nav a {
    padding: 8px 12px;
    border-radius: var(--radius);
    color: var(--muted);
    text-decoration: none;
}

.nav a:hover,
.nav a.aktif {
    color: var(--text);
    background: var(--surface-2);
}

.nav a.keluar {
    color: var(--danger);
}

/* ---------- Notifikasi ---------- */
.flash {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--surface);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}

.flash-error {
    border-left-color: var(--danger);
}

.alert {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: rgba(255, 107, 74, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
}

.alert ul {
    margin: 6px 0 0;
    padding-left: 20px;
}

/* ---------- Kartu dan ringkasan ---------- */
.kartu {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.kartu-tabel {
    padding: 0;
    overflow: hidden;
}

.ringkasan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kartu-ringkas {
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.kartu-ringkas span {
    color: var(--muted);
    font-size: 0.9rem;
}

.kartu-ringkas strong {
    display: block;
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
}

.kartu-ringkas:last-child strong {
    color: var(--accent);
}

/* ---------- Tabel ---------- */
.tabel-wrap {
    overflow-x: auto;
}

.tabel {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tabel th,
.tabel td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.tabel th {
    background: var(--surface-2);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.tabel tbody tr:last-child td {
    border-bottom: none;
}

.tabel .angka {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.tabel .total {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

.tabel .kode {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.85rem;
}

.kosong {
    padding: 48px 16px;
    text-align: center;
}

.kosong p {
    margin: 0 0 20px;
    color: var(--muted);
}

/* ---------- Aksi baris tabel ---------- */
.aksi {
    display: flex;
    align-items: center;
    gap: 14px;
}

.aksi form {
    margin: 0;
}

.tautan {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    color: var(--accent);
    text-decoration: none;
    cursor: pointer;
}

.tautan:hover {
    text-decoration: underline;
}

.tautan-bahaya {
    color: var(--danger);
}

/* ---------- Tombol ---------- */
.tombol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: 600 1rem var(--font-body);
    text-decoration: none;
    cursor: pointer;
}

.tombol-utama {
    background: var(--accent);
    color: var(--accent-ink);
}

.tombol-utama:hover {
    filter: brightness(1.08);
}

.tombol-ghost {
    border-color: var(--line);
    background: transparent;
    color: var(--text);
}

.tombol-ghost:hover {
    background: var(--surface-2);
}

.tombol-penuh {
    width: 100%;
}

/* ---------- Form ---------- */
.form-transaksi,
.form-login {
    display: grid;
    gap: 22px;
}

.field {
    display: grid;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.field > label,
.field > legend {
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.2);
}

.pilihan {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.opsi {
    position: relative;
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.opsi input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.opsi:has(input:checked) {
    border-color: var(--accent);
    background: rgba(245, 183, 0, 0.08);
}

.opsi:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.opsi-judul {
    font-size: 1.05rem;
    font-weight: 600;
}

.opsi-harga {
    color: var(--muted);
    font-size: 0.9rem;
}

.aksi-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 8px;
}

/* ---------- Login ---------- */
.login-wrap {
    display: grid;
    place-items: center;
    min-height: 60vh;
}

.kartu-login {
    width: 100%;
    max-width: 400px;
}

.kartu-login .muted {
    margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.footer {
    padding: 16px 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

.footer p {
    margin: 0;
}

/* ---------- Layar kecil ---------- */
@media (max-width: 560px) {
    .container {
        padding: 24px 14px 40px;
    }

    .kartu {
        padding: 18px;
    }

    .aksi-form .tombol {
        flex: 1 1 auto;
    }
}
