:root {
    --color-primary: #6CBC5C;
    --color-primary-hover: #4C48B0;
    --color-accent: #0090ff;
    --color-dark: #0B215A;
    --color-text: #333;
    --color-muted: #666;
    --color-border: #dde3ea;
    --color-bg: #f4f6f9;
    --color-white: #fff;
    --radius: 8px;
    --shadow: 0 4px 20px rgba(11, 33, 90, 0.12);
    --font: Arial, Helvetica, sans-serif;
    --app-height: 100dvh;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    overscroll-behavior: none;
    font-family: var(--font);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.4;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Auth — без прокрутки страницы */
.auth-page {
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    background: linear-gradient(180deg, var(--color-dark) 0%, #1a3a7a 34%, var(--color-bg) 34%);
}

.auth-shell,
.app-shell,
.admin-shell {
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auth-wrapper {
    flex: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.auth-header {
    flex-shrink: 0;
    text-align: center;
    color: var(--color-white);
    margin-bottom: 8px;
}

.auth-logo-img {
    width: 56px;
    height: 56px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: var(--color-white);
    padding: 3px;
    object-fit: contain;
}

.auth-brand {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.auth-tagline {
    margin: 2px 0 0;
    font-size: 11px;
    opacity: 0.88;
    line-height: 1.2;
}

.auth-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px 12px;
}

.auth-card h1 {
    flex-shrink: 0;
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--color-dark);
    text-align: center;
}

.auth-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--color-border);
}

.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 7px 4px;
    color: var(--color-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    font-size: 13px;
}

.auth-tabs a.active {
    color: var(--color-dark);
    border-bottom-color: var(--color-primary);
}

.auth-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

.auth-form .form-group,
.captcha-group {
    display: block;
    flex-shrink: 0;
    margin-bottom: 8px;
}

.auth-form .form-group span,
.captcha-group > span {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    color: var(--color-dark);
    font-size: 12px;
}

.auth-form input,
.captcha-input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.auth-form input:focus,
.captcha-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0, 144, 255, 0.12);
}

.auth-form .btn-block {
    flex-shrink: 0;
    margin-top: auto;
    padding: 10px 16px;
    font-size: 14px;
}

.auth-footer {
    flex-shrink: 0;
    text-align: center;
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.2;
}

.auth-hint,
.auth-extra-link {
    flex-shrink: 0;
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.3;
}

.auth-extra-link {
    margin-top: 6px;
}

.verify-link-box {
    flex-shrink: 0;
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: #fff8e1;
    border: 1px solid #ffe082;
    overflow: hidden;
}

.verify-link-box strong {
    display: block;
    margin-bottom: 4px;
    color: var(--color-dark);
    font-size: 12px;
}

.verify-link-url {
    display: block;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert {
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.3;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Captcha */
.captcha-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.avtoline-captcha {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 150px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #0B215A 0%, #1a3a7a 55%, #6CBC5C 100%);
    border: 2px solid var(--color-primary);
    overflow: hidden;
    user-select: none;
}

.auth-form .form-group .avtoline-captcha-char,
.captcha-group .avtoline-captcha-char {
    display: inline-block;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    transform: rotate(var(--rot, 0deg));
}

.avtoline-captcha-noise {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        -45deg,
        rgba(255, 255, 255, 0.05) 0,
        rgba(255, 255, 255, 0.05) 2px,
        transparent 2px,
        transparent 6px
    );
    pointer-events: none;
}

.captcha-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-dark);
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.captcha-refresh:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

.captcha-input {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    color: var(--color-white);
}

.btn-secondary {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-secondary:hover {
    background: #16306e;
    color: var(--color-white);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12px;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}

.btn-danger:hover {
    background: #a51f1f;
    color: #fff;
}

.text-center {
    text-align: center;
}

.install-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

/* App page */
.app-page {
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    background: var(--color-bg);
}

.app-shell {
    background: var(--color-bg);
}

.app-topbar {
    position: relative;
    flex-shrink: 0;
    z-index: 120;
}

.app-header {
    position: relative;
    z-index: 140;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0));
    background: var(--color-dark);
    color: var(--color-white);
}

.app-logo {
    display: flex;
    flex-shrink: 0;
}

.app-header img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    object-fit: contain;
}

