:root {
    --primary-color: #27ae60;
    --secondary-color: #3498db;
    --danger-color: #e53935;
    --warning-color: #e67e22;
    --bg-color: #f4f7f6;
    --text-color: #2c3e50;
    --border-color: #ddd;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
}

h1 {
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: var(--primary-color) 3px solid;
    font-size: 1.3rem;
}

.activity {
    background: var(--white);
    margin-bottom: 5px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.activity h3 {
    margin: 0;
    font-size: 0.95rem; /* Itt állíthatod a betűméretet */
    font-weight: 500;    /* Itt a vastagságot (pl. 700 a félkövérhez) */
    color: var(--text-color);
    flex: 1;            /* Kitölti a rendelkezésre álló helyet a gombokig */
    padding-right: 10px;
    word-break: break-word; /* Ha túl hosszú a név, ne tolja el a gombokat */
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls button {
    font-size: 1.2em;
    width: 35px;
    height: 35px;
    cursor: pointer;
    background-color: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    transition: var(--transition);
}

.controls button:active {
    transform: scale(0.9);
}

.quantity {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.4em;
    min-width: 25px;
    text-align: center;
}

.total-container {
    margin: 20px 0;
    padding: 15px;
    background: var(--white);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid var(--primary-color);
}

.total-label {
    font-weight: 400;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.total-amount {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.button-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.left-buttons {
    display: flex;
    gap: 10px;
}

.square-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    background-color: var(--white);
    border: 1px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.square-btn:active {
    transform: scale(0.9);
}

.danger-btn {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.daily-summary {
    margin-top: 25px;
    background: var(--white);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.daily-summary h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #2c3e50;
}

.daily-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-family: monospace;
    font-size: 1rem;
}

.daily-total {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #3498db;
    text-align: right;
    font-size: 1.2rem;
    color: #2c3e50;
}

.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    visibility: hidden;
    transition: visibility 0.3s ease;
}

.bottom-sheet.open {
    visibility: visible;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet.open .bottom-sheet-overlay {
    opacity: 1;
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-sheet .bottom-sheet-content {
    max-height: 88vh;
}

.bottom-sheet.open .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-bar {
    width: 40px;
    height: 5px;
    background: #ccc;
    border-radius: 3px;
    margin: 0 auto 10px auto;
}

.bottom-sheet-content h4 {
    margin: 0 0 10px 0;
    text-align: center;
    color: #2c3e50;
    font-size: 1.1rem;
}

.sheet-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
}

.edit-btn {
    background: #e3f2fd;
    color: #1e88e5;
}

.delete-btn {
    background: #ffebee;
    color: #e53935;
}

.cancel-btn {
    background: #f5f5f5;
    color: #757575;
    text-align: center;
    justify-content: center;
    margin-top: 5px;
}

.date-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.date-filter-row label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #52606d;
}

.date-filter-row input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font: inherit;
    color: var(--text-color);
    background: var(--white);
}

.stats-load-btn {
    justify-content: center;
    background: #e3f2fd;
    color: #1e88e5;
}

.print-btn {
    justify-content: center;
    background: #e8f5e9;
    color: #1b7f3a;
}

.stats-list {
    max-height: 350px;
    overflow-y: auto;
    margin: 5px 0;
}

.stats-period {
    margin-bottom: 8px;
    text-align: center;
    color: #52606d;
    font-size: 0.85rem;
    font-weight: 700;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.stats-table th,
.stats-table td {
    padding: 9px 7px;
    border-bottom: 1px solid #edf2f7;
    text-align: left;
    vertical-align: top;
}

.stats-table th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: #52606d;
    font-size: 0.72rem;
    text-transform: uppercase;
    z-index: 1;
}

.stats-table th:nth-child(2),
.stats-table th:nth-child(3),
.stats-table td:nth-child(2),
.stats-table td:nth-child(3) {
    text-align: right;
    white-space: nowrap;
}

.stats-table tfoot td {
    border-top: 2px solid var(--secondary-color);
    border-bottom: none;
    font-weight: 800;
    background: #f8fafc;
}

.save-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.main-save-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

#exportButton {
    background-color: #27ae60;
    color: white;
}

#updateButton.update-btn {
    background-color: #e67e22;
    color: white;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.3);
}

.main-save-btn:active {
    transform: scale(0.98);
}
