body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f4f4f9;
    padding: 10px;
    margin: 0;
}

/* Login Elements */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    width: 90%;
    max-width: 320px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
}

.error-text {
    color: red;
    font-size: 0.85em;
    display: none;
}

/* Main App Layout */
#app-container {
    display: none;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
    flex-wrap: wrap;
    gap: 10px;
}

.status-msg {
    color: #4CAF50;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    background: #e8f5e9;
    padding: 4px 8px;
    border-radius: 4px;
}

.logout-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    padding: 0;
}

.month-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #333;
    color: white;
    padding: 10px;
    border-radius: 6px;
}

.month-header h2 {
    margin: 0;
    font-size: 1.2em;
    text-align: center;
    flex-grow: 1;
}

.month-header button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

/* Controls & Quick Add */
.controls-container {
    background: #eef2f5;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

#selected-date-label {
    font-weight: bold;
    color: #2196F3;
    font-size: 1.1em;
}

.panel-label {
    margin: 0;
    font-size: 0.85em;
    color: #666;
    font-weight: bold;
    width: 100%;
}

.quick-add-panel,
.manual-add-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.name-chip {
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px 15px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
}

.name-chip:hover,
.name-chip:active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

.manual-add-panel input {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    flex-grow: 1;
    min-width: 120px;
}

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

/* Delete Mode Toggle Styles */
#delete-toggle {
    padding: 8px 12px;
    border-radius: 4px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.delete-off {
    background: #e0e0e0;
    color: #555;
}

.delete-on {
    background: #d32f2f;
    color: white;
    box-shadow: 0 0 8px rgba(211, 47, 47, 0.5);
}

/* Calendar Grid */
.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
    font-size: 0.85em;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.day {
    border: 1px solid #e0e0e0;
    min-height: 80px;
    padding: 3px;
    background: #fafafa;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background 0.2s;
    overflow-x: hidden;
}

.day.locked {
    cursor: not-allowed;
    background: #eaeaea;
    opacity: 0.7;
}

.day.today {
    border: 2px solid #4CAF50;
    background: #e8f5e9;
}

.day.selected-day {
    border: 2px solid #2196F3;
    background: #e3f2fd;
}

.date-number {
    font-size: 0.8em;
    color: #888;
    margin-bottom: 3px;
    text-align: right;
    font-weight: bold;
}


/* Tags */
.tag {
    background: #333;
    color: white;
    padding: 4px;
    border-radius: 3px;
    font-size: 0.75em;
    margin-bottom: 3px;
    text-align: center;
    word-break: break-all;
    transition: background 0.2s;
}

/* Dynamic Delete Hover - Only applies when authorized via JS */
.tag.deletable {
    cursor: pointer;
}

.tag.deletable:hover {
    background: #d32f2f;
    text-decoration: line-through;
}

@media (max-width: 600px) {
    .day {
        min-height: 60px;
    }

    .tag {
        font-size: 0.65em;
        padding: 2px;
    }

    .status-row {
        flex-direction: column;
        align-items: flex-start;
    }

    #delete-toggle {
        width: 100%;
    }
}