body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background-color: #f4f4f9;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 80px repeat(78, minmax(15px, 1fr));
    grid-template-rows: 60px repeat(7, 60px); 
    gap: 1px;
    background-color: #ccc;
    border: 1px solid #999;
    overflow-x: auto;
}

.cell {
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 11px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #eee;
}

.row-even { background-color: #f9f9f9; }
.row-odd { background-color: #ebebeb; }

.header-time {
    background-color: #e0e0e0;
    font-weight: bold;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 10px;
}
.header-day {
    background-color: #d0d0d0;
    font-weight: bold;
}

.event-block {
    color: #000;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    box-sizing: border-box;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.4);
    mix-blend-mode: multiply; 
    overflow: hidden;
    white-space: normal; 
    line-height: 1.3;
    cursor: pointer; 
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.9), -1px -1px 2px rgba(255, 255, 255, 0.9);
}

.tooltip {
    position: absolute;
    display: none; 
    background-color: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    min-width: 150px;
    gap: 15px; /* Adds space between columns */
}

.tooltip-entry {
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #555;
    break-inside: avoid;
}

.tooltip-entry:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.control-panel {
    margin-top: 30px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.control-panel h3 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #333;
}

.hint-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #444;
}

.input-group input, .input-group select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-primary {
    background-color: #4caf50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary:hover {
    background-color: #45a049;
}

#save-notice {
    font-size: 12px;
    color: #d32f2f;
    font-style: italic;
}

/* --- POPUP MENU STYLES --- */
.popup-menu {
    position: absolute;
    display: none;
    background-color: white;
    border: 1px solid #ccc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 2000;
    overflow: hidden;
    min-width: 120px;
}
.popup-menu-item {
    padding: 10px 15px;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    font-weight: bold;
}
.popup-menu-item:hover {
    background-color: #f0f0f0;
}
.popup-menu-item:last-child { border-bottom: none; }

/* --- BUTTON STYLES --- */
.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.btn-secondary { background-color: #e0e0e0; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; }
.btn-secondary:hover { background-color: #ccc; }
.btn-danger { background-color: #d32f2f; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; }
.btn-danger:hover { background-color: #b71c1c; }
.btn-danger-outline { background-color: transparent; border: 1px solid #d32f2f; color: #d32f2f; padding: 8px 15px; border-radius: 4px; cursor: pointer; }
.btn-danger-outline:hover { background-color: #ffebee; }

/* --- PAGE HEADER & FILTER --- */
.page-header {
    display: flex;
    justify-content: space-between; /* Pushes items to opposite sides */
    align-items: center;
    margin-bottom: 15px;
}

.page-header h2 {
    margin: 0;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #fff;
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-group label {
    font-size: 14px;
    font-weight: bold;
    color: #444;
}

.filter-group select {
    padding: 6px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}