* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

html, body {
  background: #F3F5F7;
  overflow-x: hidden;
  max-width: 100%;
}

.header {
  height: 70px;
  background: #FFFFFF;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 50px;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.logo-x {
  color: #14c3d3;
}

.upload-btn {
  background: #14c3d3;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 18px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.upload-btn:hover {
  background: #0fb2c1;
}

.plus {
  font-size: 22px;
  line-height: 1;
}

.kpi-section {
  max-width: 1600px;
  margin: 36px auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.kpi-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.kpi-title {
  color: #9b9b9b;
  font-size: 14px;
  margin-bottom: 12px;
}

.kpi-card h2 {
  font-size: 32px;
  font-weight: 700;
  color: #222;
}

.kpi-footer {
  margin-top: 30px;
  font-size: 15px;
  font-weight: 500;
}

.positive {
  color: #1bb65f;
}

.negative {
  color: #e64b4b;
}

.icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.icon iconify-icon {
  font-size: 26px;
}

.blue  {
  background: #eef5ff;
  color: #3b82f6;
}

.purple {
  background: #f3e8ff;
  color: #8b5cf6;
}

.orange {
  background: #fff3e8;
  color: #f97316;
}

.green {
  background: #e8fff4;
  color: #10b981;
}



@media (max-width: 600px) {
  .kpi-section {
    grid-template-columns: 1fr;
    padding: 0 16px;
  }
}

/* ===== Bottom Section ===== */

.bottom-section-grid {
    width:1600px;
    max-width:92%;
    margin:35px auto;

    display:grid;
    grid-template-columns:1fr 1fr;
    gap:24px;
}

.bottom-section {
    display: contents;
}


@media (max-width: 900px) {
    .bottom-section-grid {
        display: block;
        max-width: none;
        width: auto;
        margin: 0;
        padding: 0;
    }

    .bottom-section {
        display: block;
        margin: 20px 16px;
    }
}

@media (max-width: 768px) {
    .bottom-section {
        margin-bottom: 90px; /* запас снизу, чтобы плавающая кнопка не перекрывала контент */
    }
}


/* ===== Panels ===== */

.panel{

    background:#ffffff;

    border-radius:16px;

    padding:28px;

    box-shadow:0 5px 18px rgba(0,0,0,.06);

}

.panel-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:30px;

}

.panel-header h2{

    font-size:20px;

    font-weight:600;

}

.panel-header a{

    text-decoration:none;

    color:#2D8CFF;

    font-weight:400;

}

/* ===== Categories ===== */

.category{

    display:grid;

    grid-template-columns:150px 1fr 130px;

    align-items:center;

    gap:20px;

    margin-bottom:28px;

}



@media (max-width: 480px) {
    .category {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name amount"
            "bar bar";
        gap: 8px;
        row-gap: 6px;
    }

    .category span:first-child {
        grid-area: name;
    }

    .category .progress {
        grid-area: bar;
    }

    .category .category-amount {
        grid-area: amount;
        text-align: right;
    }
}


.progress{

    width:100%;

    height:18px;

    background:#ECECEC;

    border-radius:20px;

    overflow:hidden;

}

.fill{

    height:100%;

    border-radius:20px;

}

.cyan{
    background:#8a8cfa;
}

.ocean{
    background:#5B75DF;
}

.yellow{
    background:#E6BE4D;
}

.red{
    background:#E26D58;
}

.pink{
    background:#D85ACD;
}

.gray{
    background:#CFCFCF;
}

/* ===== Transactions ===== */

.transaction{

    display:grid;

    grid-template-columns:1fr 100px 110px;

    gap: 30px;

    align-items:center;

    padding:18px 0;

    border-bottom:1px solid #ECECEC;

}


@media (max-width: 480px) {
    .transaction {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "left amount"
            "date amount";
        gap: 2px 8px;
        padding: 14px 0;
        align-items: center;
    }

    .transaction .left {
        grid-area: left;
    }

    .transaction .date {
        grid-area: date;
        font-size: 12px;
        color: #aaa;
    }

    .transaction .amount {
        grid-area: amount;
        font-size: 15px;
        align-self: center;
    }
}

