/* PayDesk base styles (carried over from PayDesk 3.0) */
:root {
    --navy: #123b70;
    --blue: #1769d2;
    --blue2: #eaf2ff;
    --orange: #f28b35;
    --ink: #17243a;
    --muted: #6c7b91;
    --line: #e5eaf1;
    --bg: #f4f7fb;
    --green: #168653;
    --red: #c43d43;
    --shadow: 0 10px 30px rgba(22, 48, 85, .08)
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif
}

button,
input,
select,
textarea {
    font: inherit
}

button {
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 650
}

.app {
    display: flex;
    min-height: 100vh
}

.sidebar {
    width: 245px;
    background: linear-gradient(180deg, #123b70, #0b2a50);
    color: white;
    padding: 24px 16px;
    flex-shrink: 0
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    padding: 0 8px 26px
}

.logo {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffad58, #f27a24);
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 20px
}

.brand strong {
    font-size: 18px;
    letter-spacing: .2px
}

.brand small {
    display: block;
    color: #b8cbe2;
    font-size: 11px
}

.nav-label {
    color: #91aac8;
    font-size: 10px;
    letter-spacing: 1.3px;
    padding: 13px 10px 8px
}

.nav button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #d7e4f4;
    margin: 3px 0;
    padding: 12px;
    border-radius: 10px;
    font-weight: 550
}

.nav button.active,
.nav button:hover {
    background: #ffffff1c;
    color: #fff
}

.nav .ico {
    width: 20px;
    text-align: center;
    font-size: 17px
}

.side-note {
    margin: 32px 7px 0;
    padding: 13px;
    border: 1px solid #ffffff2a;
    border-radius: 12px;
    color: #c3d4e8;
    font-size: 11px
}

.main {
    flex: 1;
    min-width: 0
}

.topbar {
    height: 72px;
    background: white;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 5
}

.topbar h2 {
    margin: 0;
    font-size: 18px
}

.top-right {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 12px
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--blue2);
    color: var(--blue);
    display: grid;
    place-items: center;
    font-weight: 800
}

.content {
    padding: 26px 30px;
    max-width: 1500px;
    margin: auto
}

.page {
    display: none
}

.page.active {
    display: block
}

.welcome {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px
}

.welcome h1 {
    font-size: 25px;
    margin: 0 0 5px
}

.welcome p {
    color: var(--muted);
    margin: 0
}

.btn-primary {
    background: var(--blue);
    color: white
}

.btn-primary:hover {
    background: #0e57b5
}

.btn-orange {
    background: var(--orange);
    color: #fff
}

.btn-light {
    background: #eef3fa;
    color: #244365
}

.btn-danger {
    background: #fff0f0;
    color: var(--red)
}

.btn-success {
    background: #e9f7ef;
    color: var(--green)
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 20px
}

.stat {
    background: white;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 18px;
    box-shadow: var(--shadow)
}

.stat-top {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px
}

.stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--blue2);
    display: grid;
    place-items: center;
    font-size: 17px
}

.stat strong {
    display: block;
    font-size: 25px;
    margin: 12px 0 2px
}

.stat small {
    color: var(--muted)
}

.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 18px
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.panel-head h3 {
    margin: 0;
    font-size: 16px
}

.muted {
    color: var(--muted)
}

.toolbar {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap
}

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

.field label {
    font-size: 12px;
    font-weight: 700;
    color: #44546a
}

.field input,
.field select,
.field textarea,
.search {
    width: 100%;
    border: 1px solid #dce3ec;
    border-radius: 9px;
    padding: 10px 11px;
    background: white;
    color: var(--ink);
    outline: none
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
    border-color: #76a7ec;
    box-shadow: 0 0 0 3px #1769d21a
}

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

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr))
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 17px
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 11px
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 760px
}

th,
td {
    padding: 12px 13px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap
}

th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #718097;
    background: #f8fafd
}

td {
    font-size: 12px
}

tr:last-child td {
    border-bottom: 0
}

.pill {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 750;
    background: #edf3fc;
    color: #24558d
}

