/* Safety Calendar — scoped styles (.sc-*) */

.sc-root {
    padding: 0 0 1.5rem;
}

.sc-header {
    margin-bottom: 1rem;
}

.sc-title {
    margin-bottom: 0.25rem;
}

.sc-subtitle {
    color: #64748b;
    font-size: 0.9rem;
}

.sc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 1rem;
}

.sc-filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    flex: 0 0 auto;
    padding-top: 0.35rem;
}

.sc-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    flex: 1 1 200px;
}

.sc-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    cursor: pointer;
    user-select: none;
}

.sc-filter-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sc-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sc-color, #64748b);
    flex-shrink: 0;
}

.sc-filter-chip:has(input:checked) {
    border-color: var(--sc-color, #6366f1);
    background: color-mix(in srgb, var(--sc-color, #6366f1) 8%, #fff);
}

.sc-refresh-btn {
    flex-shrink: 0;
}

.sc-assignee-filter {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 999px;
    flex: 0 0 auto;
}

.sc-assignee-filter-readonly {
    border-color: #e2e8f0;
    background: #f8fafc;
}

.sc-assignee-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #4338ca;
    padding-inline: 0.25rem;
}

.sc-assignee-btn {
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.sc-assignee-btn:hover {
    background: #eef2ff;
    color: #4338ca;
}

.sc-assignee-btn.is-active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.28);
}

.sc-assignee-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    padding: 0.15rem 0.35rem;
}

.sc-modal-assignee {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.sc-calendar-root .fc-addTask-button {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
    font-weight: 700 !important;
}

.sc-calendar-root .fc-addTask-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%) !important;
    border-color: #4338ca !important;
    color: #fff !important;
}

.sc-calendar-root {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    min-height: 520px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

/* ── شبكة التقويم ── */
.sc-calendar-root .fc-theme-standard td,
.sc-calendar-root .fc-theme-standard th,
.sc-dash-calendar-root .fc-theme-standard td,
.sc-dash-calendar-root .fc-theme-standard th {
    border-color: #e8edf5 !important;
}

.sc-calendar-root .fc-col-header-cell,
.sc-dash-calendar-root .fc-col-header-cell {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    padding: 0.5rem 0 !important;
}

.sc-calendar-root .fc-col-header-cell-cushion,
.sc-dash-calendar-root .fc-col-header-cell-cushion {
    font-size: 0.82rem;
    font-weight: 800;
    color: #475569;
    padding: 0.35rem 0.25rem;
}

.sc-calendar-root .fc-daygrid-day-frame {
    min-height: 4.5rem;
    transition: background 0.15s ease;
}

.sc-dash-calendar-root .fc-daygrid-day-frame {
    min-height: 2.75rem;
    transition: background 0.15s ease;
}

.sc-calendar-root .fc-daygrid-day-top,
.sc-dash-calendar-root .fc-daygrid-day-top {
    flex-direction: row;
    justify-content: flex-start;
    padding: 0.2rem 0.35rem;
}

.sc-calendar-root .fc-daygrid-day-number,
.sc-dash-calendar-root .fc-daygrid-day-number {
    font-size: 0.82rem;
    font-weight: 800;
    color: #334155;
    padding: 0.25rem 0.45rem;
    border-radius: 8px;
    line-height: 1.2;
}

.sc-calendar-root .fc-day-other .fc-daygrid-day-number,
.sc-dash-calendar-root .fc-day-other .fc-daygrid-day-number {
    color: #94a3b8;
    opacity: 0.75;
}

.sc-calendar-root .fc-day-today .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-day-today .fc-daygrid-day-frame {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    box-shadow: inset 0 0 0 2px #93c5fd;
}

.sc-calendar-root .fc-day-today .fc-daygrid-day-number,
.sc-dash-calendar-root .fc-day-today .fc-daygrid-day-number {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35);
}

.sc-calendar-root .fc-daygrid-day:hover .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-daygrid-day:hover .fc-daygrid-day-frame {
    background: #f1f5f9;
}

/* ── تمييز الجمعة والسبت (عطلة نهاية الأسبوع) ── */
.sc-calendar-root .fc-daygrid-day.sc-weekend-fri .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-daygrid-day.sc-weekend-fri .fc-daygrid-day-frame {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 55%, #fde68a 100%) !important;
}

.sc-calendar-root .fc-daygrid-day.sc-weekend-sat .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-daygrid-day.sc-weekend-sat .fc-daygrid-day-frame {
    background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 55%, #fecdd3 100%) !important;
}

