* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background: #f4f5f7;
    color: #1f2937;
}
.topnav {
    background: #1f2937;
    padding: 12px 20px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.topnav a {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
}
.topnav .brand {
    font-weight: bold;
    color: #fff;
    font-size: 16px;
    margin-right: auto;
}
.container {
    max-width: 1000px;
    margin: 20px auto;
    padding: 0 16px;
}
.flash {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 12px;
}
.flash-success { background: #d1fae5; color: #065f46; }
.flash-error { background: #fee2e2; color: #991b1b; }
.flash-info { background: #dbeafe; color: #1e40af; }

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.day-cell {
    background: #fff;
    border-radius: 6px;
    min-height: 90px;
    padding: 6px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
}
.day-cell.out-of-month { opacity: 0.35; }
.day-number { font-weight: 600; margin-bottom: 4px; }
.event-chip {
    display: block;
    border-radius: 4px;
    padding: 2px 4px;
    margin-bottom: 2px;
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.add-event-link {
    display: inline-block;
    font-size: 11px;
    color: #6b7280;
    text-decoration: none;
}

.legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.chat-box {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 12px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 12px;
}
.chat-msg { margin-bottom: 8px; }
.chat-msg .author { font-weight: 600; margin-right: 6px; }
.chat-msg .time { color: #9ca3af; font-size: 11px; margin-left: 6px; }

form input[type=text], form input[type=date], form input[type=time],
form input[type=number], form input[type=file], form select, form textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}
button, .btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 9px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}
button.danger, .btn.danger { background: #ef4444; }

table.preview-table { width: 100%; border-collapse: collapse; }
table.preview-table th, table.preview-table td {
    border: 1px solid #e5e7eb;
    padding: 6px;
    font-size: 13px;
    text-align: left;
}
.confidence-low { background: #fef3c7; }