.transaction .amount{
    color:#505050;
    font-weight:600;
    text-align: right;
}

@media (max-width: 480px) {
    .transaction .left .merchant-name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 140px;
        display: inline-block;
        vertical-align: middle;
    }

    .transaction .left .category-tag {
        display: none; /* прячем категорию на узком экране, чтобы не загромождать */
    }
}


.left{

    display:flex;

    align-items:center;

    gap:16px;

}

.dot{

    width:14px;

    height:14px;

    border-radius:4px;

    display:block;

}

.transaction span{

    font-size:17px;

    color:#666;

}

.transaction:last-child{

    border-bottom:none;

}

.modal-overlay{

    position:fixed;

    inset:0;

    background:rgba(0,0,0,.45);

    display:flex;

    justify-content:center;

    align-items:center;

    opacity:0;

    visibility:hidden;

    transition:.25s;

    z-index: 2000;
}

@media (max-width: 480px) {
    .modal-overlay {
        padding: 16px;
        align-items: center;
    }
}

.modal-overlay.active{

    opacity:1;

    visibility:visible;

}

.modal{

    width:760px;

    background:#fff;

    border-radius:16px;

    padding:30px;

    animation:popup .25s;
}

@media (max-width: 850px) {
    .modal {
        width: 92vw;
        max-width: 92vw;
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .modal {
        padding: 16px;
    }

    .modal-header h2 {
        font-size: 18px;
    }
}

@keyframes popup{

    from{

        transform:scale(.9);

        opacity:0;

    }

    to{

        transform:scale(1);

        opacity:1;

    }

}

.modal-header{

    display:flex;

    justify-content:space-between;

    align-items:center;

    margin-bottom:25px;

}

.close-btn{

    width:40px;

    height:40px;

    border:none;

    border-radius:10px;

    background:#fff;

    font-size:28px;

    cursor:pointer;

}

.tabs{

    display:flex;

    gap:30px;

    margin-bottom:25px;

    border-bottom:1px solid #eee;

}

.tab{

    border:none;

    background:none;

    padding-bottom:14px;

    cursor:pointer;

    font-size:17px;

}

.tab.active{

    color:#0FC5D7;

    border-bottom:3px solid #0FC5D7;

}

.dropzone{

    border:2px dashed #d9d9d9;

    border-radius:12px;

    padding:70px 20px;

    text-align:center;

    cursor:pointer;

}

.upload-icon{

    font-size:60px;

    margin-bottom:20px;

}

.dropzone h3{

    margin-bottom:10px;

}

.dropzone p{

    color:#888;

}



.dropzone-loading {
    text-align: center;
    padding: 70px 20px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e8e8e8;
    border-top: 4px solid #0FC5D7;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}

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

.dropzone-loading h3 {
    margin-bottom: 8px;
}

.dropzone-loading p {
    color: #888;
}



.save-btn{

    margin-top:25px;

    width:100%;

    height:52px;

    border:none;

    border-radius:10px;

    background:#e8e8e8;

    color:#999;

    font-size:17px;

}

/* ===== Receipt Details ===== */

.receipt-details {
    display: none;
    margin-top: 24px;
    padding: 20px;
    background: #F7FCFD;
    border: 1px solid #D9F3F7;
    border-radius: 12px;
}

.receipt-details.show {
    display: block;
}

.receipt-details h3 {
    margin-bottom: 18px;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #ECECEC;
}

@media (max-width: 480px) {
    .row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .row strong {
        text-align: left;
    }
}

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

.row span {
    color: #666;
    font-size: 15px;
}

.row strong {
    color: #111;
    font-size: 15px;
    font-weight: 600;
}

/* ===== Save Button ===== */

.save-btn {
    margin-top: 24px;
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 10px;
    background: #E5E7EB;
    color: #9CA3AF;
    font-size: 16px;
    font-weight: 600;
    cursor: not-allowed;
    transition: 0.25s;
}

.save-btn.enabled {
    background: #12C7D8;
    color: white;
    cursor: pointer;
}

.save-btn.enabled:hover {
    background: #0EB5C5;
}


.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #fff;
    padding: 18px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    min-width: 340px;
    max-width: 420px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-icon {
    width: 36px;
    height: 36px;
    background: #22C55E;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}

.toast-text strong {
    display: block;
    font-size: 16px;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.toast-text p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.toast-close {
    border: none;
    background: none;
    font-size: 20px;
    color: #bbb;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
    padding: 0;
}

.toast-close:hover {
    color: #666;
}

.toast-icon.error {
    background: #DC2626;
}


/* ===== Filters Bar ===== */

.filters-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
}

.search-group {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.filter-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 18px;
    pointer-events: none;
}

.search-group input {
    width: 100%;
    padding: 12px 16px 12px 42px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

.search-group input:focus {
    border-color: #12C7D8;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding: 12px 40px 12px 16px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    color: #374151;
    transition: 0.2s;

    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
}

.filter-select:focus {
    border-color: #12C7D8;
}

.date-group {
    gap: 8px;
}

.filter-date {
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    font-size: 14px;
    color: #374151;
    outline: none;
    transition: 0.2s;
}

.filter-date:focus {
    border-color: #12C7D8;
}


.app-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    width: 100%;
    padding: 14px 40px 14px 16px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    outline: none;
    color: #374151;
    transition: 0.2s;

    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 12px;
}

.app-select:focus {
    border-color: #12C7D8;
}

.date-separator {
    color: #9CA3AF;
    font-size: 14px;
}

.filter-reset-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #6B7280;
    transition: 0.2s;
    white-space: nowrap;
}

.filter-reset-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
}

.filter-reset-btn iconify-icon {
    font-size: 16px;
}

@media (max-width: 768px) {
    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-group {
        min-width: unset;
    }

    .date-group {
        flex-direction: column;
        align-items: stretch;
    }

    .date-separator {
        display: none;
    }
}


.type-switch {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 15px;
    color: #666;
}

.type-btn.active {
    background: #0FC5D7;
    color: #fff;
    border-color: #0FC5D7;
}




/* ===== AUTH SCREEN — split layout ===== */

.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
    background: #ffffff;
}