.pill.good {
    background: #e8f7ef;
    color: #168653
}

.pill.warn {
    background: #fff5e8;
    color: #a95b0c
}

.pill.bad {
    background: #fff0f0;
    color: #bd353b
}

.empty {
    text-align: center;
    padding: 35px;
    color: var(--muted)
}

.split {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px
}

.hint {
    padding: 12px 14px;
    background: #f0f6ff;
    border: 1px solid #d8e8ff;
    border-radius: 10px;
    color: #365a86;
    font-size: 12px;
    margin: 12px 0
}

.notice {
    padding: 12px 14px;
    background: #fff7ed;
    border: 1px solid #ffdfbd;
    border-radius: 10px;
    color: #8d4c13;
    font-size: 12px;
    margin: 12px 0
}

.hidden {
    display: none !important
}

.file-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #eef3fa;
    color: #244365;
    padding: 10px 13px;
    border-radius: 10px;
    font-weight: 650;
    cursor: pointer
}

.file-label input {
    display: none
}

.row-actions {
    display: flex;
    gap: 6px
}

.row-actions button {
    padding: 6px 9px;
    font-size: 11px
}

.check-cell {
    width: 36px
}

.summary-line {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line)
}

.summary-line:last-child {
    border: 0
}

.amount {
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

.toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    background: #142b49;
    color: #fff;
    padding: 13px 17px;
    border-radius: 11px;
    box-shadow: var(--shadow);
    z-index: 20;
    display: none;
    max-width: 340px
}

.footer-note {
    font-size: 11px;
    color: var(--muted);
    margin: 14px 2px
}

.mobile-menu {
    display: none;
    background: transparent;
    color: var(--navy);
    font-size: 22px;
    padding: 5px
}

.search-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap
}

.search-tools .search {
    min-width: 220px
}

@media(max-width:700px) {
    .search-tools {
        width: 100%
    }

    .search-tools .search {
        min-width: 0;
        max-width: none !important;
        flex: 1
    }
}

@media(max-width:1000px) {
    .cards {
        grid-template-columns: repeat(2, 1fr)
    }

    .split {
        grid-template-columns: 1fr
    }

    .content {
        padding: 20px
    }

    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }
}

@media(max-width:700px) {
    .sidebar {
        position: fixed;
        z-index: 10;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left .2s
    }

    .sidebar.open {
        left: 0
    }

    .mobile-menu {
        display: block
    }

    .topbar {
        padding: 0 15px;
        height: 62px
    }

    .topbar h2 {
        font-size: 16px
    }

    .content {
        padding: 17px 13px
    }

    .welcome {
        display: block
    }

    .welcome .toolbar {
        margin-top: 14px
    }

    .cards {
        gap: 9px
    }

    .stat {
        padding: 13px
    }

    .stat strong {
        font-size: 21px
    }

    .stat small {
        font-size: 10px
    }

    .form-grid,
    .form-grid.two {
        grid-template-columns: 1fr
    }

    .panel {
        padding: 15px
    }

    .top-right span {
        display: none
    }
}

.mini-stat {
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 14px
}

.mini-stat strong {
    display: block;
    font-size: 20px;
    margin-top: 5px
}

.pill.neutral {
    background: #eef1f5;
    color: #596579
}

.toolbar .btn-light,
.toolbar .btn-primary {
    white-space: nowrap
}

.lock-screen {
    position: fixed;
    inset: 0;
    background: #0b2a50;
    z-index: 100;
    display: none;
    place-items: center;
    padding: 20px
}

.lock-card {
    background: white;
    border-radius: 18px;
    padding: 28px;
    max-width: 360px;
    width: 100%;
    box-shadow: 0 20px 60px #0004
}

.lock-card h2 {
    margin-top: 0
}

.lock-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin: 10px 0
}

.masked {
    letter-spacing: 2px
}

@media print {

    .sidebar,
    .topbar,
    .welcome .toolbar,
    button,
    .file-label {
        display: none !important
    }

    .content {
        padding: 0
    }

    .panel,
    .stat {
        box-shadow: none;
        break-inside: avoid
    }
}
