:root {
    --blue: #1456a3;
    --blue-dark: #061428;
    --black: #080b12;
    --bg: #f2f5fb;
    --card: #ffffff;
    --text: #101828;
    --muted: #667085;
    --line: #d9e1ef;
    --danger: #d92d20;
    --ok: #067647;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 84px;
}

.topbar {
    background: linear-gradient(135deg, var(--black), var(--blue-dark));
    color: white;
    padding: 18px;
    border-bottom: 4px solid var(--blue);
}

.brand { display: flex; gap: 14px; align-items: center; }
.brand img { width: 54px; height: 54px; border-radius: 14px; background: white; padding: 5px; }
.small { color: #b9c7ee; font-size: 14px; }
.title { font-size: 28px; font-weight: 900; }

main { max-width: 1050px; margin: auto; padding: 18px; }
h1 { font-size: 28px; margin: 12px 0 18px; color: var(--blue-dark); }
h2 { color: var(--blue-dark); margin-top: 28px; }

.card, .metric, table {
    background: var(--card);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(16,24,40,.08);
}

.login { max-width: 430px; margin: 30px auto; padding: 22px; }
.form { padding: 18px; display: grid; gap: 10px; margin-bottom: 20px; max-width: 520px; }

label { font-weight: 700; }
input, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px;
    font-size: 16px;
}

button, .primary, .tile, .smallbtn {
    border: none;
    border-radius: 14px;
    background: var(--blue);
    color: white;
    padding: 13px 16px;
    text-decoration: none;
    font-weight: 800;
    display: inline-block;
    text-align: center;
}

.metric {
    padding: 18px;
    margin-bottom: 18px;
    border-left: 6px solid var(--blue);
}
.metric span { display: block; color: var(--muted); margin-bottom: 6px; }
.metric b { font-size: 32px; }
.metric.big b { font-size: 44px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.tile {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--black);
}

.drink-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 14px;
}
.drink-grid form { margin: 0; }
.drink-btn {
    width: 100%;
    min-height: 115px;
    background: var(--black);
    border: 2px solid var(--blue);
    display: grid;
    place-items: center;
}
.drink-btn span { font-size: 22px; }
.drink-btn b { font-size: 18px; color: #c7d7ff; }

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    margin-bottom: 24px;
}
th { background: #e8efff; color: var(--blue-dark); }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.debt { color: var(--danger); font-weight: 900; }
.ok { color: var(--ok); font-weight: 900; }
.hint { color: var(--muted); }
.flash { background: #fff4cc; border-left: 6px solid #fdb022; padding: 12px; border-radius: 12px; margin-bottom: 16px; }

.bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;
    background: rgba(8,11,18,.96);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 22px;
    display: grid;
    grid-auto-flow: column;
    gap: 4px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.bottom-nav a {
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 10px 4px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 13px;
}
.bottom-nav a:hover { background: var(--blue); }

@media (max-width: 680px) {
    main { padding: 14px; }
    .title { font-size: 24px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
    .drink-grid { grid-template-columns: repeat(2, 1fr); }
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 800;
    font-size: 13px;
}

.badge.active {
    background: #dcfce7;
    color: #166534;
}

.badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.smallbtn.dark {
    background: var(--black);
}

.checkbox-label {
    display: flex;
    gap: 10px;
    align-items: center;
}

.checkbox-label input {
    width: auto;
}

.danger-zone {
    border-left: 6px solid var(--danger);
}

.danger-btn {
    background: var(--danger);
}


.tile.blue {
    background: var(--blue);
}

.info-card {
    padding: 18px;
    margin-bottom: 20px;
}

.info-card h2 {
    margin-top: 0;
}

code {
    background: #e8efff;
    color: var(--blue-dark);
    padding: 2px 5px;
    border-radius: 6px;
}


.login-logo {
    width: 150px;
    height: 150px;
    display: block;
    object-fit: contain;
    margin: 0 auto 14px auto;
}

.brand img {
    object-fit: contain;
    background: transparent;
    padding: 0;
}

.credit {
    color: #1456a3;
    font-weight: 900;
}

.penalty-card {
    background: var(--card);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(16,24,40,.08);
    border: 1px solid var(--line);
    padding: 16px;
    display: grid;
    gap: 10px;
}

.penalty-title {
    font-weight: 900;
    font-size: 18px;
}

.penalty-price {
    font-size: 26px;
    color: var(--blue);
    font-weight: 900;
}

.small-action {
    width: 100%;
    background: var(--black);
}

.blue-action {
    background: var(--blue);
}


.logout-tile {
    background: #2f3542;
}

.fullwidth {
    width: 100%;
    margin-bottom: 18px;
}

.penalty-list {
    margin-top: 18px;
}


.section-spacer {
    margin-top: 42px;
    padding-top: 18px;
    border-top: 2px solid var(--line);
}

.counter-row {
    display: grid;
    grid-template-columns: 1fr 64px 1fr;
    align-items: center;
    gap: 10px;
}

.counter-row form {
    margin: 0;
}

.counter-btn {
    width: 100%;
    min-height: 52px;
    font-size: 30px;
    line-height: 1;
    border-radius: 16px;
}

.counter-btn.minus {
    background: #2f3542;
}

.counter-btn.plus {
    background: var(--blue);
}

.counter-value {
    text-align: center;
    font-size: 26px;
    font-weight: 900;
}


/* v14 Dashboard Refresh */
body {
    background:
        radial-gradient(circle at 50% 0%, rgba(20, 86, 163, .12), transparent 38%),
        #f3f6fb;
}

.topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 34px;
    border-bottom: 4px solid var(--blue);
}

.brand img {
    width: 58px;
    height: 58px;
}

.brand .small {
    font-size: 15px;
    font-weight: 700;
}

.brand .title {
    font-size: 34px;
    line-height: 1;
}

.burger-menu {
    position: relative;
    z-index: 40;
}

.burger-menu summary {
    list-style: none;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: grid;
    place-content: center;
    gap: 6px;
    cursor: pointer;
}

.burger-menu summary::-webkit-details-marker {
    display: none;
}

.burger-menu summary span {
    display: block;
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: white;
}

.burger-dropdown {
    position: absolute;
    top: 62px;
    right: 0;
    width: 220px;
    background: rgba(8, 11, 18, .96);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0,0,0,.32);
    overflow: hidden;
}

.burger-dropdown::before {
    content: "";
    position: absolute;
    right: 20px;
    top: -9px;
    width: 18px;
    height: 18px;
    background: rgba(8, 11, 18, .96);
    transform: rotate(45deg);
    border-left: 1px solid rgba(255,255,255,.12);
    border-top: 1px solid rgba(255,255,255,.12);
}

.burger-dropdown a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.burger-dropdown a + a {
    border-top: 1px solid rgba(255,255,255,.12);
}

.menu-icon {
    width: 24px;
}

main {
    max-width: 1120px;
    padding-top: 28px;
}

.dashboard h1 {
    font-size: 28px;
    margin-bottom: 20px;
}

.balance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-bottom: 34px;
}