.auth-screen.active { display: flex; }

.auth-form-panel {
    flex: 0 0 44%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 80px;
    position: relative;
}

.auth-logo {
    position: absolute;
    top: 48px;
    left: 80px;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: #12181B;
}

.auth-logo span { color: #14C3D3; }

.auth-form-inner { max-width: 380px; width: 100%; }

.auth-eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #14C3D3;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: #14C3D3;
}

.auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 34px;
    color: #12181B;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.auth-subtitle {
    color: #6B7680;
    font-size: 14.5px;
    margin-bottom: 36px;
    line-height: 1.5;
}

.auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 18px;
    background: #FDEEEC;
    color: #C0392B;
}

.auth-alert.success { background:#E7F8F1; color:#0E8A5F; }

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #12181B;
    margin-bottom: 7px;
}

.auth-field input {
    width: 100%;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1.5px solid #E4E8EA;
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    color: #12181B;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
}

.auth-field input:focus {
    border-color: #14C3D3;
    box-shadow: 0 0 0 4px rgba(20,195,211,0.12);
}

.auth-field input::placeholder { color: #A7B0B6; }

.auth-forgot { text-align: right; margin: -6px 0 22px; }

.auth-forgot a {
    font-size: 12.5px;
    color: #14C3D3;
    text-decoration: none;
    font-weight: 500;
}

.auth-submit {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #0F1F22;
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.auth-submit:hover { background: #14C3D3; }
.auth-submit:active { transform: scale(0.98); }

.auth-switch {
    text-align: center;
    margin-top: 26px;
    font-size: 13.5px;
    color: #6B7680;
}

.auth-switch a {
    color: #12181B;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px solid #14C3D3;
}

/* ===== AUTH SCREEN — centered card ===== */

.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    overflow: hidden;

    background: linear-gradient(160deg, #0B1F22 0%, #123138 55%, #0E2529 100%);
}

.auth-screen.active { display: flex; }

.auth-screen::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, rgba(20,195,211,0.18) 0%, transparent 70%);
}

.auth-screen::after {
    content: "";
    position: absolute;
    bottom: -25%;
    right: -10%;
    width: 65%;
    height: 65%;
    background: radial-gradient(circle, rgba(20,195,211,0.12) 0%, transparent 70%);
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 420px;
    max-width: 90vw;
    background: #fff;
    border-radius: 20px;
    padding: 48px 44px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    text-align: center;
}

.auth-logo-center {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #12181B;
    margin-bottom: 28px;
}

.auth-logo-center span { color: #14C3D3; }

.auth-card .auth-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #12181B;
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    color: #6B7680;
    font-size: 14px;
    margin-bottom: 28px;
}

.auth-card .auth-alert {
    display: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    margin-bottom: 16px;
    text-align: left;
    background: #FDEEEC;
    color: #C0392B;
}

.auth-card .auth-alert.success { background:#E7F8F1; color:#0E8A5F; }

.auth-field-icon {
    position: relative;
    margin-bottom: 14px;
}

.auth-field-icon iconify-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #A7B0B6;
    font-size: 18px;
}

.auth-field-icon input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border-radius: 10px;
    border: 1.5px solid #E4E8EA;
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    color: #12181B;
    outline: none;
    background: #F7F9FA;
    transition: border-color .2s, background .2s;
}

