/* ========================================
   LITTER BUDGET MODAL — finanční plán vrhu
   Mobile first
   ======================================== */

.budget-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.budget-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.budget-modal__dialog {
    position: relative;
    background: #ffffff;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    animation: budgetSlideUp 0.22s ease-out;
    overflow: hidden;
}

@keyframes budgetSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.budget-modal__header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #a7f3d0;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.budget-modal__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.budget-modal__icon svg { width: 20px; height: 20px; }

.budget-modal__header-text { flex: 1; min-width: 0; padding-top: 2px; }

.budget-modal__title {
    font-size: 17px;
    font-weight: 700;
    color: #064e3b;
    margin: 0 0 2px;
    line-height: 1.25;
}

.budget-modal__subtitle {
    font-size: 13px;
    color: #047857;
    margin: 0;
    line-height: 1.35;
}

.budget-modal__close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.7);
    color: #064e3b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.budget-modal__close:hover { background: #ffffff; }
.budget-modal__close svg { width: 16px; height: 16px; }

.budget-modal__body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.budget-modal__private-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.budget-modal__private-badge svg { width: 12px; height: 12px; }

/* Nastavení měny a kurzu */
.budget-modal__settings {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.budget-modal__setting {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.budget-modal__setting-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.budget-modal__setting-input {
    padding: 8px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.budget-modal__setting-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

@media (min-width: 560px) {
    .budget-modal__settings { grid-template-columns: 1fr 1fr; }
}

/* Položky */
.budget-modal__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.budget-modal__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.budget-modal__item-text {
    flex: 1;
    min-width: 0;
}

.budget-modal__item-label {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.3;
}

.budget-modal__item-note {
    font-size: 12px;
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

.budget-modal__item-amount {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    color: #047857;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding-top: 1px;
    text-align: right;
}

.budget-modal__item-amount-main {
    display: block;
}

.budget-modal__item-amount-converted {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
}

.budget-modal__item--zero .budget-modal__item-amount {
    color: #64748b;
}

/* Editovatelná položka */
.budget-modal__item-edit {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
}

.budget-modal__item-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.budget-modal__item-edit-label,
.budget-modal__item-edit-note {
    padding: 6px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    color: #0f172a;
    background: #ffffff;
    width: 100%;
    min-width: 0;
}

.budget-modal__item-edit-label { font-weight: 600; }
.budget-modal__item-edit-note  { color: #475569; }

.budget-modal__item-edit-label:focus,
.budget-modal__item-edit-note:focus,
.budget-modal__item-edit-amount:focus,
.budget-modal__item-edit-currency:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.budget-modal__item-edit-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
}

.budget-modal__item-edit-money {
    display: flex;
    gap: 4px;
    min-width: 0;
}

.budget-modal__item-edit-amount {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: #047857;
    background: #ffffff;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.budget-modal__item-edit-currency {
    padding: 6px 6px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    background: #ffffff;
    cursor: pointer;
}

.budget-modal__item-edit-converted {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

.budget-modal__item-edit-remove {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.budget-modal__item-edit-remove:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.budget-modal__item-edit-remove svg { width: 14px; height: 14px; }

/* Součet */
.budget-modal__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1.5px solid #10b981;
    border-radius: 10px;
    margin-top: 4px;
}

.budget-modal__total-label {
    font-size: 13px;
    font-weight: 700;
    color: #064e3b;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.budget-modal__total-amount {
    font-size: 20px;
    font-weight: 800;
    color: #064e3b;
    font-variant-numeric: tabular-nums;
}

/* Footer */
.budget-modal__footer {
    display: flex;
    gap: 8px;
    padding: 14px 18px;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.budget-modal__btn {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.budget-modal__btn svg { width: 14px; height: 14px; }

.budget-modal__btn--secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}
.budget-modal__btn--secondary:hover { background: #f1f5f9; }

.budget-modal__btn--primary {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}
.budget-modal__btn--primary:hover {
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

@media (min-width: 768px) {
    .budget-modal {
        align-items: center;
        padding: 20px;
    }
    .budget-modal__dialog { border-radius: 16px; }
}
