:root {
    --bg-0: #131518;
    --bg-1: #181b20;
    --bg-2: #1f2329;
    --bg-3: #272c34;
    --border: rgba(255, 255, 255, 0.06);
    --text: #d8dce3;
    --text-muted: #8b919c;
    --primary: #7a8ea3;
    --primary-hover: #8a9db3;
    --primary-soft: rgba(122, 142, 163, 0.12);
    --accent: #8fa4b8;
    --accent-soft: rgba(143, 164, 184, 0.14);
    --success: #6fa88a;
    --success-soft: rgba(111, 168, 138, 0.12);
    --error: #c48f8f;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --app-max-width: 1580px;
    --records-min-width: 1180px;
    --records-cols: minmax(88px, 1.2fr) 118px 138px 125px minmax(168px, 1.25fr) minmax(168px, 1.15fr) 72px;
}

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

html {
    scroll-behavior: smooth;
}

* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
    background: transparent;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-0);
    line-height: 1.5;
}

body.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}

.app-shell .container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 16px;
    overflow: hidden;
}


.app-shell .feed-toolbar {
    flex-shrink: 0;
}

.app-shell .feed-card-chat {
    flex: 1;
    min-height: 0;
    max-height: none;
}

.app-shell .form-bar {
    position: relative;
    flex-shrink: 0;
}

.app-bg,
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 0%, rgba(122, 142, 163, 0.07), transparent 38%),
        radial-gradient(circle at 88% 8%, rgba(111, 168, 138, 0.05), transparent 32%),
        linear-gradient(180deg, #131518 0%, #181b20 100%);
}

svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(19, 21, 24, 0.88);
    backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-right {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    position: relative;
    z-index: 110;
    pointer-events: auto;
}

.topbar-left h1 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-left p,
.topbar-left .brand-meta {
    margin: 2px 0 0;
}

.topbar-left .brand-meta {
    font-size: 0.75rem;
}

.brand-title {
    margin: 0;
    line-height: 1.15;
}

.brand-title-lg {
    font-size: 1.55rem;
    letter-spacing: -0.03em;
}

.brand-glow {
    position: relative;
    display: inline-block;
    background: linear-gradient(
        118deg,
        #f3f6fa 0%,
        #d4e8de 28%,
        #b8cad9 52%,
        #dfe8f0 78%,
        #eef2f6 100%
    );
    background-size: 180% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: brand-shimmer 8s ease-in-out infinite;
    filter: drop-shadow(0 0 14px rgba(143, 164, 184, 0.28));
}

.brand-glow::before {
    content: '';
    position: absolute;
    inset: 0.08em -0.12em -0.04em;
    border-radius: 8px;
    background: linear-gradient(
        120deg,
        rgba(111, 168, 138, 0.18),
        rgba(143, 164, 184, 0.22),
        rgba(111, 168, 138, 0.12)
    );
    filter: blur(10px);
    opacity: 0.75;
    z-index: -1;
}

.brand-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.brand-sub {
    color: var(--text-muted);
}

.brand-meta-dot {
    opacity: 0.45;
}

.brand-version {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #d7e4ec;
    background: linear-gradient(135deg, rgba(122, 142, 163, 0.22), rgba(111, 168, 138, 0.16));
    border: 1px solid rgba(143, 164, 184, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 12px rgba(122, 142, 163, 0.12);
}

@keyframes brand-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.logo-badge {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(122, 142, 163, 0.18), rgba(111, 168, 138, 0.12));
    border: 1px solid rgba(143, 164, 184, 0.22);
    color: #b8cad9;
    box-shadow: 0 0 18px rgba(122, 142, 163, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Переключатель таблиц в шапке */
.ledger-switch {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    padding: 3px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
    pointer-events: auto;
    touch-action: manipulation;
}

.ledger-tab {
    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.ledger-tab-short {
    display: none;
}

.ledger-tab:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.ledger-tab.is-active {
    color: #eef2f6;
    background: linear-gradient(135deg, rgba(111, 168, 138, 0.28), rgba(111, 168, 138, 0.12));
    border-color: rgba(111, 168, 138, 0.35);
    box-shadow: 0 4px 14px rgba(111, 168, 138, 0.15);
}

body.ledger-home .ledger-tab.is-active {
    background: linear-gradient(135deg, rgba(143, 164, 184, 0.3), rgba(143, 164, 184, 0.12));
    border-color: rgba(143, 164, 184, 0.38);
    box-shadow: 0 4px 14px rgba(143, 164, 184, 0.12);
}

.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 140px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-2);
    flex-shrink: 0;
    min-width: 0;
}

.user-badge-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6d8296, #8499ad);
    font-size: 0.75rem;
    font-weight: 700;
    color: #eef2f6;
    flex-shrink: 0;
}