.auth-field-icon input:focus {
    border-color: #14C3D3;
    background: #fff;
}

.auth-field-icon input::placeholder { color: #A7B0B6; }

.auth-forgot {
    text-align: right;
    margin: -2px 0 22px;
}

.auth-forgot a {
    font-size: 12.5px;
    color: #14C3D3;
    text-decoration: none;
    font-weight: 500;
}

.auth-submit-center {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #14C3D3 0%, #0D8994 100%);
    color: #fff;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    box-shadow: 0 8px 20px rgba(20,195,211,0.3);
}

.auth-submit-center:hover { box-shadow: 0 10px 26px rgba(20,195,211,0.42); }
.auth-submit-center:active { transform: scale(0.98); }

.auth-card .auth-switch {
    text-align: center;
    margin-top: 24px;
    font-size: 13.5px;
    color: #6B7680;
}

.auth-card .auth-switch a {
    color: #12181B;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1.5px solid #14C3D3;
}

@media (max-width: 480px) {
    .auth-card { padding: 36px 26px; }
}


.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: #A7B0B6;
    font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #E4E8EA;
}



.auth-lang-dropdown {
    position: absolute;
    top: 32px;
    right: 40px;
    z-index: 10;
}

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    color: #EAF6F7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.lang-dropdown-btn:hover {
    background: rgba(255,255,255,0.14);
}

.lang-dropdown-btn iconify-icon {
    font-size: 14px;
    transition: transform 0.2s;
}

.lang-dropdown-btn.open iconify-icon {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    padding: 6px;
    min-width: 160px;
    display: none;
    flex-direction: column;
    gap: 2px;
}

.lang-dropdown-menu.open { display: flex; }

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 13.5px;
    color: #12181B;
    cursor: pointer;
    text-align: left;
    transition: 0.15s;
}

