*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:Segoe UI, Arial, sans-serif;
}

body{
    background:#f5f7fb;
    color:#1e293b;
    padding-bottom:80px;
}

.header{
    background:white;
    padding:20px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.header h1{
    font-size:28px;
}

.header p{
    color:#64748b;
    margin-top:5px;
}

.container{
    max-width:1200px;
    margin:auto;
    padding:20px;
}

.card{
    background:white;
    border-radius:20px;
    padding:25px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
    margin-bottom:20px;
}

.balance-card{
    text-align:center;
}

.balance-title{
    font-size:18px;
    color:#64748b;
}

.balance-value{
    font-size:48px;
    font-weight:700;
    margin-top:10px;
    color:#2563eb;
}

.balance-info{
    display:flex;
    justify-content:center;
    gap:30px;
    margin-top:15px;
    flex-wrap:wrap;
}

.income{
    color:#22c55e;
    font-weight:600;
}

.expense{
    color:#ef4444;
    font-weight:600;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:15px;
}

.stat-card{
    background:white;
    border-radius:18px;
    padding:20px;
    box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.stat-title{
    color:#64748b;
    font-size:14px;
}

.stat-value{
    font-size:24px;
    font-weight:700;
    margin-top:10px;
}

.section-title{
    margin-bottom:15px;
    font-size:22px;
}

.operation{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px;
    border-left:5px solid #22c55e;
    background:#fafafa;
    border-radius:12px;
    margin-bottom:10px;
}

.operation.expense-op{
    border-left-color:#ef4444;
}

.operation-info{
    display:flex;
    flex-direction:column;
    gap:5px;
}

.operation-comment{
    font-weight:600;
}

.operation-date{
    font-size:13px;
    color:#64748b;
}

.operation-sum{
    font-size:20px;
    font-weight:700;
}

.btn{
    width:100%;
    padding:14px;
    border:none;
    border-radius:12px;
    background:#2563eb;
    color:white;
    font-size:16px;
    cursor:pointer;
    transition:.2s;
}

.btn:hover{
    opacity:.9;
}

.input{
    width:100%;
    padding:14px;
    border:1px solid #dbe2ea;
    border-radius:12px;
    font-size:16px;
    outline:none;
}

.input:focus{
    border-color:#2563eb;
}

.bottom-nav{
    position:fixed;
    bottom:0;
    left:0;
    width:100%;
    background:white;
    display:flex;
    justify-content:space-around;
    box-shadow:0 -2px 10px rgba(0,0,0,.08);
    padding:12px 0;
}

.bottom-nav a{
    text-decoration:none;
    color:#475569;
    font-size:14px;
    font-weight:600;
}

.bottom-nav a.active{
    color:#2563eb;
}

.product-item{
    display:flex;
    align-items:center;
    gap:15px;
    padding:15px;
    border-bottom:1px solid #eee;
}

.product-item:last-child{
    border-bottom:none;
}

.quick-buttons{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.quick-buttons button{
    border:none;
    background:#eef2ff;
    color:#2563eb;
    padding:10px 16px;
    border-radius:12px;
    cursor:pointer;
}

.quick-buttons button:hover{
    background:#dbeafe;
}

@media(min-width:900px){

    body{
        padding-bottom:20px;
    }

    .bottom-nav{
        position:static;
        margin-top:20px;
        border-radius:20px;
        max-width:1200px;
        margin-left:auto;
        margin-right:auto;
    }

    .balance-value{
        font-size:64px;
    }
}

/* ===== ОТСТУП МЕЖДУ СЕКЦИЯМИ ===== */

.stats-grid {
    margin-bottom: 25px;
}

/* чуть более аккуратное разделение карточек вообще */
.card {
    margin-bottom: 20px;
}

/* чтобы последний элемент не давал лишний отступ снизу */
.card:last-child {
    margin-bottom: 0;
}

.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.done {
    text-decoration: line-through;
    color: #888;
}

/* КНОПКА УДАЛЕНИЯ */
.delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: #ef4444;
    color: white;
    font-weight: bold;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #dc2626;
}

.products-updated {
    opacity: 0.7;
    font-size: 14px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.done {
    text-decoration: line-through;
    color: #888;
}

.delete-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: #e74c3c;
    color: #fff;
    font-weight: bold;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-btn:hover {
    background: #c0392b;
}

.clear-btn {
    background: #ff4d4d;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.clear-btn:hover {
    background: #e63b3b;
}

.logout-btn {
    position: absolute;
    right: 20px;
    top: 20px;
    background: #ef4444;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 14px;
}

/* ===== LOGOUT BUTTON FIX ===== */

.bottom-nav .logout-btn {
    color: #fff !important;
    background: #ef4444;
    padding: 8px 12px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

/* чтобы не сжималась в мобильной версии */
.bottom-nav .logout-btn {
    flex-shrink: 0;
}

/* фикс поведения в nav */
.bottom-nav {
    align-items: center;
}

.logout-btn {
    position: absolute;
    right: 20px;
    top: 20px;

    background: #ef4444;
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;

    text-decoration: none;
    font-weight: 600;
    z-index: 10;
}

/* чтобы текст не серел нигде */
.bottom-nav .logout-btn {
    color: #fff !important;
}

/* мобильная защита */
@media (max-width: 600px) {
    .logout-btn {
        position: absolute;
        right: 12px;
        top: 12px;
        padding: 6px 10px;
        font-size: 14px;
    }
}