@font-face {
    font-family: 'SF Pro Display';
    src: url('../fonts/SF-Pro-Display-Light.woff2') format('woff2');
    font-weight: 300;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('../fonts/SF-Pro-Display-Regular.woff2') format('woff2');
    font-weight: 400;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('../fonts/SF-Pro-Display-Semibold.woff2') format('woff2');
    font-weight: 600;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #d4d5d8;
}

/* ===== БАЗОВАЯ СТРУКТУРА ===== */

.phone-screen {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: #d4d5d8;
}

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

.page {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.top-nav-card {
    flex-shrink: 0;
    background: #d4d5d8;
    border-radius: 20px;
    padding: 10px 12px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.top-nav-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.top-nav-button {
    display: block;
    width: 100%;
    max-width: 290px;
}

.top-nav-button img {
    width: 100%;
    height: auto;
    display: block;
}

.top-nav-subtitle {
    margin-top: -10px;
    font-size: 12px;
    color: #6f8f95;
    text-align: center;
    line-height: 1.1;
}

.nav-arrow {
    border: none;
    background: transparent;
    font-size: 42px;
    line-height: 1;
    color: #3d7778;
    cursor: pointer;
    padding: 0;
    width: 24px;
    flex-shrink: 0;
}

.top-nav-button {
    display: block;
    flex: 1;
    max-width: 290px;
}

.top-nav-button img {
    display: block;
    width: 100%;
    height: auto;
}

.bottom-menu {
    flex-shrink: 0;
    background: #d4d5d8;
    border-radius: 20px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.bottom-menu-item {
    display: block;
    width: 44px;
    text-decoration: none;
    flex-shrink: 0;
}

.bottom-menu-item img {
    width: 100%;
    display: block;
    height: auto;
}

/* ===== ГЛАВНАЯ ===== */

.content {
    padding: 16px 18px 32px;
    text-align: center;
}

.bot-logo {
    width: 52px;
    margin: 8px auto 12px;
    display: block;
}

.title {
    font-size: 17px;
    line-height: 1.3;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 18px;
    font-weight: 600;
    color: #3b6d92;
    margin-bottom: 16px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.menu-link {
    display: block;
    width: 100%;
    max-width: 320px;
}

.menu-link img {
    width: 100%;
    display: block;
    border-radius: 20px;
}

.menu-link:active {
    transform: scale(0.97);
}

/* ===== ОБЩИЕ КАРТОЧКИ ===== */

.info-card {
    background: #f4f4f4;
    border-radius: 22px;
    box-shadow: 6px 8px 12px rgba(0, 0, 0, 0.22);
    padding: 16px 18px;
}

.card-title {
    font-size: 16px;
    line-height: 1.2;
    font-weight: 400;
    color: #3f7374;
    margin-bottom: 6px;
}

/* ===== ОБЩИЕ МЕЛКИЕ КНОПКИ ===== */

.small-action-buttons {
    margin-top: 22px;
}

.small-action-link {
    display: block;
}

.small-action-link img {
    display: block;
    width: 100%;
    height: auto;
}

.small-action-link:active {
    transform: scale(0.97);
}

.bottom-actions {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bottom-link {
    border: none;
    background: transparent;
    color: #44778f;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
}

/* ===== БАЛАНС ===== */

.page-balance {
    padding: 20px 12px 24px;
    text-align: center;
}
.page-balance > * {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.page-balance .info-card {
    margin-bottom: 16px;
}
.card-title {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 600;
    color: #3f7374;
    margin-bottom: 8px;
}
.balance-value {
    font-size: 24px;
    line-height: 1.1;
    font-weight: 600;
    margin-bottom: 4px;
}
.balance-hint {
    font-size: 14px;
    line-height: 1.25;
    font-weight: 300;
    color: #8e8e8e;
}

.balance-value.positive {
    color: #14b87a;
}

.balance-value.negative {
    color: #e53935;
}

.balance-value.warning {
    color: #d98c00;
}

.balance-hint {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 300;
    color: #8e8e8e;
}

.balance-hint.blocked {
    color: #e53935;
    font-weight: 400;
}
/* Блок Объектов*/

.objects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: start;
}

.object-col {
    text-align: center;
}

.object-label {
    font-size: 16px;
    line-height: 1.15;
    font-weight: 600;
    min-height: 38px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.object-label-green {
    color: #12b86d;
}

.object-label-red {
    color: #ff2e2e;
}

.object-count {
    font-size: 24px;
    line-height: 1;
    font-weight: 600;
    color: #31595d;
    margin-top: 10px;
}

.transactions-card {
    padding-top: 12px;
    padding-bottom: 12px;
}

.transaction-block + .transaction-block {
    margin-top: 12px;
}

.transaction-title {
    font-size: 16px;
    line-height: 1.1;
    font-weight: 400;
    color: #4d7a7a;
    margin-bottom: 6px;
    text-align: center;
}

.transaction-row {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    column-gap: 20px;
    align-items: center;
    font-size: 14px;
    color: #020202;
}

.transaction-row strong {
    font-size: 15px;
    font-weight: 600;
}

/* Крупные кнопки Счет / Акт на странице Баланс */
.page-balance .small-action-buttons {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.page-balance .small-action-link {
    display: block;
    width: 100%;
    max-width: 200px;
}

.page-balance .small-action-link img {
    display: block;
    width: 100%;
    height: auto;
}
/* ===== ДОКУМЕНТЫ ===== */

/*.page-docs {
    padding: 4px 12px 12px;
    padding-top: 0;
}/
.docs-content {
    padding-top: 0px;
    max-width: 380px;
    margin: 0 auto;
}
.section-title-docs {
    width: 350px;
    max-width: 100%;
    margin: 10px auto;
    display: block;
  
}
.docs-section {
    text-align: 0;
    padding-bottom: 10px;
}
.docs-toggle {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}
.section-title-docs {
    width: 350px;
    max-width: 100%;
    margin: 10px auto 8px;
    display: block;
}
.section-list-docs {
    list-style: none;
    margin: 0 0 8px 0;
    padding: 0 0 0 18px;
    text-align: left;
    display: none;
}
.section-list-docs.is-open {
    display: block;
    margin-bottom: 0;
}

.section-list-docs li {
    list-style: none;
    margin-left: 60px;
    padding-bottom: 10px;
    text-align: left;
}

.section-list-docs li::before {
    content: "• ";
    color: #3b6d92;
}

.section-list-docs a {
    text-decoration: none;
    color: #2f5f75;
    font-size: 15px;
    font-weight: 400;
}

.section-list-docs a:active {
    opacity: 0.6;
}
.docs-action-buttons {
     margin-top: 22px;
}


.docs-floating-actions {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 10px 12px 12px;
    width:100%;
    max-width: 380px;
    margin: 0 auto;
    background: #d4d5d8;
}

.docs-floating-action-link {
    flex: 1;
    display: block;
}
.docs-floating-action-link img {
    width: 100%;
    height: auto;
    display: block;
}

.docs-floating-action-link:active {
    transform: scale(0.97);
}
*/
.page-docs {
    padding: 4px 12px 12px;
    padding-top: 4px;
}

.docs-content {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    padding-top: 0;
}

.docs-section {
    margin-bottom: 4px;
    margin-top: 0;
}

.section-title-docs {
    width: 100%;
    max-width: 350px;
    margin: 4px auto 4px;
    display: block;
    margin-top: 0;
}
.docs-toggle {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    padding: 5px;
    cursor: pointer;
}
.section-list-docs {
    list-style: none;
    display: none;
    margin: 0;
    padding: 0 0 0 28px;
    text-align: left;
}

.section-list-docs.is-open {
    display: block;
}

.section-list-docs li {
    margin: 4px 0;
    line-height: 1;
    margin-left: 60px;
} 
.section-list-docs li::before {
    content: "• ";
    color: #3b6d92;
}
.section-list-docs a {
    text-decoration: none;
    color: #2f5f75;
    font-size: 16px;
    font-weight: 400;
}
.docs-floating-actions {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 10px 12px 12px;
    width:100%;
    max-width: 380px;
    margin: 0 auto;
    background: #d4d5d8;
}

.docs-floating-action-link {
    flex: 1;
    display: block;
}
.docs-floating-action-link img {
    width: 100%;
    height: auto;
    display: block;
}

.docs-floating-action-link:active {
    transform: scale(0.97);
}
/* ===== БАЗА ЗНАНИЙ ===== */

.knowledge-content {
    padding: 0 16px 20px;
    display: flex;
    flex-direction: column;
    
}

.knowledge-section {
    text-align: center;
    padding-bottom: 5px;

}


.section-title {
    width: 350px;
    max-width: 100%;
    margin: 5px auto;
    display: block;
}

.section-list {
    list-style: none;
    margin-left: 60px;
    padding-bottom: 1px;
    text-align: left;
}

.section-list li {
    margin: 3px 0;
}

.section-list li::before {
    content: "• ";
    color: #3b6d92;
}

.section-list a {
    text-decoration: none;
    color: #2f5f75;
    font-size: 16px;
    font-weight: 400;
}

.section-list a:active {
    opacity: 0.6;
}

/* ===== ПОДДЕРЖКА ===== */

.page-support {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
}

.support-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.page-support .small-action-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-support .small-action-link {
    display: block;
    max-width: 180px;
    width: 100%;
    margin: 0 auto;
}

.page-support .small-action-link img {
    width: 100%;
    height: auto;
}
.page-support .small-action-link:active {
    transform: scale(0.95);
}
/* ===== КАРТОЧКА ОБЪЕКТА ===== */

.page-object {
    padding: 10px 14px 28px;
}

.object-info-card {
    margin-bottom: 14px;
}

.object-card-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #3f7374;
    margin-bottom: 12px;
}

.object-info-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 10px 12px;
    align-items: center;
}
.object-info-grid div {
    transition: opacity 0.15s;
}
.info-label {
    font-size: 14px;
    font-weight: 400;
    color: #a1b3b4;
}

.info-value {
    font-size: 14px;
    font-weight: 400;
    color: #3f7374;
    text-align: right;
}

.editable-object-card {
    background: #4a7f80;
    border-radius: 22px;
    box-shadow: 6px 8px 12px rgba(0, 0, 0, 0.25);
    padding: 16px 12px 14px;
    margin-bottom: 22px;
}

.editable-object-grid {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 10px 10px;
    align-items: center;
    margin-bottom: 16px;
}

.editable-label {
    font-size: 15px;
    font-weight: 400;
    color: #f2f4f4;
}

.editable-value {
    font-size: 15px;
    font-weight: 400;
    color: #ffffff;
    text-align: right;
}

.edit-object-button {
    display: block;
    margin: 0 auto;
    min-width: 120px;
    height: 34px;
    border: none;
    border-radius: 8px;
    background: #f1f1f1;
    color: #3f7374;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.edit-object-button:active {
    transform: scale(0.96);
}

/* На странице объекта кнопки остаются вертикальными */
.page-object .small-action-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

.page-object .small-action-link {
    width: 100%;
    max-width: 220px;
}

/* ===== INVOICE ===== */

.page-invoice {
    padding: 18px 16px 24px;
}

.bank-logo-block {
    text-align: center;
    margin: 4px 0 8px;
}

.bank-logo-block-second {
    margin-top: 18px;
}

.bank-logo {
    width: 88px;
    height: auto;
    display: inline-block;
}

.bank-logo-kaspi {
    width: 72px;
}

.bank-card {
    border-radius: 22px;
    box-shadow: 6px 8px 12px rgba(0, 0, 0, 0.25);
    padding: 14px 12px 12px;
    margin-bottom: 10px;
}

.bank-card-halyk {
    background: #0a936f;
}

.bank-card-kaspi {
    background: #f54b4b;
}

.bank-card-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 12px;
}

.bank-form-grid {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px 10px;
    align-items: center;
}

.bank-label {
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
}

.bank-value {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    text-align: right;
    word-break: break-word;
}

.bank-select,
.bank-input {
    width: 100%;
    height: 28px;
    border: none;
    border-radius: 4px;
    padding: 0 8px;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 13px;
    color: #1f1f1f;
    background: #ffffff;
}

.bank-input {
    text-align: right;
}

.bank-submit-button {
    display: block;
    width: 116px;
    height: 28px;
    margin: 14px auto 0;
    border: none;
    border-radius: 4px;
    background: #f2f2f2;
    color: #3f7374;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.bank-submit-button:active {
    transform: scale(0.98);
}
.bank-value {
    color: #ffffff; /* или нужный тебе */
    -webkit-text-fill-color: #ffffff;
}
.bank-value a {
    color: inherit;
    text-decoration: none;
    pointer-events: none;
}

/* ===== ACT ===== */

.page-act {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: top;
    padding: 60px 16px;
}

.act-card {
    background: #f4f4f4;
    border-radius: 22px;
    box-shadow: 6px 8px 12px rgba(0, 0, 0, 0.25);
    padding: 14px 12px 16px;
    margin-top: 18px;
}

.act-card-title {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f1f1f;
    margin-bottom: 16px;
}

.act-form-grid {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 10px 10px;
    align-items: center;
}

.act-label {
    font-size: 14px;
    font-weight: 400;
    color: #1f1f1f;
}

.act-value {
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
    text-align: right;
    word-break: break-word;
}

.act-input {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: none;
    border-radius: 4px;
    padding: 0 8px;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 13px;
    color: #3f7374;
    background: #dfe4e4;

    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.act-input[type="date"] {
    display: block;
    line-height: 32px;
    min-height: 32px;
}
.act-input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.act-input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
}
.act-form-grid {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 10px 10px;
    align-items: center;
}
.act-submit-button {
    display: block;
    width: 112px;
    height: 24px;
    margin: 18px auto 0;
    border: none;
    border-radius: 4px;
    background: #dfe4e4;
    color: #3f7374;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    box-shadow: 4px 5px 8px rgba(0, 0, 0, 0.18);
}

.act-submit-button:active {
    transform: scale(0.98);
}

/* ===== СПИСОК ОБЪЕКТОВ ===== */

.page-objects {
    padding: 14px 12px 8px;
    display: flex;
    flex-direction: column;
}

.page-objects .objects-card {
    background: #f4f4f4;
    border-radius: 22px;
    box-shadow: 6px 8px 12px rgba(0, 0, 0, 0.22);
    padding: 14px 10px 12px;
    max-width: 380px;
    margin: 0 auto;
}

.objects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0 18px 8px;
}

.objects-header-title {
    font-size: 14px;
    line-height: 1.05;
    font-weight: 600;
    color: #4b7b7c;
}

.objects-header-right {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.objects-header-title-right {
    text-align: right;
    line-height: 1.05;
}

.objects-sort-btn {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 3px;
}

.objects-sort-btn img {
    width: 100%;
    display: block;
    height: auto;
}

.objects-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.object-row {
    display: grid;
    grid-template-columns: 1fr 104px;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    text-decoration: none;
}

.object-row.active-row {
    background: #dfe3e3;
}

.object-name {
    font-size: 13px;
    font-weight: 400;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.object-time {
    font-size: 12px;
    font-weight: 400;
    color: #8d8d8d;
    text-align: right;
    white-space: nowrap;
}

.object-row.is-alert .object-name,
.object-row.is-alert .object-time {
    color: #ff4a4a;
}
.object-row:active {
    transform: scale(0.995);
}

.objects-card-actions {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}
.objects-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.objects-list {
    flex: 1;
    overflow-y: auto;
}
.objects-card-action-link {
    display: block;
    width: calc(50% - 6px);
    max-width: 138px;
}

.objects-card-action-link img {
    width: 100%;
    display: block;
    height: auto;
}
.objects-floating-actions {
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    padding: 10px 12px 12px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    background: #d4d5d8;
}

.objects-floating-action-link {
    flex: 1;
    display: block;
}

.objects-floating-action-link img {
    width: 100%;
    height: auto;
    display: block;
}

.objects-floating-action-link:active {
    transform: scale(0.97);
}

/* ===== Блок Клиента (смена компании) ===== */
.top-fixed-area {
    flex-shrink: 0;
    background: #d4d5d8;
    z-index: 20;
}

.company-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 14px 12px;
    background: transparent;
}

.company-bar__info {
    min-width: 0;
    flex: 1;
}

.company-bar__name {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    color: #3f7374;
    text-transform: uppercase;
}

.company-bar__bin {
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    color: #3f7374;
    margin-top: 2px;
}

.company-bar__switch {
    border: none;
    background: transparent;
    color: #3f7374;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 10px;
    line-height: 1.1;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    flex-shrink: 0;
}

.company-bar__switch:active {
    transform: scale(0.97);
}

.company-bar__switch.is-hidden {
    display: none;
}

.client-picker-group + .client-picker-group {
    margin-top: 14px;
}

.client-picker-group__title {
    margin: 0 0 6px;
    padding: 0 4px;
    font-family: 'SF Pro Display', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: #3f7374;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.client-picker-group__items {
    display: grid;
    gap: 6px;
}

.client-picker-item {
    text-align: left;
    width: 100%;
    border: none;
    cursor: pointer;
}

/* Скрываем страницу до проверки JWT (class на <html> + js/auth-guard.js) */
html.auth-pending,
html.auth-pending body {
    visibility: hidden !important;
    overflow: hidden !important;
}