.lang-option:hover { background: #F3F5F7; }

.lang-option.active {
    background: #E6FAFB;
    color: #0D8994;
    font-weight: 600;
}

@media (max-width: 900px) {
    .auth-lang-dropdown { top: 20px; right: 20px; }
}


.toast-action {
    margin-top: 8px;
    background: none;
    border: none;
    color: #0FC5D7;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.toast-action:hover {
    color: #0aa8b8;
}





/* ===== NEW HEADER ===== */


.header {
    height: 72px;
    background: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    border-bottom: 1px solid #ECECEC;
    position: relative;   /* ← добавить */
}


@media (max-width: 768px) {
    .header {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 16px 16px;
        gap: 12px;
        row-gap: 16px;
    }

    .logo-img-header {
        height: 40px;
    }

    .period-dropdown {
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        order: 3;
        width: 100%;
        margin-top: 12px;
        margin-bottom: 4px;
    }

    .period-menu-dropdown {
        left: 0;
        right: 0;
    }

    .period-btn {
        width: 100% !important;
        justify-content: center;
    }

    .header-right {
        gap: 8px;
    }

       .upload-btn {
        display: none; /* прячем маленькую кнопку из шапки на мобильном */
    }

    .user-info {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        justify-content: space-between;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: #111;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #14C3D3 0%, #0D8994 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* --- Period dropdown --- */

.period-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: 0.2s;
}

.period-btn:hover { border-color: #14C3D3; }

.period-btn iconify-icon:first-child { color: #9CA3AF; font-size: 16px; }
.period-btn .chev { font-size: 14px; color: #9CA3AF; }

/* --- User menu --- */

.user-menu {
    position: relative;
    z-index: 300;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 12px;
    border: none;
    background: none;
    cursor: pointer;
    transition: 0.2s;
}

.user-menu-btn:hover { background: #F7F9FA; }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #E6FAFB;
    color: #0D8994;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
}

.user-email {
    font-size: 13.5px;
    color: #242424;
    font-weight: 550;
}

.user-logout-hint {
    font-size: 12px;
    color: #14C3D3;
}

.user-menu-btn .chev {
    font-size: 14px;
    color: #9CA3AF;
    margin-left: 4px;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    padding: 6px;
    min-width: 160px;
    display: none;
    flex-direction: column;
    z-index: 1500;
}

.user-menu-dropdown.open { display: flex; }

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: 0.15s;
}

.user-menu-item:hover { background: #F7F9FA; }

@media (max-width: 768px) {
    .user-info { display: none; }
}


.period-dropdown {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
}

.period-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
    padding: 6px;
    min-width: 200px;
    display: none;
    flex-direction: column;
    z-index: 1000;
}


@media (max-width: 480px) {
    .period-menu-dropdown {
        left: 50%;
        transform: translateX(-50%);
        width: 90vw;
        max-width: 320px;
    }
}

.period-menu-dropdown.open {
    display: flex;
}

.period-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: 0.15s;
}

.period-menu-item:hover {
    background: #F7F9FA;
}

.period-menu-item.active {
    background: #E6FAFB;
    color: #0D8994;
    font-weight: 600;
}

.period-menu-divider {
    height: 1px;
    background: #ECECEC;
    margin: 6px 4px;
}

.period-custom-range {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px 4px;
}

.period-custom-range input[type="date"] {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    font-size: 13px;
}

.period-custom-range button {
    padding: 9px;
    border-radius: 8px;
    border: none;
    background: #14C3D3;
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
}

.dot.green {
    background: #6bffcb;
}




.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    max-width: 1640px;
    margin: 0 auto 24px;
    padding: 0 20px;
}

.panel.chart-panel-wide, .panel.chart-panel-narrow {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    height: 360px;
    display: flex !important;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}


.chart-body canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 900px) {
    .charts-section {
        grid-template-columns: 1fr;
        padding: 0 16px;
    }
}

.donut-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 260px;
}

.donut-canvas-wrap {
    flex: 1;
    height: 100%;
    position: relative;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 110px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.donut-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}


.chart-body {
    position: relative;
    flex: 1;
    min-height: 0;
}

.chart-empty-state {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #9CA3AF;
}

.chart-empty-state iconify-icon {
    font-size: 40px;
    margin-bottom: 12px;
    color: #D1D5DB;
}

.chart-empty-state .empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 4px;
}

.chart-empty-state .empty-subtitle {
    font-size: 13px;
    color: #9CA3AF;
}

.empty-state-simple {
    text-align: center;
    padding: 40px 0;
    color: #9CA3AF;
    font-size: 14px;
}






.date-group {
    display: flex;
    align-items: center;
    position: relative;
}

.date-group .filter-icon {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #9CA3AF;
    font-size: 16px;
    pointer-events: none;
    margin: 0 !important;
}


#dateRangeInput {
    padding: 10px 14px 10px 36px;
    border-radius: 10px;
    border: 1px solid #E5E7EB;
    font-size: 14px;
    cursor: pointer;
    min-width: 200px;
    background: #fff;
    color: #374151;
    box-sizing: border-box;
}

/* Кастомизация самого Flatpickr под цвета проекта */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: #14C3D3 !important;
    border-color: #14C3D3 !important;
}

.flatpickr-day.inRange {
    background: #E6FAFB !important;
    border-color: #E6FAFB !important;
    box-shadow: -5px 0 0 #E6FAFB, 5px 0 0 #E6FAFB !important;
}