.sc-calendar-root .fc-col-header-cell.sc-weekend-fri,
.sc-dash-calendar-root .fc-col-header-cell.sc-weekend-fri {
    background: linear-gradient(180deg, #fef3c7 0%, #fde68a 100%) !important;
    box-shadow: inset 0 -3px 0 #f59e0b;
}

.sc-calendar-root .fc-col-header-cell.sc-weekend-sat,
.sc-dash-calendar-root .fc-col-header-cell.sc-weekend-sat {
    background: linear-gradient(180deg, #ffe4e6 0%, #fecdd3 100%) !important;
    box-shadow: inset 0 -3px 0 #f43f5e;
}

.sc-calendar-root .fc-col-header-cell.sc-weekend-fri .fc-col-header-cell-cushion,
.sc-dash-calendar-root .fc-col-header-cell.sc-weekend-fri .fc-col-header-cell-cushion {
    color: #b45309;
}

.sc-calendar-root .fc-col-header-cell.sc-weekend-sat .fc-col-header-cell-cushion,
.sc-dash-calendar-root .fc-col-header-cell.sc-weekend-sat .fc-col-header-cell-cushion {
    color: #be123c;
}

.sc-calendar-root .fc-daygrid-day.sc-weekend-fri .fc-daygrid-day-number,
.sc-dash-calendar-root .fc-daygrid-day.sc-weekend-fri .fc-daygrid-day-number {
    color: #b45309;
}

.sc-calendar-root .fc-daygrid-day.sc-weekend-sat .fc-daygrid-day-number,
.sc-dash-calendar-root .fc-daygrid-day.sc-weekend-sat .fc-daygrid-day-number {
    color: #be123c;
}

.sc-calendar-root .fc-day-today.sc-weekend-fri .fc-daygrid-day-frame,
.sc-calendar-root .fc-day-today.sc-weekend-sat .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-day-today.sc-weekend-fri .fc-daygrid-day-frame,
.sc-dash-calendar-root .fc-day-today.sc-weekend-sat .fc-daygrid-day-frame {
    box-shadow: inset 0 0 0 2px #6366f1, 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.sc-truncated-warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.sc-error-card {
    text-align: center;
    padding: 2rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 14px;
    margin-bottom: 1rem;
    color: #991b1b;
}

.sc-error-card i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.sc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sc-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
}

.sc-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 3px solid #2563eb;
}

.sc-modal-badge {
    display: inline-block;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

.sc-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
}

.sc-modal-close {
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    color: #64748b;
}

.sc-modal-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.sc-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.sc-detail-table th {
    text-align: right;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    width: 38%;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.sc-detail-table td {
    padding: 0.55rem 0.75rem;
    color: #1e293b;
    border-bottom: 1px solid #e2e8f0;
    word-break: break-word;
}

.sc-modal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

/* Dashboard widget */
.safety-calendar-dashboard-widget .sc-dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sc-dash-header-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sc-dash-sync-hint {
    font-size: 0.75rem;
    color: #64748b;
    padding: 0.2rem 0.55rem;
    background: #f1f5f9;
    border-radius: 999px;
    white-space: nowrap;
}

.sc-dash-mini-loading {
    margin: 0;
    padding: 2rem 0.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: #64748b;
}

.sc-dash-body {
    padding: 1rem 1.25rem !important;
}

.sc-dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.sc-dash-kpi {
    text-align: center;
    padding: 0.75rem;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}

.sc-dash-kpi-warn {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
}

.sc-dash-kpi-val {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e40af;
    line-height: 1.2;
}

.sc-dash-kpi-warn .sc-dash-kpi-val {
    color: #b91c1c;
}

.sc-dash-kpi-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.sc-dash-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 900px) {
    .sc-dash-grid {
        grid-template-columns: 1fr;
    }
}

.sc-dash-mini-wrap {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0.65rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    min-height: 280px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.sc-dash-list-title {
    font-size: 1rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 0.65rem;
}

.sc-dash-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 340px;
    overflow-y: auto;
}

.sc-dash-event {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    text-align: right;
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-right: 4px solid var(--sc-ev-color, #64748b);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.sc-dash-event:hover {
    background: #f8fafc;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.sc-dash-event-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--sc-ev-color, #64748b) 14%, #fff);
    color: var(--sc-ev-color, #64748b);
    font-size: 1rem;
}

.sc-dash-event-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.sc-dash-event-date {
    font-size: 0.88rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
    direction: ltr;
    text-align: right;
    letter-spacing: 0.02em;
}

.sc-dash-event-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    word-break: break-word;
}

.sc-dash-empty {
    font-size: 0.85rem;
    color: #94a3b8;
    padding: 1rem 0;
}

.sc-dash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
}

.sc-dash-legend-item {
    font-size: 0.72rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.sc-dash-legend-item i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    font-style: normal;
}