.app-header h1 {
    margin: 0;
    font-size: 16px;
    line-height: 1.2;
}

.app-header p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.85;
}

.app-header .btn {
    margin-left: auto;
    flex-shrink: 0;
}

.app-main {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-menu-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.app-menu-btn:hover,
.app-menu-btn[aria-expanded="true"] {
    background: rgba(108, 188, 92, 0.35);
}

.app-menu-btn-icon,
.app-menu-btn-icon::before,
.app-menu-btn-icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    position: relative;
}

.app-menu-btn-icon::before,
.app-menu-btn-icon::after {
    content: "";
    position: absolute;
    left: 0;
}

.app-menu-btn-icon::before {
    top: -6px;
}

.app-menu-btn-icon::after {
    top: 6px;
}

.app-menu-btn[aria-expanded="true"] .app-menu-btn-icon {
    background: transparent;
}

.app-menu-btn[aria-expanded="true"] .app-menu-btn-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.app-menu-btn[aria-expanded="true"] .app-menu-btn-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.app-menu-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 130;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(11, 33, 90, 0.15);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    pointer-events: auto;
}

.app-menu-panel[hidden] {
    display: none !important;
}

.app-menu-link {
    display: block;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-dark);
    border-bottom: 1px solid var(--color-border);
}

.app-menu-link:last-child {
    border-bottom: 0;
}

.app-menu-link:hover {
    background: #f4f7fb;
}

.app-menu-link.active {
    background: rgba(11, 33, 90, 0.08);
    color: var(--color-dark);
}

.app-menu-link-logout {
    color: #b42318;
}

.app-menu-backdrop {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 100dvh;
    background: rgba(11, 33, 90, 0.35);
    z-index: 110;
}

.app-menu-backdrop[hidden] {
    display: none !important;
}

body.app-menu-open {
    overflow: hidden;
}

.app-header-text {
    min-width: 0;
    flex: 1;
}

.wallet-chip {
    margin-left: auto;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 8px;
    padding: 6px 10px;
    line-height: 1.2;
}

.wallet-chip:hover {
    color: #fff;
    background: rgba(108, 188, 92, 0.35);
}

.wallet-chip-label {
    font-size: 10px;
    opacity: 0.8;
    text-transform: uppercase;
}

.wallet-chip strong {
    font-size: 14px;
}

.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
}

.card h2 {
    margin: 0 0 10px;
    font-size: 18px;
    color: var(--color-dark);
}

.tz-note {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--radius);
    background: #fff8e1;
    border: 1px solid #ffe082;
    color: var(--color-dark);
    font-size: 12px;
    line-height: 1.35;
}

.card .form-group {
    display: block;
    margin-bottom: 8px;
}

.card .form-group span {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 12px;
}

.field-hint {
    display: block;
    margin-top: 4px;
    color: var(--color-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
}

.kassa-wait {
    text-align: center;
    padding: 32px 16px;
}

.kassa-wait h2 {
    margin-bottom: 8px;
}

.kassa-wait p {
    color: var(--color-muted);
    margin: 0;
}

.kassa-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border: 4px solid #e4e8f0;
    border-top-color: var(--color-dark);
    border-radius: 50%;
    animation: kassa-spin 0.8s linear infinite;
}

@keyframes kassa-spin {
    to { transform: rotate(360deg); }
}

.card input,
.card select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
}

.muted {
    color: var(--color-muted);
    font-size: 13px;
}

.mt {
    margin-top: 10px;
}

.crumb {
    margin: 0;
    font-size: 13px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
}

.list-item-row {
    align-items: flex-start;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    padding: 8px 12px;
    border-radius: 20px;
    background: var(--color-dark);
    color: #fff;
    font-size: 13px;
}

.chip:hover {
    color: #fff;
    background: var(--color-primary-hover);
}

.cal {
    margin-top: 4px;
}

.cal-title {
    margin: 14px 0 8px;
    font-size: 15px;
    text-align: center;
    color: var(--color-dark);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-head {
    margin-bottom: 4px;
}

.cal-dow {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-muted);
    padding: 4px 0;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    min-height: 36px;
}

.cal-empty {
    visibility: hidden;
}

.cal-off {
    color: #9aa3b2;
    background: #f3f5f8;
}