.user-badge-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

body.ledger-home .brand-sub {
    color: #b8c8d8;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.field-home-only.hidden,
.field-main-only.hidden {
    display: none !important;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6d8296, #8499ad);
    font-size: 0.72rem;
    font-weight: 700;
    color: #eef2f6;
}

.container {
    max-width: var(--app-max-width);
    margin: 0 auto;
    padding: 20px 24px 160px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mini-stat {
    padding: 16px 18px;
    border-radius: var(--radius);
    background: rgba(17, 17, 20, 0.88);
    border: 1px solid var(--border);
}

.mini-stat.accent {
    background: linear-gradient(135deg, rgba(122, 142, 163, 0.1), rgba(24, 27, 32, 0.92));
    border-color: rgba(122, 142, 163, 0.16);
}

.mini-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mini-stat strong {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.feed-card {
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--border);
    background: rgba(24, 27, 32, 0.82);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-card-chat,
.feed-card-chat {
    display: flex;
    flex-direction: column;
    min-height: 320px;
}

.table-card-chat .table-wrap,
.feed-card-chat .feed-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
    scroll-behavior: auto;
    overscroll-behavior: contain;
    padding: 0 6px 8px;
}

.records-feed {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.feed-empty,
.feed-loading {
    margin: 14px 10px;
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(14, 14, 18, 0.5);
}

.list-anchor {
    width: 100%;
    height: 1px;
    flex-shrink: 0;
    pointer-events: none;
}

.day-records {
    margin: 0;
    border-left: none;
    border-right: none;
    background: transparent;
    overflow: hidden;
}

.day-records-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.day-records-head,
.record-row {
    display: grid;
    grid-template-columns: var(--records-cols);
    gap: 0;
    align-items: center;
    width: 100%;
    min-width: var(--records-min-width);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.records-table {
    width: 100%;
}

.day-records-head {
    position: sticky;
    top: 0;
    z-index: 3;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(28, 31, 37, 0.96);
    backdrop-filter: blur(8px);
    color: var(--text-muted);
    font-size: var(--ts-header-label-size, 0.65rem);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.records-cell {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: var(--ts-row-padding-y, 10px) var(--ts-cell-padding-x, 8px);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
}

.records-cell:last-child {
    border-right: none;
}

.day-records-head .records-cell,
.day-records-head .sort-col {
    padding: 8px var(--ts-cell-padding-x, 8px);
    white-space: nowrap;
}

.day-records-head .records-cell:first-child,
.records-cell:first-child {
    padding-left: 12px;
}

.day-records-head .records-cell-num,
.records-cell-num {
    justify-content: flex-end;
    text-align: right;
}

.day-records-head .records-cell-team {
    justify-content: center;
    text-align: center;
}

.record-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.record-row:last-child {
    border-bottom: none;
}

.record-row:hover {
    background: rgba(255, 255, 255, 0.025);
}

.ts-no-row-hover .record-row:hover {
    background: transparent;
}

.ts-zebra-rows .day-records .record-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.022);
}

.ts-no-row-borders .record-row {
    border-bottom: none;
}

.ts-no-animate-new .record-row.is-new {
    animation: none;
}

.ts-no-search-highlight .record-row.is-highlight {
    background: transparent;
}

.record-row.is-highlight {
    background: rgba(122, 142, 163, 0.1);
}

.record-row.is-dimmed {
    opacity: 0.35;
}

.record-client {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.record-name {
    flex: 1;
    min-width: 0;
    font-size: var(--ts-row-font-size, 0.88rem);
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: var(--ts-name-line-clamp, 2);
    -webkit-box-orient: vertical;
    word-break: break-word;
    cursor: text;
}

.record-name.editable:hover {
    color: var(--accent);
}

.record-id {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.68rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.records-cell-team {
    justify-content: center;
    overflow: visible;
}

.team-badges {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
    flex-shrink: 0;
}

.team-badge {
    flex-shrink: 0;
    min-width: 24px;
    justify-content: center;
    padding: 3px 7px;
    font-size: 0.7rem;
}

.records-cell-percent {
    min-width: 0;
    overflow: hidden;
}

.record-percent {
    display: block;
    width: 100%;
    font-size: var(--ts-row-font-size, 0.88rem);
    color: var(--text-muted);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.record-total-split {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    justify-content: flex-end;
    overflow: hidden;
}

.record-total-part {
    display: inline-flex;
    flex-shrink: 0;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(143, 164, 184, 0.1);
    color: #b8c5d3;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.record-total-inline {
    display: block;
    width: 100%;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b8c5d3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.record-total-main {
    display: block;
    width: 100%;
    font-size: 0.72rem;
    font-weight: 600;
    color: #b8c5d3;
    text-align: right;
    white-space: nowrap;
}

.record-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-shrink: 0;
    padding-right: 6px;
}

.record-actions .btn-icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.record-row .badge-amount,
.record-row .badge-rate {
    width: auto;
    max-width: 100%;
    justify-content: flex-end;
    padding: 4px 8px;
    font-size: var(--ts-row-font-size, 0.88rem);
    white-space: nowrap;
}

.copyable {
    cursor: copy;
}

.copyable:hover {
    filter: brightness(1.08);
}

body.density-compact .record-row .records-cell {
    padding-top: 6px;
    padding-bottom: 6px;
}

body.density-compact .record-row .badge {
    padding: 2px 5px;
    font-size: 0.68rem;
}

.feed-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(24, 27, 32, 0.82);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.toolbar-search-wrap {
    flex: 1 1 200px;
    position: relative;
}

.toolbar-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.toolbar-search {
    width: 100%;
    padding: 9px 32px 9px 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
}

.toolbar-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}

.toolbar-today {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(111, 168, 138, 0.08);
    border: 1px solid rgba(111, 168, 138, 0.14);
}

.sort-col {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.sort-col:hover {
    color: var(--text);
}

.sort-col.is-active {
    color: var(--text);
}

.sort-col.is-active::after {
    content: ' ↓';
    opacity: 0.7;
}

.sort-col.is-active.is-asc::after {
    content: ' ↑';
}

.day-block.is-collapsed .day-records {
    display: none;
}

.day-block-head-inner--collapsible {
    cursor: pointer;
}

.record-row.is-new {
    animation: row-flash 1.2s ease;
}

@keyframes row-flash {
    0% { background: rgba(111, 168, 138, 0.22); }
    100% { background: transparent; }
}

.toolbar-counter {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.toolbar-actions {
    flex-wrap: wrap;
    margin-left: auto;
}

.form-preview {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px dashed rgba(122, 142, 163, 0.22);
    background: rgba(122, 142, 163, 0.06);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.toast-stack {
    position: fixed;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(28, 31, 37, 0.96);
    color: var(--text);
    font-size: 0.82rem;
    box-shadow: var(--shadow);
    animation: toast-in 0.2s ease;
}

.toast-action {
    margin-left: 10px;
    padding: 0;
    border: none;
    background: none;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .toolbar-actions {
        margin-left: 0;
        width: 100%;
    }

    .records-cell {
        padding: 8px 6px;
        font-size: 0.72rem;
    }
}

.time-main {
    display: block;
    font-weight: 600;
}

.time-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-amount {
    background: rgba(122, 142, 163, 0.12);
    color: #aebdcf;
}

.badge-rate {
    background: rgba(111, 168, 138, 0.1);
    color: #9ebfae;
    white-space: nowrap;
}

.badge-total {
    background: rgba(143, 164, 184, 0.12);
    color: #b8c5d3;
}

/* Day blocks */
.day-block {
    margin: 0 4px;
}

.day-block-head-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 12px 6px 0;
    padding: 12px 16px 10px;
    border-radius: 14px 14px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: none;
    background: rgba(28, 31, 37, 0.88);
}

.day-block-head-inner--today {
    border-color: rgba(111, 168, 138, 0.18);
    background: linear-gradient(135deg, rgba(111, 168, 138, 0.08), rgba(28, 31, 37, 0.92));
    box-shadow: inset 0 1px 0 rgba(111, 168, 138, 0.08);
}

.day-block + .day-block .day-block-head-inner {
    margin-top: 18px;
}

.day-block-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 0;
}

.day-block-date {
    font-size: var(--ts-day-header-size, 1.02rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--text);
    text-transform: none;
}

.day-block-today-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #d7ebe0;
    background: rgba(111, 168, 138, 0.16);
    border: 1px solid rgba(111, 168, 138, 0.22);
}

.day-summary-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.day-summary-toggle:hover {
    background: var(--accent-soft);
    border-color: rgba(143, 164, 184, 0.22);
    color: var(--text);
}

.day-summary-toggle.is-open {
    background: rgba(122, 142, 163, 0.14);
    border-color: rgba(122, 142, 163, 0.24);
    color: var(--text);
}

.day-block-head-inner--today .day-block-date {
    color: #dde8e2;
}

.day-block-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.day-block:not(:has(.day-summary-panel.is-open)) .day-records {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0 0 14px 14px;
}

.day-block--today .day-records,
.day-block--today .day-summary-panel {
    border-left-color: rgba(111, 168, 138, 0.12);
    border-right-color: rgba(111, 168, 138, 0.12);
}


.day-summary-panel {
    display: none;
    margin: 0 6px 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(122, 142, 163, 0.12);
    border-radius: 0 0 14px 14px;
    background: rgba(31, 35, 41, 0.92);
}

.day-summary-panel.is-open {
    display: block;
}

.day-block:has(.day-summary-panel.is-open) .day-records {
    border-bottom: none;
    border-radius: 0;
}

.day-summary-panel strong {
    color: var(--text);
}

.day-summary {
    display: grid;
    gap: 14px;
}

.day-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.day-summary-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.day-summary-title strong {
    font-size: 0.88rem;
    font-weight: 600;
    text-transform: none;
}

.day-summary-badge {
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.day-summary-badge.is-today {
    background: var(--success-soft);
    border-color: rgba(111, 168, 138, 0.22);
    color: #b5d4c4;
}

.day-summary-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.day-summary-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.day-total-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.day-total-item strong {
    font-size: 0.88rem;
    color: var(--text);
    word-break: break-word;
}

.day-total-item-accent {
    background: rgba(122, 142, 163, 0.1);
    border-color: rgba(122, 142, 163, 0.18);
}

.day-total-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.day-summary-teams {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.day-team-card {
    padding: 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--team-color) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--team-color) 28%, transparent);
    display: grid;
    gap: 4px;
}

.day-team-card.is-empty {
    opacity: 0.45;
}

.day-team-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--team-color);
}

.day-team-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.day-team-stat strong {
    color: var(--text);
}

@media (max-width: 900px) {
    .day-summary-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .day-summary-teams {
        grid-template-columns: 1fr;
    }
}

.records-cell .edit-input {
    max-width: none;
}

.records-cell .edit-input {
    max-width: none;
}

.records-cell:first-child .edit-input {
    max-width: none;
    text-align: left;
}

.edit-input {
    width: 100%;
    max-width: 140px;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid rgba(122, 142, 163, 0.28);
    background: var(--bg-0);
    color: var(--text);
    outline: none;
    text-align: center;
    font: inherit;
}

.editable {
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    text-decoration: none;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.btn-primary {
    background: #6d8296;
    color: #eef2f6;
}

.btn-primary:hover {
    background: #7a90a4;
}

.btn-ghost {
    border-color: var(--border);
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.78rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
}

.btn-danger {
    color: var(--error);
}

.btn-danger:hover {
    background: rgba(196, 143, 143, 0.1);
}

.form-bar {
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(19, 21, 24, 0.96);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    isolation: isolate;
}

body:not(.app-shell) .form-bar {
    position: fixed;
}

.entry-form {
    max-width: var(--app-max-width);
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 2.35fr) minmax(88px, 0.82fr) minmax(88px, 0.82fr) auto minmax(118px, auto);
    gap: 12px;
    align-items: end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field > span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

input {
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
    border-color: rgba(122, 142, 163, 0.35);
    box-shadow: 0 0 0 3px rgba(122, 142, 163, 0.1);
}

.team-field-shell {
    position: relative;
    min-width: 0;
    width: 100%;
}

.team-picker {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    pointer-events: auto;
}

.team-btn {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
    text-align: left;
    overflow: hidden;
}

.team-btn * {
    pointer-events: none;
}

.team-btn:hover {
    border-color: var(--team-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
}

.team-btn-mark {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--team-color);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.team-btn-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
}

.team-btn.is-active {
    border-color: var(--team-color);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.team-btn.is-active .team-btn-text {
    color: var(--text);
    font-weight: 600;
}

.team-btn.is-active .team-btn-mark {
    color: #fff;
    background: var(--team-color);
    border-color: transparent;
}

.team-btn:active {
    transform: scale(0.98);
}

.team-alert {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(196, 143, 143, 0.12);
    border: 1px solid rgba(196, 143, 143, 0.2);
    color: #e0c4c4;
    font-size: 0.76rem;
    pointer-events: none;
}

.team-alert.hidden {
    display: none !important;
}

.field-calendar {
    position: relative;
    justify-content: flex-end;
}

.calendar-trigger {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.calendar-trigger:hover {
    border-color: rgba(122, 142, 163, 0.28);
    color: var(--text);
}

.calendar-trigger.is-custom {
    border-color: rgba(122, 142, 163, 0.32);
    background: var(--accent-soft);
    color: var(--text);
    box-shadow: 0 0 0 1px rgba(122, 142, 163, 0.12);
}

.calendar-popover {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    gap: 10px;
    min-width: 220px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-1);
    box-shadow: var(--shadow);
    z-index: 30;
}

.calendar-popover-note {
    margin: 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.calendar-field {
    display: grid;
    gap: 6px;
}

.calendar-field > span {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.calendar-reset {
    justify-self: start;
}

.btn-submit {
    min-width: 130px;
    height: 46px;
}

.hidden {
    display: none !important;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}

.alert-success {
    background: var(--success-soft);
    border: 1px solid rgba(111, 168, 138, 0.18);
    color: #b5d4c4;
}

.alert-error {
    background: rgba(196, 143, 143, 0.1);
    border: 1px solid rgba(196, 143, 143, 0.18);
    color: #e0c4c4;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.is-open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.modal-dialog {
    position: relative;
    width: min(420px, 100%);
    border-radius: calc(var(--radius) + 2px);
    border: 1px solid var(--border);
    background: var(--bg-1);
    box-shadow: var(--shadow);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.modal-close {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: var(--bg-2);
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-dialog-wide {
    width: min(640px, 100%);
}

.settings-grid {
    display: grid;
    gap: 18px;
}

.settings-block {
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.settings-block h3 {
    margin: 0 0 10px;
    font-size: 0.92rem;
}

.settings-note {
    margin: 0 0 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.settings-note code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--bg-2);
    font-size: 0.78rem;
}

.btn-secondary {
    border-color: rgba(122, 142, 163, 0.22);
    background: var(--primary-soft);
    color: var(--text);
}

.btn-secondary:hover {
    background: rgba(122, 142, 163, 0.16);
}

.modal-body {
    padding: 18px 20px 22px;
}

.settings-form {
    display: grid;
    gap: 12px;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(420px, 100%);
    padding: 32px 28px;
    border-radius: calc(var(--radius) + 4px);
    border: 1px solid var(--border);
    background: rgba(24, 27, 32, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(122, 142, 163, 0.2), rgba(111, 168, 138, 0.14));
    border: 1px solid rgba(143, 164, 184, 0.24);
    color: #b8cad9;
    box-shadow: 0 0 22px rgba(122, 142, 163, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.auth-brand .brand-title-lg {
    margin-bottom: 8px;
}

.auth-brand .brand-meta {
    justify-content: center;
    font-size: 0.82rem;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.btn-block {
    width: 100%;
}

.auth-hint {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.auth-shell {
    width: min(440px, 100%);
}

.auth-card-login {
    padding: 36px 30px;
}

.brand-icon-lock {
    background: linear-gradient(135deg, rgba(122, 142, 163, 0.16), rgba(111, 168, 138, 0.1));
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-icon-wrap input {
    padding-left: 38px;
}

.btn-login svg {
    width: 16px;
    height: 16px;
}

.auth-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
}

.auth-secure-note svg {
    width: 14px;
    height: 14px;
    color: var(--success);
}

.container-narrow {
    max-width: 760px;
}

.container-settings {
    max-width: 1100px;
}

.settings-block-wide {
    grid-column: 1 / -1;
}

.table-settings-group {
    margin-top: 18px;
}

.table-settings-group h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: var(--text);
}

.table-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.table-setting-field input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.table-setting-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.table-setting-range-head output {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.table-setting-hint {
    display: block;
    margin-top: -2px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.table-setting-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    min-height: 100%;
}

.table-setting-toggle input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.table-setting-toggle-box {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 5px;
    border: 1px solid rgba(122, 142, 163, 0.35);
    background: var(--bg-0);
    flex-shrink: 0;
    position: relative;
}

.table-setting-toggle input:checked + .table-setting-toggle-box {
    background: var(--primary-soft);
    border-color: rgba(122, 142, 163, 0.55);
}

.table-setting-toggle input:checked + .table-setting-toggle-box::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 2px;
    background: var(--primary);
}

.table-setting-copy {
    display: grid;
    gap: 3px;
}

.table-setting-copy strong {
    font-size: 0.84rem;
    font-weight: 600;
}

.table-setting-copy small {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.35;
}

.table-settings-actions {
    margin-top: 18px;
}

.settings-page-grid {
    display: grid;
    gap: 16px;
}

.journal-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.journal-stat {
    display: grid;
    gap: 4px;
    min-width: 120px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-2);
}

.journal-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.journal-stat strong {
    font-size: 1.1rem;
}

.journal-stat-live {
    color: #9fd4b8;
}

.journal-block {
    padding: 0;
    overflow: hidden;
}

.journal-table-wrap {
    overflow: auto;
    max-height: calc(100vh - 220px);
}

.journal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.journal-table th,
.journal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.journal-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg-1);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.journal-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.journal-table tr.is-active {
    background: rgba(111, 168, 138, 0.08);
}

.journal-table tr.is-current {
    box-shadow: inset 3px 0 0 #9fd4b8;
}

.journal-ip {
    font-size: 0.78rem;
    color: #c5d4e4;
}

.journal-ua {
    max-width: 220px;
    color: var(--text-muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.journal-status {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.journal-status-live {
    background: rgba(111, 168, 138, 0.18);
    color: #9fd4b8;
    border: 1px solid rgba(111, 168, 138, 0.28);
}

.journal-status-ended {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.settings-block-highlight {
    border-color: rgba(122, 142, 163, 0.18);
    background: linear-gradient(135deg, rgba(122, 142, 163, 0.06), rgba(24, 27, 32, 0.5));
}

.team-percent-form {
    gap: 14px;
}

.team-percent-field {
    display: grid;
    grid-template-columns: 1fr 120px;
    align-items: center;
    gap: 12px;
}

.team-percent-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 500;
}

.team-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.percent-input-wrap {
    position: relative;
}

.percent-input-wrap input {
    padding-right: 28px;
}

.percent-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.field-autocomplete {
    position: relative;
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 60;
    margin: 0;
    padding: 6px;
    list-style: none;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-1);
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
}

.autocomplete-item {
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font: inherit;
    cursor: pointer;
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background: var(--primary-soft);
    color: var(--text);
}

@media (max-width: 1100px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-submit {
        grid-column: 1 / -1;
    }

    #teamField {
        grid-column: 1 / -1;
    }

    .team-field-shell,
    .team-picker {
        width: 100%;
    }

    .team-picker {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .topbar-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .team-picker {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .team-btn {
        height: 42px;
        justify-content: flex-start;
    }

    .ledger-tab-full {
        display: none;
    }

    .ledger-tab-short {
        display: inline;
    }

    .ledger-tab {
        min-width: 52px;
        padding: 8px 10px;
    }

    .user-badge-name {
        display: none;
    }

    .ledger-switch {
        order: 3;
        width: 100%;
        justify-content: stretch;
    }

    .ledger-switch .ledger-tab {
        flex: 1 1 0;
    }
}

/* Preloader */
.app-preloader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    background: rgba(12, 14, 18, 0.92);
    backdrop-filter: blur(10px);
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.app-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    display: grid;
    gap: 14px;
    justify-items: center;
    animation: preloader-rise 0.45s ease;
}

.preloader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(111, 168, 138, 0.16);
    border-top-color: var(--primary);
    animation: spin 0.75s linear infinite;
}

.preloader-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes preloader-rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page enter */
body.is-mounted .topbar,
body.is-mounted .container,
body.is-mounted .form-bar,
body.is-mounted .auth-shell {
    opacity: 0;
    transform: translateY(10px);
}

body.is-ready .topbar,
body.is-ready .container,
body.is-ready .form-bar,
body.is-ready .auth-shell {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

body.modal-open {
    overflow: hidden;
}

.modal.is-open .modal-dialog {
    animation: modal-in 0.28s ease;
}

.modal.is-open .modal-backdrop {
    animation: fade-in 0.25s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 20px;
}

.modal-dialog-confirm .modal-body p {
    margin: 0;
    white-space: pre-line;
    color: var(--text-muted);
    line-height: 1.5;
}

.confirm-field-wrap {
    margin-top: 14px;
}

.confirm-field-error {
    margin: 8px 0 0;
    font-size: 0.82rem;
    color: #e0c4c4;
}

.password-match-hint {
    margin: -4px 0 0;
    font-size: 0.82rem;
}

.password-match-hint.is-success {
    color: #b5d4c4;
}

.password-match-hint.is-error {
    color: #e0c4c4;
}

.day-block-enter {
    animation: day-block-in 0.35s ease both;
}

@keyframes day-block-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn {
    transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
    transform: scale(0.97);
}

.toast {
    animation: toast-in 0.28s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-dialog-edit {
    width: min(560px, 100%);
}

.edit-record-form {
    padding-bottom: 0;
}

.edit-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.edit-team-picker {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
}

.edit-team-picker .team-btn,
.edit-team-picker .team-btn-sm {
    height: 42px;
    padding: 0 10px;
}

.edit-record-meta {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.edit-record-footer {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 4px;
}

.records-cell-team .team-badges {
    cursor: default;
}

@media (max-width: 720px) {
    .edit-form-row {
        grid-template-columns: 1fr;
    }

    .edit-team-picker {
        grid-template-columns: 1fr;
    }
}