.sc-calendar-root .fc,
.sc-dash-calendar-root .fc {
    font-family: inherit;
    --fc-button-bg-color: #ffffff;
    --fc-button-border-color: #e2e8f0;
    --fc-button-text-color: #475569;
    --fc-button-hover-bg-color: #eef2ff;
    --fc-button-hover-border-color: #a5b4fc;
    --fc-button-hover-text-color: #4338ca;
    --fc-button-active-bg-color: #6366f1;
    --fc-button-active-border-color: #4f46e5;
    --fc-button-active-text-color: #ffffff;
}

/* ── شريط أدوات التقويم ── */
.sc-calendar-root .fc-header-toolbar,
.sc-dash-calendar-root .fc-header-toolbar {
    margin-bottom: 1rem !important;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.sc-calendar-root .fc-toolbar-title,
.sc-dash-calendar-root .fc-toolbar-title {
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #0f172a;
    letter-spacing: 0;
}

.sc-dash-calendar-root .fc-toolbar-title {
    font-size: 0.92rem !important;
}

/* ── أزرار عامة ── */
.sc-calendar-root .fc .fc-button,
.sc-dash-calendar-root .fc .fc-button {
    border: 1.5px solid #e2e8f0 !important;
    background: #fff !important;
    color: #475569 !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    padding: 0.48rem 0.9rem !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    line-height: 1.3;
}

.sc-calendar-root .fc .fc-button:hover:not(:disabled),
.sc-dash-calendar-root .fc .fc-button:hover:not(:disabled) {
    background: #eef2ff !important;
    border-color: #a5b4fc !important;
    color: #4338ca !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.18);
}

.sc-calendar-root .fc .fc-button:active:not(:disabled),
.sc-dash-calendar-root .fc .fc-button:active:not(:disabled) {
    transform: scale(0.97);
}

.sc-calendar-root .fc .fc-button:focus,
.sc-dash-calendar-root .fc .fc-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.sc-calendar-root .fc .fc-button:disabled,
.sc-dash-calendar-root .fc .fc-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── أزرار السابق / التالي — أزرار نصية مستقلة بلا أيقونات ── */
.sc-calendar-root .fc-scPrev-button,
.sc-calendar-root .fc-scNext-button,
.sc-dash-calendar-root .fc-scPrev-button,
.sc-dash-calendar-root .fc-scNext-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: unset !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 0 0.4rem !important;
    padding: 0.48rem 1rem !important;
    border-radius: 10px !important;
    border: 1.5px solid #a5b4fc !important;
    background: linear-gradient(180deg, #ffffff 0%, #f5f3ff 100%) !important;
    color: #4338ca !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-shadow: 0 1px 4px rgba(79, 70, 229, 0.14) !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

/* إخفاء أي أيقونة fc الداخلية (مربع tofu) داخل الأزرار النصية */
.sc-calendar-root .fc-scPrev-button .fc-icon,
.sc-calendar-root .fc-scNext-button .fc-icon,
.sc-calendar-root .fc-scToday-button .fc-icon,
.sc-dash-calendar-root .fc-scPrev-button .fc-icon,
.sc-dash-calendar-root .fc-scNext-button .fc-icon,
.sc-calendar-root .fc-scPrev-button::before,
.sc-calendar-root .fc-scNext-button::before,
.sc-dash-calendar-root .fc-scPrev-button::before,
.sc-dash-calendar-root .fc-scNext-button::before {
    display: none !important;
    content: none !important;
}

.sc-calendar-root .fc-scPrev-button:hover:not(:disabled),
.sc-calendar-root .fc-scNext-button:hover:not(:disabled),
.sc-dash-calendar-root .fc-scPrev-button:hover:not(:disabled),
.sc-dash-calendar-root .fc-scNext-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    border-color: #4f46e5 !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.32) !important;
    transform: translateY(-1px);
}

.sc-calendar-root .fc-scPrev-button:active:not(:disabled),
.sc-calendar-root .fc-scNext-button:active:not(:disabled),
.sc-dash-calendar-root .fc-scPrev-button:active:not(:disabled),
.sc-dash-calendar-root .fc-scNext-button:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.sc-dash-calendar-root.sc-fc-compact-nav .fc-scPrev-button,
.sc-dash-calendar-root.sc-fc-compact-nav .fc-scNext-button,
.sc-dash-calendar-root .sc-fc-compact-nav .fc-scPrev-button,
.sc-dash-calendar-root .sc-fc-compact-nav .fc-scNext-button {
    padding: 0.38rem 0.7rem !important;
    font-size: 0.72rem !important;
}

.sc-dash-calendar-root.sc-fc-compact-nav .fc-header-toolbar,
.sc-dash-calendar-root .sc-fc-compact-nav .fc-header-toolbar {
    margin-bottom: 0.65rem !important;
}

.sc-dash-calendar-root.sc-fc-compact-nav .fc-toolbar-chunk,
.sc-dash-calendar-root .sc-fc-compact-nav .fc-toolbar-chunk {
    display: flex;
    align-items: center;
}

.sc-dash-calendar-root .fc-daygrid-event {
    font-size: 0.65rem;
    border-radius: 4px;
    padding: 1px 3px;
}

/* زر اليوم */
.sc-calendar-root .fc-scToday-button,
.sc-dash-calendar-root .fc-scToday-button {
    display: inline-flex !important;
    align-items: center;
    width: auto !important;
    height: auto !important;
    padding: 0.48rem 1rem !important;
    border-radius: 10px !important;
    border: 1.5px solid #93c5fd !important;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%) !important;
    color: #1d4ed8 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.14) !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.sc-calendar-root .fc-scToday-button:hover:not(:disabled),
.sc-dash-calendar-root .fc-scToday-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    border-color: #60a5fa !important;
    color: #1e3a8a !important;
    transform: translateY(-1px);
}

.sc-calendar-root .fc-scToday-button:disabled,
.sc-dash-calendar-root .fc-scToday-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* أزرار تبديل العرض (شهر / أسبوع / …) */
.sc-calendar-root .fc .fc-button-group:has(.fc-dayGridMonth-button) {
    border-radius: 12px !important;
    background: #f8fafc;
    padding: 3px;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.sc-calendar-root .fc-dayGridMonth-button,
.sc-calendar-root .fc-timeGridWeek-button,
.sc-calendar-root .fc-timeGridDay-button,
.sc-calendar-root .fc-listWeek-button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 9px !important;
    color: #64748b !important;
    padding: 0.4rem 0.75rem !important;
}

.sc-calendar-root .fc-dayGridMonth-button:hover,
.sc-calendar-root .fc-timeGridWeek-button:hover,
.sc-calendar-root .fc-timeGridDay-button:hover,
.sc-calendar-root .fc-listWeek-button:hover {
    background: #fff !important;
    color: #4338ca !important;
}

.sc-calendar-root .fc-dayGridMonth-button.fc-button-active,
.sc-calendar-root .fc-timeGridWeek-button.fc-button-active,
.sc-calendar-root .fc-timeGridDay-button.fc-button-active,
.sc-calendar-root .fc-listWeek-button.fc-button-active {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35) !important;
}