.cal-on {
    background: var(--color-dark);
    color: #fff;
}

.cal-on:hover {
    background: var(--color-primary-hover);
    color: #fff;
}

.cal-today {
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.seat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 12px 0;
}

.seat {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    border: none;
    width: 100%;
}

.seat-free {
    background: var(--color-primary);
    color: #fff;
    cursor: pointer;
}

.seat-busy {
    background: #dde3ea;
    color: #888;
}

.hold-banner,
.countdown-line {
    display: block;
    padding: 8px 10px;
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-radius: var(--radius);
    color: var(--color-dark);
    font-size: 13px;
}

.wallet-balance {
    margin: 0 0 12px;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-dark);
}

.ops-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.op-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}

.op-row .muted,
.op-comment {
    display: block;
    font-size: 12px;
    color: var(--color-muted);
}

.op-sum {
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
}

.op-sum small {
    display: block;
    font-weight: 400;
    color: var(--color-muted);
}

.op-sum.plus {
    color: #2e7d32;
}

.op-sum.minus {
    color: #c62828;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.passenger-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.passenger-row strong {
    min-width: 0;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
}

.icon-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.icon-btn-edit {
    background: var(--color-dark);
    color: #fff;
}

.icon-btn-edit:hover {
    background: #16306e;
    color: #fff;
}

.icon-btn-delete {
    background: #c62828;
    color: #fff;
}

.icon-btn-delete:hover {
    background: #a51f1f;
    color: #fff;
}

button.linkish {
    border: none;
    background: none;
    color: var(--color-accent);
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.welcome-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
}

.welcome-card h2 {
    margin: 0 0 8px;
    color: var(--color-dark);
    font-size: 20px;
}

.welcome-card p {
    margin: 0;
}

.user-info {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.user-info li {
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}

.user-info li:last-child {
    border-bottom: none;
}

/* Admin */
.admin-page {
    height: var(--app-height);
    max-height: var(--app-height);
    overflow: hidden;
    background: var(--color-bg);
}

.admin-shell {
    background: var(--color-bg);
}

.admin-topbar {
    flex-shrink: 0;
    background: var(--color-dark);
    color: var(--color-white);
}

.admin-topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-white);
    font-weight: 700;
    font-size: 14px;
}

.admin-brand img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    object-fit: contain;
}

.admin-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    overflow: visible;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    white-space: nowrap;
}

.admin-nav a:hover {
    color: var(--color-primary);
}

.admin-main {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0));
    display: flex;
    flex-direction: column;
}

.admin-title {
    flex-shrink: 0;
    margin: 0 0 12px;
    color: var(--color-dark);
    font-size: 20px;
}

.admin-filters {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.admin-filters label {
    display: block;
}

.admin-filters label span {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-dark);
}

.admin-filters input,
.admin-filters select {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
}

.admin-filters-wide {
    grid-column: 1 / -1;
}

.admin-filters-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

@media (min-width: 900px) {
    .admin-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.admin-search {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.admin-search input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
}

.admin-pager {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 13px;
}

.admin-pager-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 16px;
}

.check-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.check-list .check-row {
    margin: 0;
    font-weight: 500;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 12px;
    font-weight: 600;
    color: var(--color-dark);
}

.check-row input {
    width: 18px;
    height: 18px;
}

.admin-card h2 {
    margin: 0 0 8px;
    font-size: 16px;
}

.admin-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 8px;
    color: var(--color-muted);
    font-size: 11px;
    border-top: 1px solid var(--color-border);
}

.stats-grid {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px 10px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
}

.stat-label {
    display: block;
    margin-top: 2px;
    color: var(--color-muted);
    font-size: 11px;
    line-height: 1.2;
}

.admin-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--color-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.admin-table th,
.admin-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef2f7;
    color: var(--color-dark);
    font-weight: 600;
}

.balance-form {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 140px;
}

.balance-form input[type="number"] {
    width: 88px;
    padding: 5px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
}

.inline-form {
    display: inline;
}

