* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-container h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 3rem;
    opacity: 0.9;
}

/* Header */
.app-header {
    background: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 1.8rem;
    color: #667eea;
}

.header-controls {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-danger {
    background: #f44336;
    color: white;
}

.btn-danger:hover {
    background: #da190b;
}

/* Calendar Container */
.calendar-container {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Mini Calendar Sidebar */
.mini-calendar-sidebar {
    flex-shrink: 0;
    width: 220px;
}

.mini-calendar {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.mini-nav-btn {
    background: none;
    border: none;
    color: #667eea;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.mini-nav-btn:hover {
    background: #f0f0f0;
}

.mini-month-display {
    font-size: 1rem;
    font-weight: 400;
    color: #333;
}

.mini-calendar-days-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 0.5rem;
}

.mini-day-name {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #666;
    padding: 0.5rem 0;
}

.mini-day-name.weekend {
    color: #f44336;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-day-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.mini-day-cell:hover {
    background: #f0f0f0;
}

.mini-day-cell.other-month {
    color: #ccc;
    cursor: default;
}

.mini-day-cell.other-month:hover {
    background: transparent;
}

.mini-day-cell.weekend {
    color: #f44336;
}

.mini-day-cell.today {
    background: #667eea;
    color: white;
    font-weight: 700;
}

.mini-day-cell.today:hover {
    background: #5568d3;
}

/* Események jelölése a mini kalendárban */
.mini-day-cell.has-events {
    background: #FFA500;
    color: #000;
    font-weight: 700;
}

.mini-day-cell.today.has-events {
    background: #667eea;
    color: #FFA500;
    font-weight: 700;
}

.mini-day-cell.weekend.has-events {
    background: #FFA500;
    color: #f44336;
    font-weight: 700;
}

/* Periódikus Szűrő Panel */
.periodic-filter-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-top: 1rem;
}

.periodic-filter-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #FFA500;
}

.periodic-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.periodic-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.periodic-filter-item:hover {
    background: #f5f5f5;
}

.periodic-filter-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.periodic-filter-name {
    font-size: 0.9rem;
    color: #333;
    flex: 1;
}

.no-periodic-events {
    text-align: center;
    color: #999;
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Main Calendar Area */
.main-calendar-area {
    flex: 1;
    min-width: 0;
}

.calendar-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #5568d3;
}

.month-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

/* Calendar Wrapper */
.calendar-wrapper {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 250px);
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.day-header {
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.day-header:last-child {
    border-right: none;
}

/* Calendar Grid */
.calendar-grid-container {
    overflow: hidden;
    position: relative;
    flex: 1;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.day-cell {
    min-height: 120px;
    border: 1px solid #e0e0e0;
    padding: 0.5rem;
    background: white;
    transition: all 0.3s ease;
    position: relative;
}

.day-cell:hover {
    background: #f9f9f9;
}

.day-cell.even-month {
    background: #fbf1fb;
}

.day-cell.today {
    background: #fff3e0;
}

.day-cell.today .day-number {
    background: #667eea;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
}

.day-cell.other-month {
    background: #fafafa;
    opacity: 0.6;
}

.day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.day-cell.weekend .day-number {
    color: #f44336;
}

.day-cell.other-month .day-number {
    color: #999;
}

.add-event-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 24px;
    height: 24px;
    border-radius: 0;
    background: transparent;
    color: #f44336;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.day-cell:hover .add-event-btn {
    opacity: 1;
}

/* Events */
.events-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 90px;
    overflow: hidden;
}

.event-item {
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: white;
    font-weight: 500;
}

.event-item:hover {
    opacity: 0.8;
    transform: translateX(2px);
}

.event-item .event-value {
    color: white;
    font-weight: 600;
    margin-left: 4px;
}

.event-value {
    font-weight: 600;
    margin-left: 4px;
}

/* Periódikus események megkülönböztetése */
.event-item.periodic-event {
    border-left: 3px solid rgba(255, 255, 255, 0.5);
    font-style: italic;
    color: #000;
}

.event-item.periodic-event::before {
    content: '🔄 ';
    font-size: 0.8em;
}

.event-item.periodic-event .event-value {
    color: #000;
}

/* Event List Container */
.event-list-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.event-section {
    margin-bottom: 2rem;
}

.event-section.periodic-section {
    background: #f9f9f9;
    padding: 1rem;
    border-radius: 8px;
}

.section-title {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid #667eea;
}

.periodic-section .section-title {
    border-bottom-color: #FFA500;
}

.event-periodic-info {
    color: #667eea;
    font-weight: 600;
    font-size: 0.9rem;
}

.periodic-row {
    background: #fffbf0 !important;
}

.periodic-row:hover {
    background: #fff5e0 !important;
}

