.calendar-page,
.calendar-admin-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;
}

.calendar-header,
.admin-toolbar {
    margin-bottom: 20px;
}

.calendar-header h1,
.admin-toolbar h1 {
    margin: 0;
}

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin: 16px 0 20px;
    flex-wrap: wrap;
}

.calendar-nav h2 {
    margin: 0;
}

.calendar-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 16px 0 20px;
}

.calendar-controls .calendar-jump-form {
    justify-content: center;
}

.calendar-controls .calendar-nav {
    width: 100%;
    max-width: 720px;
    margin: 0;
}

.calendar-jump-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-jump-form select {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #8aa7c7;
    border-radius: 6px;
    background: #fff;
    color: #1c4a7e;
    font: inherit;
}

.calendar-jump-form select:focus {
    outline: 2px solid #9ec5fe;
    outline-offset: 2px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-weekday {
    font-weight: 700;
    text-align: center;
    padding: 8px 4px;
    background: #f3f4f6;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.calendar-cell {
    min-height: 110px;
    border: 1px solid #ddd;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
}

.calendar-cell.is-empty {
    background: #f8f8f8;
}

.calendar-cell.has-items {
    position: relative;
    background: #f8fbff;
    border-color: #b6d4fe;
}

.calendar-cell.has-items::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 4px;
    background: #5b9cff;
    border-radius: 4px;
}

.calendar-cell.is-selected {
    background: #eef6ff;
    border-color: #0b4ea2;
    box-shadow: 0 0 0 2px rgba(11, 78, 162, 0.15);
}

.calendar-cell.is-today {
    border-color: #5b9cff;
    border-width: 2px;
}

.calendar-cell:not(.has-items) {
    opacity: 0.85;
}

.calendar-cell-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.calendar-cell-link:hover {
    text-decoration: none;
}

.calendar-cell-link:focus {
    outline: 2px solid #9ec5fe;
    outline-offset: 2px;
}

.calendar-cell-link.has-items:hover,
.calendar-cell.has-items:hover {
    background: #eef5ff;
    border-color: #8cb7ff;
}

.calendar-cell-link:hover.calendar-cell,
.calendar-cell.calendar-cell-link:hover {
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.calendar-dayhead {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.calendar-count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1c4a7e;   /* tie into your theme blue */
    background: #dbeafe;
    border-radius: 999px;
}

.calendar-items {
    padding-top: 4px;
}

.calendar-more {
    font-size: 12px;
    color: #6c757d;
}

.calendar-today-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    color: #0b4ea2;
    background: #dbeafe;
    border-radius: 999px;
}

.calendar-cell.is-today .calendar-dayhead strong {
    color: #0b4ea2;
}

.calendar-links,
.calendar-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-items {
    margin-top: 6px;
    font-size: 13.5px; /* was likely 12–13 */
    line-height: 1.4;
    color: #2c3e50; /* darker, but not black */
}

.calendar-more {
    font-size: 12px;
    color: #666;
}

.calendar-selected-day {
    margin-top: 24px;
}

.calendar-selected-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.calendar-selected-day-header h2 {
    margin: 0;
}

.calendar-empty-state {
    margin: 12px 0 18px;
    padding: 12px 14px;
    border: 1px solid #d6e9c6;
    background: #f6fbf2;
    color: #355e2b;
    border-radius: 8px;
}

.calendar-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-card {
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 8px;
    background: #fff;
}

.calendar-card-header {
    margin-bottom: 8px;
}

.calendar-card-header h3 {
    margin: 0;
}

.calendar-draft {
    color: #a33;
}

.admin-table-wrap {
    margin-top: 16px;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.admin-table th,
.admin-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    background: #f3f4f6;
}

.action-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-form {
    display: grid;
    gap: 16px;
    max-width: 700px;
    background: #fff;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
}

.error {
    color: #b00020;
    font-size: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.inline-action {
    display: inline-flex;
    margin: 0;
}

@media (max-width: 800px) {
    .calendar-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calendar-weekday {
        display: none;
    }
}

.text-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #8aa7c7;
    border-radius: 6px;
    background: #fff;
    color: #1c4a7e;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    box-sizing: border-box;
    vertical-align: middle;
}

.text-btn:hover {
    background: #eef5ff;
}

.text-btn.secondary {
    border-color: #8aa7c7;
    color: #1c4a7e;
}

.text-btn.secondary:hover {
    background: #eef5ff;
}

/* Calendar Status css */

.calendar-status {
    margin: 0 0 6px;
    padding: 3px 8px;
    border: 1px solid #cfe2ff;
    border-radius: 6px;
    background: #eef5ff;
    color: #1f3c63;
    font-size: 0.92rem;
    line-height: 1.15;
}

.calendar-status-info {
border-color: #cfe2ff;
background: #eef5ff;
color: #1f3c63;
}

.calendar-status-success {
border-color: #b7e4c7;
background: #e9f7ef;
color: #1e4620;
}

.calendar-status-error {
border-color: #f5c2c7;
background: #f8d7da;
color: #842029;
}

.calendar-admin-page {
margin-top: 0;
}

.admin-page-shell {
max-width: 1020px;
margin: 0 auto;
}

.admin-page-header {
margin: 0 0 4px;
}

.admin-page-title {
font-size: 1.35rem;
font-weight: 600;
line-height: 1.2;
margin: 0;
}

.admin-flash-slot {
height: 42px;
margin: 0 0 10px;
}

.admin-flash,
.admin-flash-placeholder {
box-sizing: border-box;
height: 42px;
border-radius: 8px;
}

.admin-flash {
display: flex;
align-items: center;
padding: 0 12px;
border: 1px solid #d7dde5;
background: #f8fafc;
font-size: 0.95rem;
line-height: 1.2;
}

.admin-flash-success {
border-color: #b7e4c7;
background: #e9f7ef;
color: #1e4620;
}

.admin-flash-error {
border-color: #f5c2c7;
background: #f8d7da;
color: #842029;
}

.selected-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.items-actions {
    white-space: nowrap;
}

.icon-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    color: #222;
    cursor: pointer;
    line-height: 1;
    font-size: 16px;
    box-sizing: border-box;
    vertical-align: middle;
}

.icon-btn:hover {
    background: #f4f4f4;
}

.icon-btn.is-disabled,
.icon-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f8f8f8;
}

.danger-link {
    border-color: #d99;
    color: #a11;
}

.danger-link:hover {
    background: #fff5f5;
}

.calendar-preview-title {
    font-size: 12px;
    color: #444;
    line-height: 1.35;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.calendar-results {
    margin-top: 24px;
}

.calendar-results-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.calendar-results-table th,
.calendar-results-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

.calendar-results-table th {
    background: #f3f4f6;
}

.calendar-results-summary {
    max-width: 420px;
}

.calendar-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.calendar-description {
    margin-top: 8px;
}