.inline-form select {
    padding: 4px 6px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-muted {
    background: #eceff1;
    color: #607d8b;
}

@media (max-width: 600px) {
    .admin-topbar-inner {
        flex-wrap: wrap;
    }

    .admin-nav {
        width: 100%;
        justify-content: space-between;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 12px 14px 10px;
    }
}

@media (max-height: 700px) {
    .auth-logo-img {
        width: 48px;
        height: 48px;
    }

    .auth-brand {
        font-size: 14px;
    }

    .auth-tagline {
        display: none;
    }

    .auth-card h1 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .auth-form .form-group,
    .captcha-group {
        margin-bottom: 6px;
    }

    .auth-form input,
    .captcha-input {
        padding: 7px 9px;
        font-size: 13px;
    }
}

/* PWA install bar */
.pwa-install-bar {
    flex-shrink: 0;
    display: block;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--color-dark);
    color: var(--color-white);
    border-top: 2px solid var(--color-primary);
    z-index: 100;
}

.pwa-install-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
}

.pwa-install-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.3;
}

.pwa-install-hint {
    max-width: 520px;
    margin: 6px auto 0;
    font-size: 11px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.pwa-install-hint[hidden] {
    display: none !important;
}

body.has-install-bar .auth-footer,
body.has-install-bar .admin-footer {
    display: none;
}

.dash-hello {
    padding: 2px 2px 0;
}

.dash-greet {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-dark);
}

a.card.dash-balance,
.dash-balance {
    display: block;
    background: linear-gradient(135deg, #0b215a, #1a4a9c);
    color: #fff;
    text-decoration: none;
}

a.card.dash-balance:hover,
.dash-balance:hover {
    color: #fff;
}

.dash-balance-label,
.dash-balance-hint,
.dash-balance-sum {
    display: block;
    color: #fff;
}

.dash-balance-label,
.dash-balance-hint {
    opacity: 0.8;
    font-size: 12px;
}

.dash-balance-sum {
    margin: 6px 0 8px;
    font-size: 28px;
    line-height: 1.1;
}

.dash-kassa-off {
    border: 1px solid #ffcdd2;
    background: #fff5f5;
}

.dash-hold {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff8e1;
    border: 1px solid #ffe082;
}

.dash-hold h2,
.dash-kassa-off h2 {
    margin-bottom: 6px;
}

nav.dash-actions,
.dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

a.dash-action,
.dash-action {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 8px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--color-text);
    min-width: 0;
}

a.dash-action:hover {
    color: var(--color-text);
}

.dash-action-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--color-dark);
}

.dash-action-sub {
    font-size: 11px;
    color: var(--color-muted);
    line-height: 1.25;
}

.dash-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

a.card.dash-stat,
.dash-stat {
    display: block;
    text-align: center;
    text-decoration: none;
    color: inherit;
    padding: 12px;
}

.dash-stat strong {
    display: block;
    font-size: 26px;
    color: var(--color-dark);
}

.dash-stat span {
    display: block;
    color: var(--color-muted);
    font-size: 12px;
}

.dash-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.dash-card-head h2 {
    margin: 0;
}

.dash-card-head a {
    font-size: 13px;
}

.dash-ticket {
    flex-direction: column;
    align-items: flex-start;
}

.dash-next-dir {
    margin: 10px 0 6px;
    font-size: 13px;
    color: var(--color-dark);
}

.dash-next-dir:first-of-type {
    margin-top: 0;
}

.dash-next-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dash-next-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 13px;
}

.dash-next-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.dash-next-row:hover {
    color: var(--color-dark);
}

.dash-next-seats {
    font-weight: 700;
    color: #2e7d32;
    white-space: nowrap;
}

.dash-next-seats.is-empty {
    color: #c62828;
}

.ticket-when {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--color-dark);
}

.ticket-dl {
    margin: 0;
}

.ticket-dl div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--color-border);
    font-size: 14px;
}

.ticket-dl dt {
    color: var(--color-muted);
    font-weight: 400;
}

.ticket-dl dd {
    margin: 0;
    text-align: right;
    font-weight: 700;
    color: var(--color-dark);
}

@media (min-width: 640px) {
    body.app-page,
    body.auth-page {
        background: #0a142e;
        display: flex;
        justify-content: center;
    }

    body.app-page .app-shell,
    body.auth-page .auth-shell {
        width: 430px;
        max-width: 430px;
        flex-shrink: 0;
        box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    }
}