.sc-dash-calendar-root .fc {
    font-size: 0.78rem;
}

.sc-ref-toggles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 100%;
    padding: 0.35rem 0 0.15rem;
    border-top: 1px dashed #cbd5e1;
    margin-top: 0.15rem;
}

.sc-ref-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.sc-ref-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    cursor: pointer;
}

.sc-ref-toggle input {
    accent-color: #6366f1;
}

.sc-manage-events-btn {
    margin-inline-start: auto;
}

.sc-cat-bulk {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.sc-cat-bulk-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    color: #4338ca;
    background: #fff;
    border: 1.5px solid #c7d2fe;
    border-radius: 999px;
    padding: 0.32rem 0.7rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sc-cat-bulk-btn:hover {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border-color: #4f46e5;
    color: #fff;
}

.sc-cat-bulk-btn:active {
    transform: scale(0.97);
}

.sc-form-modal {
    max-width: 520px;
}

.sc-custom-form {
    padding: 0 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sc-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
}

.sc-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.sc-form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.sc-color-input {
    height: 38px;
    padding: 0.15rem;
    cursor: pointer;
}

.sc-form-footer {
    justify-content: flex-end;
    gap: 0.5rem;
    padding-top: 0.5rem;
}

.sc-manager-modal {
    max-width: 760px;
}

.sc-manager-sub {
    font-size: 0.82rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.sc-manager-toolbar {
    padding: 0 1.25rem 0.75rem;
}

.sc-manager-body {
    max-height: 50vh;
    overflow: auto;
}

.sc-manager-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.sc-manager-table th,
.sc-manager-table td {
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: start;
}

.sc-manager-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #475569;
}

.sc-ev-disabled {
    opacity: 0.55;
}

.sc-date-menu {
    max-width: 360px;
}

.sc-date-menu-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 1rem;
}

@media (max-width: 640px) {
    .sc-calendar-root .fc-scPrev-button,
    .sc-calendar-root .fc-scNext-button,
    .sc-calendar-root .fc-scToday-button,
    .sc-dash-calendar-root .fc-scPrev-button,
    .sc-dash-calendar-root .fc-scNext-button {
        padding: 0.4rem 0.7rem !important;
        font-size: 0.72rem !important;
    }
}