.event-list-header {
    background: white;
    padding: 1.5rem;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.event-list-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.filter-controls {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

.event-list-content {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-height: calc(100vh - 250px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Event Table Styles */
.event-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    table-layout: fixed;
}

.event-table thead tr,
.event-table tbody tr {
    display: table;
    width: 100%;
    table-layout: fixed;
}

.event-table thead {
    background: #667eea;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.event-table th {
    padding: 0.4rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5568d3;
}

.event-table th:nth-child(1) {
    width: 140px; /* Dátum - keskeny */
}

.event-table th:nth-child(2) {
    width: 100px; /* Típus - keskeny */
}

.event-table th:nth-child(3) {
    width: auto; /* Szöveg - a legszélesebb (maradék hely) */
}

.event-table th:nth-child(4) {
    width: 65px; /* Érték - keskeny */
}

.event-table th:nth-child(5) {
    width: 90px; /* Műveletek - 2 gombnak */
    text-align: right;
}

.event-table td:nth-child(1) {
    width: 140px; /* Dátum - keskeny */
}

.event-table td:nth-child(2) {
    width: 100px; /* Típus - keskeny */
}

.event-table td:nth-child(3) {
    width: auto; /* Szöveg - a legszélesebb (maradék hely) */
}

.event-table td:nth-child(4) {
    width: 65px; /* Érték - keskeny */
}

.event-table td:nth-child(5) {
    width: 90px; /* Műveletek - 2 gombnak */
}

.event-table tbody tr {
    transition: background 0.2s ease;
}

.event-table tbody tr:hover {
    background: #f9f9f9;
}

.event-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.event-table tbody tr:nth-child(even):hover {
    background: #f5f5f5;
}

.event-table td {
    padding: 0.4rem;
    border-bottom: 1px solid #e0e0e0;
}

.event-date {
    color: #666;
    white-space: nowrap;
    font-size: 0.9rem;
}

.event-type {
    white-space: nowrap;
}

.type-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
}

.event-title {
    color: #333;
    font-weight: 500;
}

.event-value {
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.event-actions {
    white-space: nowrap;
    text-align: right;
}

.event-action-btn {
    padding: 0.4rem 0.4rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0.15rem;
}

.event-edit-btn {
    background: #667eea;
}

.event-edit-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.event-delete-btn {
    background: #f44336;
}

.event-delete-btn:hover {
    background: #da190b;
    transform: scale(1.1);
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #999;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
}

.modal-body {
    padding: 1.5rem;
}

/* Form */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #bbb;
    opacity: 1;
}

.form-group input::-webkit-input-placeholder {
    color: #bbb;
    opacity: 1;
}

.form-group input::-moz-placeholder {
    color: #bbb;
    opacity: 1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-help {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-top: 0.25rem;
    font-weight: normal;
}

/* Periódikus mezők stílusai */
#periodicFields {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #e0e0e0;
}

#sinFields {
    background-color: #e8f4f8;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    border: 1px solid #d0e8f0;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Types List */
.types-list {
    margin-bottom: 2rem;
}

.type-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 0.3rem;
    transition: background 0.2s ease;
}

.type-item:hover {
    background: #f9f9f9;
}

.type-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.type-color-box {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid #ddd;
    flex-shrink: 0;
}

.type-details {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.type-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    min-width: 120px;
}

.type-default-value {
    color: #667eea;
    font-weight: 500;
    font-size: 0.85rem;
    min-width: 110px;
}

.type-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.edit-type-btn {
    padding: 0.4rem 0.8rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.edit-type-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.delete-type-btn {
    padding: 0.4rem 0.8rem;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.delete-type-btn:hover {
    background: #da190b;
    transform: translateY(-1px);
}

.add-type-form {
    padding-top: 1rem;
    border-top: 2px solid #e0e0e0;
}

.add-type-form h3 {
    margin-bottom: 1rem;
    color: #333;
}

.color-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-preview {
    width: 50px;
    height: 38px;
    border-radius: 6px;
    border: 2px solid #ddd;
    background-color: #4CAF50;
    flex-shrink: 0;
}

.color-input-wrapper input[type="color"] {
    flex: 1;
    height: 38px;
    cursor: pointer;
}

/* Custom Select Dropdown */
.custom-select-wrapper {
    position: relative;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select-trigger:hover {
    border-color: #667eea;
}

.custom-select.open .custom-select-trigger {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.custom-select-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.custom-select-arrow {
    color: #999;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.custom-select.open .custom-select-arrow {
    transform: rotate(180deg);
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-select-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.custom-select-option:hover {
    background: #f5f5f5;
}

.custom-select-option.selected {
    background: #e8eaf6;
}

.type-color-indicator {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

/* Database Management Modal */
.database-stats {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.database-stats h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.database-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.db-action-section {
    padding: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
}

.db-action-section.danger-section {
    border-color: #f44336;
    background: #fff5f5;
}

.db-action-section h4 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.1rem;
}

.db-action-desc {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.db-action-desc.warning {
    color: #f44336;
    font-weight: 600;
}

.db-action-btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

.selected-file {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #333;
    min-height: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Chart Screen Styles */
.chart-container {
    display: flex;
    gap: 0;
    align-items: flex-start;
    height: calc(100vh - 80px);
}

.chart-sidebar {
    flex-shrink: 0;
    width: 200px;
    background: white;
    border-right: 1px solid #e0e0e0;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

.chart-filter-panel {
    background: transparent;
}

.chart-filter-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #667eea;
}

.chart-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chart-filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chart-filter-item:hover {
    background: #f5f5f5;
}

.chart-filter-checkbox {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.chart-filter-name {
    font-size: 0.9rem;
    color: #333;
    flex: 1;
}

.chart-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding-right: 0;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 2rem;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chart-date-display {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

#chartCanvas {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: grab;
    display: block;
    width: 100%;
}

#chartCanvas:active {
    cursor: grabbing;
}

/* Responsive */
@media (max-width: 768px) {
    /* Naptár nézet optimalizálás */
    .calendar-container {
        flex-direction: column;
        padding: 0;
        margin: 0;
    }
    
    /* Mini calendar és periódikus szűrő elrejtése mobilon */
    .mini-calendar-sidebar {
        display: none;
    }
    
    /* Fő naptár terület teljes szélességű */
    .main-calendar-area {
        width: 100%;
    }
    
    /* Naptár navigáció kompaktabb */
    .calendar-navigation {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .nav-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .month-display {
        font-size: 0.9rem;
    }
    
    .calendar-header,
    .calendar-grid {
        font-size: 0.65rem;
    }
    
    .day-header {
        padding: 0.5rem 0.25rem;
    }

    .day-cell {
        min-height: 60px;
        padding: 0.2rem;
    }
    
    .day-number {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .event-item {
        font-size: 0.6rem;
        padding: 1px 2px;
    }

    /* Header optimalizálás - SOKKAL kompaktabb */
    .app-header {
        flex-direction: column;
        gap: 0.4rem;
        padding: 0.5rem 0.5rem;
    }
    
    .app-header h1 {
        font-size: 1.1rem;
    }

    .header-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .header-controls .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.7rem;
        border-radius: 4px;
    }

    /* Form optimalizálás */
    .form-row {
        grid-template-columns: 1fr;
    }

    .event-list-item-header {
        flex-direction: column;
    }

    .event-list-actions {
        margin-top: 1rem;
    }
    
    /* Grafikon nézet optimalizálás */
    .chart-container {
        flex-direction: column;
        height: auto;
    }
    
    /* Grafikon sidebar elrejtése mobilon */
    .chart-sidebar {
        display: none;
    }
    
    /* Grafikon terület teljes szélességű */
    .chart-area {
        width: 100%;
        padding: 0;
    }
    
    .chart-controls {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .chart-date-display {
        font-size: 1rem;
    }
    
    /* Canvas nagyobb legyen portrait módban */
    #chartCanvas {
        height: 300px !important;
        width: 100% !important;
    }
}

/* Landscape mód mobilon */
@media (max-width: 768px) and (orientation: landscape) {
    #chartCanvas {
        height: 400px !important;
    }
    
    .calendar-wrapper {
        max-height: calc(100vh - 180px);
    }
}

/* Tablet méret (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .mini-calendar-sidebar {
        width: 180px;
    }

    .chart-sidebar {
        width: 180px;
    }
}

/* Tennis Stats Sidebar */
.tennis-stats-sidebar {
    flex-shrink: 0;
    width: 180px;
}

.tennis-stats-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
}

.tennis-stats-panel h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #28a745;
}

#tennisStatsTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

#tennisStatsTable th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    color: #666;
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
}

#tennisStatsTable td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

#tennisStatsTable tr.tennis-row td {
    font-weight: 600;
    color: #333;
}

#tennisStatsTable tr.player-row td {
    color: #666;
    font-size: 0.8rem;
}

#tennisStatsTable tr.separator td {
    padding: 0.25rem 0;
}

#tennisStatsTable tr.separator hr {
    border: none;
    border-top: 1px dashed #ddd;
}

#tennisStatsTable .stat-total {
    text-align: right;
    font-weight: 600;
    color: #28a745;
}

.stats-edit-link {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    color: #667eea;
    font-size: 0.8rem;
    text-decoration: none;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.stats-edit-link:hover {
    background: #f5f5f5;
    color: #5568d3;
}

/* Tennis stats responsive */
@media (max-width: 768px) {
    .tennis-stats-sidebar {
        display: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tennis-stats-sidebar {
        width: 150px;
    }
}