.flatpickr-day:hover {
    background: #F0FDFE;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-weekday {
    color: #111;
}

.flatpickr-day.today {
    border-color: #14C3D3;
}


#customDateRangeInput {
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    font-size: 13px;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
}


.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.logo-img-header {
    height: 60px;
    width: auto;
    display: block;
}

.logo-img-auth {
    height: 56px;
    width: auto;
    display: block;
    margin: 0 auto;
}



.user-menu-divider {
    height: 1px;
    background: #ECECEC;
    margin: 6px 4px;
}

.user-menu-item-danger {
    color: #DC2626 !important;
}

.user-menu-item-danger:hover {
    background: #FEF2F2 !important;
}





.avatar-upload-wrap {
    position: relative;
    width: 80px;
    margin: 0 auto;
}

.avatar-edit-btn {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #14C3D3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border: 2px solid #fff;
}

.avatar-edit-btn:hover {
    background: #0D8994;
}




.custom-file-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #ddd;
}

.custom-file-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 8px;
    background: #F3F5F7;
    color: #374151;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.custom-file-btn:hover {
    background: #E5E7EB;
}

.custom-file-name {
    font-size: 13.5px;
    color: #9CA3AF;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}



.receipt-attach-icon {
    position: relative;
    margin-left: 8px;
    color: #9CA3AF;
    display: inline-flex;
    align-items: center;
}

.receipt-attach-icon:hover {
    color: #14C3D3;
}

.receipt-attach-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #12181B;
    color: #fff;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
    z-index: 100;
}

.receipt-attach-icon::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #12181B;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.receipt-attach-icon:hover::after,
.receipt-attach-icon:hover::before {
    opacity: 1;
    visibility: visible;
}



@media (max-width: 480px) {
    .modal[style*="width"] {
        width: 92vw !important;
        max-width: 92vw !important;
    }
}



.mobile-fab-btn {
    display: none;
}

@media (max-width: 768px) {
    .mobile-fab-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        position: fixed;
        bottom: 20px;
        left: 16px;
        right: 16px;
        height: 54px;
        border: none;
        border-radius: 14px;
        background: #14C3D3;
        color: #fff;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 8px 24px rgba(20,195,211,0.4);
        z-index: 500;
    }

    .mobile-fab-btn .plus {
        font-size: 22px;
        line-height: 1;
    }
}


.original-amount-hint {
    color: #9CA3AF;
    font-size: 11px;
    font-weight: 400 !important;
}

@media (max-width: 480px) {
    .original-amount-hint {
        display: block !important;
        margin-left: 0 !important;
        font-size: 11px !important;
        color: #9CA3AF !important;
        font-weight: 400 !important;
        text-align: right !important;
    }
}

@media (max-width: 480px) {
    .transaction .amount {
        text-align: right !important;
        white-space: normal;
    }
}


.dropzone-mobile {
    display: none;
}

@media (max-width: 600px) {
    .dropzone-desktop {
        display: none;
    }

    .dropzone-mobile {
        display: block;
        text-align: center;
        padding: 40px 20px;
    }

    .dropzone-mobile-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .dropzone-action-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px;
        border-radius: 10px;
        background: #14C3D3;
        color: #fff;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

    .dropzone-action-btn iconify-icon {
        font-size: 18px;
    }

    .dropzone-action-btn-secondary {
        background: #F3F5F7;
        color: #374151;
    }
}


@media (max-width: 900px) {
    #dashboardSections {
        display: flex;
        flex-direction: column;
    }

    .bottom-section-grid {
        display: contents;
    }

    #transactionsSection {
        order: 1;
    }

    .charts-section {
        order: 2;
    }

    #categoriesSection {
        order: 3;
    }
}



@media (max-width: 900px) {
    .kpi-section {
        margin: 20px 16px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .charts-section {
        margin: 0 0 24px 0 !important;
    }

    .bottom-section-grid {
        margin: 0 !important;
    }

    .bottom-section {
        margin: 0 16px 20px 16px !important;
    }

    #categoriesSection {
    margin-bottom: 90px !important;
}
}