.metric {
    border-left: 5px solid var(--blue);
}

.metric.big {
    min-height: 116px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric.big b {
    font-size: 48px;
    line-height: 1;
}

.primary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-bottom: 18px;
}

.big-action {
    min-height: 92px;
    border-radius: 18px;
    background: linear-gradient(135deg, #1764bf, #0649a4);
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: 28px;
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(20, 86, 163, .28);
}

.action-icon {
    font-size: 34px;
}

.secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 26px;
    margin-bottom: 30px;
}

.pay-action {
    min-height: 58px;
    border: 2px solid var(--blue);
    border-radius: 14px;
    color: var(--blue);
    background: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 19px;
    font-weight: 900;
}

.history-card {
    background: white;
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 8px 24px rgba(16,24,40,.08);
}

.history-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px 0;
    color: var(--black);
}

.history-card p {
    margin: 0 0 16px 0;
}

.history-card table {
    box-shadow: none;
    margin-bottom: 0;
}

.history-card th {
    background: #eaf1ff;
}

.bottom-nav {
    grid-auto-flow: unset;
    grid-template-columns: repeat(5, 1fr);
    max-width: none;
}

.bottom-nav a {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    font-size: 15px;
}

.bottom-nav a.active {
    color: #2b8cff;
}

.logout-tile {
    display: none;
}

@media (max-width: 780px) {
    .topbar {
        padding: 18px;
    }

    .brand .title {
        font-size: 28px;
    }

    .balance-grid,
    .primary-actions,
    .secondary-actions {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .big-action {
        font-size: 23px;
        min-height: 78px;
    }

    .metric.big b {
        font-size: 42px;
    }

    .burger-dropdown {
        right: -6px;
    }
}

@media (max-width: 520px) {
    .bottom-nav a {
        font-size: 12px;
        flex-direction: column;
        gap: 3px;
    }

    .brand img {
        width: 48px;
        height: 48px;
    }

    .brand .small {
        font-size: 12px;
    }

    .brand .title {
        font-size: 24px;
    }
}


/* v15 Admin Cleanup */
.admin-dashboard h1 {
    margin-bottom: 22px;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

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

.admin-tile {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    min-height: 92px;
    color: var(--black);
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(16,24,40,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 900;
    text-align: center;
    padding: 16px;
}

.admin-tile span {
    font-size: 26px;
}

.badge.neutral {
    background: #e5e7eb;
    color: #374151;
}
