@import './fullcalendar.css';

/* ==========================================================================
   Filament Custom Stylesheet
   - Table Repeater Layout (Horizontal full-width table)
   - Custom Schedule Filter Widgets & Utilities (Light & Dark Mode)
   - Alert Widgets (High-Contrast Light & Dark Mode)
   ========================================================================== */

/* 1. Table Repeater: Force clean full-width horizontal table layout */
.fi-fo-table-repeater > table {
    display: table !important;
    width: 100% !important;
}
.fi-fo-table-repeater > table > thead {
    display: table-header-group !important;
}
.fi-fo-table-repeater > table > tbody {
    display: table-row-group !important;
}
.fi-fo-table-repeater > table > tbody > tr {
    display: table-row !important;
    padding: 0 !important;
}
.fi-fo-table-repeater > table > tbody > tr > td {
    display: table-cell !important;
    padding: 0.5rem 0.75rem !important;
    vertical-align: middle !important;
}
.fi-fo-table-repeater > table > tbody > tr > td .fi-fo-field-label-content {
    display: none !important;
}

/* 2. Schedule Filter Widgets & Utility Classes */
.flex {
    display: flex;
}
.inline-flex {
    display: inline-flex;
}
.flex-col {
    flex-direction: column;
}
.flex-wrap {
    flex-wrap: wrap;
}
.items-center {
    align-items: center;
}
.justify-between {
    justify-content: space-between;
}
.gap-1 {
    gap: 0.25rem;
}
.gap-1\.5 {
    gap: 0.375rem;
}
.gap-2 {
    gap: 0.5rem;
}
.gap-2\.5 {
    gap: 0.625rem;
}
.gap-3 {
    gap: 0.75rem;
}
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}
.mb-1 {
    margin-bottom: 0.25rem;
}
.mb-1\.5 {
    margin-bottom: 0.375rem;
}
.mb-2 {
    margin-bottom: 0.5rem;
}
.mb-3 {
    margin-bottom: 0.75rem;
}
.mb-5 {
    margin-bottom: 1.25rem;
}
.mb-6 {
    margin-bottom: 1.5rem;
}
.mt-0\.5 {
    margin-top: 0.125rem;
}
.mt-1 {
    margin-top: 0.25rem;
}
.mr-1 {
    margin-right: 0.25rem;
}
.pt-2 {
    padding-top: 0.5rem;
}
.pb-3 {
    padding-bottom: 0.75rem;
}
.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}
.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}
.py-1\.5 {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}
.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.py-2\.5 {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
}
.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}
.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.px-2\.5 {
    padding-left: 0.625rem;
    padding-right: 0.625rem;
}
.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}
.p-2\.5 {
    padding: 0.625rem;
}
.p-3\.5 {
    padding: 0.875rem;
}
.block {
    display: block;
}
.w-full {
    width: 100%;
}
.h-3 {
    height: 0.75rem;
    width: 0.75rem;
}
.h-3\.5 {
    height: 0.875rem;
    width: 0.875rem;
}
.h-5 {
    height: 1.25rem;
    width: 1.25rem;
}
.h-8 {
    height: 2rem;
    width: 2rem;
}
.h-10 {
    height: 2.5rem;
    width: 2.5rem;
}
.mx-auto {
    margin-left: auto;
    margin-right: auto;
}
.text-center {
    text-align: center;
}
.text-left {
    text-align: left;
}
.rounded-md {
    border-radius: 0.375rem;
}
.rounded-lg {
    border-radius: 0.5rem;
}
.rounded-xl {
    border-radius: 0.75rem;
}
.border {
    border-width: 1px;
    border-style: solid;
    border-color: #e5e7eb;
}
.border-t {
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #e5e7eb;
}
.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e5e7eb;
}
.border-dashed {
    border-style: dashed;
}
.border-gray-100 {
    border-color: #f3f4f6;
}
.border-gray-200 {
    border-color: #e5e7eb;
}
.border-gray-300 {
    border-color: #d1d5db;
}
.border-transparent {
    border-color: transparent;
}
.divide-y > :not([hidden]) ~ :not([hidden]) {
    border-top-width: 1px;
    border-top-style: solid;
    border-top-color: #e5e7eb;
}

/* Light background colors */
.bg-white {
    background-color: #ffffff;
}
.bg-gray-50 {
    background-color: #f9fafb;
}
.bg-gray-100 {
    background-color: #f3f4f6;
}
.bg-primary-50 {
    background-color: #eff6ff;
}
.bg-primary-600 {
    background-color: #2563eb;
}

/* Light text colors */
.text-white {
    color: #ffffff;
}
.text-gray-400 {
    color: #9ca3af;
}
.text-gray-500 {
    color: #6b7280;
}
.text-gray-600 {
    color: #4b5563;
}
.text-gray-700 {
    color: #374151;
}
.text-gray-900 {
    color: #111827;
}
.text-primary-500 {
    color: #3b82f6;
}
.text-primary-600 {
    color: #2563eb;
}
.text-success-600 {
    color: #16a34a;
}
.text-warning-500 {
    color: #f59e0b;
}
.text-warning-600 {
    color: #d97706;
}
.text-danger-600 {
    color: #dc2626;
}

/* Typography */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}
.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}
.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}
.text-\[10px\] {
    font-size: 10px;
}
.text-\[11px\] {
    font-size: 11px;
}
.font-medium {
    font-weight: 500;
}
.font-semibold {
    font-weight: 600;
}
.font-bold {
    font-weight: 700;
}
.font-mono {
    font-family:
        ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.uppercase {
    text-transform: uppercase;
}
.tracking-wider {
    letter-spacing: 0.05em;
}
.whitespace-nowrap {
    white-space: nowrap;
}
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.shadow-xs {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.overflow-x-auto {
    overflow-x: auto;
}
.opacity-80 {
    opacity: 0.8;
}
.transition-colors {
    transition: all 150ms ease-in-out;
}
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

/* Hover effects (Light Mode) */
.hover\:bg-gray-50\/50:hover {
    background-color: rgba(249, 250, 251, 0.5);
}
.hover\:bg-gray-200:hover {
    background-color: #e5e7eb;
}
.hover\:border-primary-400:hover {
    border-color: #60a5fa;
}
.hover\:underline:hover {
    text-decoration: underline;
}

/* Grid columns */
.grid {
    display: grid;
}
.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-7 {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}
@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sm\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .sm\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Filter Buttons / Pills */
button[wire\:click*="setMajor"],
button[wire\:click*="setGrade"] {
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    outline: none;
}
button[wire\:click*="setMajor"]:hover,
button[wire\:click*="setGrade"]:hover {
    opacity: 0.95;
}

/* Select Dropdowns (Light Mode) */
select[wire\:model\.live] {
    appearance: none;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.35rem 2rem 0.35rem 0.65rem;
    font-size: 0.75rem;
    color: #111827;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
}

/* ==========================================================================
   3. Dark Mode Overrides (High-Specificity & Bulletproof Contrast)
   ========================================================================== */

/* Dark color-scheme for native elements */
html.dark {
    color-scheme: dark;
}

/* Select dropdown in dark mode */
html.dark select[wire\:model\.live],
.dark select[wire\:model\.live],
html.dark select.dark\:bg-gray-900 {
    background-color: #111827 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") !important;
    background-position: right 0.65rem center !important;
    background-repeat: no-repeat !important;
    background-size: 1.25em 1.25em !important;
    padding-right: 2rem !important;
}

html.dark select[wire\:model\.live] option,
.dark select[wire\:model\.live] option {
    background-color: #1f2937 !important;
    color: #f3f4f6 !important;
}

/* Dark Mode Text Colors */
html.dark .dark\:text-white,
.dark .dark\:text-white,
html.dark [class~="dark:text-white"],
.dark [class~="dark:text-white"] {
    color: #ffffff !important;
}

html.dark .dark\:text-gray-100,
.dark .dark\:text-gray-100,
html.dark [class~="dark:text-gray-100"],
.dark [class~="dark:text-gray-100"] {
    color: #f3f4f6 !important;
}

html.dark .dark\:text-gray-200,
.dark .dark\:text-gray-200,
html.dark [class~="dark:text-gray-200"],
.dark [class~="dark:text-gray-200"] {
    color: #e5e7eb !important;
}

html.dark .dark\:text-gray-300,
.dark .dark\:text-gray-300,
html.dark [class~="dark:text-gray-300"],
.dark [class~="dark:text-gray-300"] {
    color: #d1d5db !important;
}

html.dark .dark\:text-gray-400,
.dark .dark\:text-gray-400,
html.dark [class~="dark:text-gray-400"],
.dark [class~="dark:text-gray-400"] {
    color: #9ca3af !important;
}

html.dark .dark\:text-primary-400,
.dark .dark\:text-primary-400,
html.dark [class~="dark:text-primary-400"],
.dark [class~="dark:text-primary-400"] {
    color: #60a5fa !important;
}

html.dark .dark\:text-success-400,
.dark .dark\:text-success-400,
html.dark [class~="dark:text-success-400"],
.dark [class~="dark:text-success-400"] {
    color: #4ade80 !important;
}

html.dark .dark\:text-warning-400,
.dark .dark\:text-warning-400,
html.dark [class~="dark:text-warning-400"],
.dark [class~="dark:text-warning-400"] {
    color: #facc15 !important;
}

html.dark .dark\:text-danger-400,
.dark .dark\:text-danger-400,
html.dark [class~="dark:text-danger-400"],
.dark [class~="dark:text-danger-400"] {
    color: #f87171 !important;
}

/* Dark Mode Backgrounds */
html.dark .dark\:bg-gray-800,
.dark .dark\:bg-gray-800,
html.dark [class~="dark:bg-gray-800"],
.dark [class~="dark:bg-gray-800"] {
    background-color: #1f2937 !important;
}

html.dark .dark\:bg-gray-800\/40,
.dark .dark\:bg-gray-800\/40,
html.dark [class~="dark:bg-gray-800/40"],
.dark [class~="dark:bg-gray-800/40"] {
    background-color: rgba(31, 41, 55, 0.4) !important;
}

html.dark .dark\:bg-gray-800\/60,
.dark .dark\:bg-gray-800\/60,
html.dark [class~="dark:bg-gray-800/60"],
.dark [class~="dark:bg-gray-800/60"] {
    background-color: rgba(31, 41, 55, 0.6) !important;
}

html.dark .dark\:bg-gray-800\/80,
.dark .dark\:bg-gray-800\/80,
html.dark [class~="dark:bg-gray-800/80"],
.dark [class~="dark:bg-gray-800/80"] {
    background-color: rgba(31, 41, 55, 0.85) !important;
}

html.dark .dark\:bg-gray-900,
.dark .dark\:bg-gray-900,
html.dark [class~="dark:bg-gray-900"],
.dark [class~="dark:bg-gray-900"] {
    background-color: #111827 !important;
}

html.dark .dark\:bg-gray-900\/70,
.dark .dark\:bg-gray-900\/70,
html.dark [class~="dark:bg-gray-900/70"],
.dark [class~="dark:bg-gray-900/70"] {
    background-color: rgba(17, 24, 39, 0.75) !important;
}

html.dark .dark\:bg-primary-950\/50,
.dark .dark\:bg-primary-950\/50,
html.dark [class~="dark:bg-primary-950/50"],
.dark [class~="dark:bg-primary-950/50"] {
    background-color: rgba(30, 58, 138, 0.35) !important;
}

/* Dark Mode Borders */
html.dark .dark\:border-gray-700,
.dark .dark\:border-gray-700,
html.dark [class~="dark:border-gray-700"],
.dark [class~="dark:border-gray-700"] {
    border-color: #374151 !important;
}

html.dark .dark\:border-gray-700\/60,
.dark .dark\:border-gray-700\/60,
html.dark [class~="dark:border-gray-700/60"],
.dark [class~="dark:border-gray-700/60"] {
    border-color: rgba(55, 65, 81, 0.6) !important;
}

html.dark .dark\:border-gray-800,
.dark .dark\:border-gray-800,
html.dark [class~="dark:border-gray-800"],
.dark [class~="dark:border-gray-800"] {
    border-color: rgba(55, 65, 81, 0.75) !important;
}

html.dark .dark\:divide-gray-800 > :not([hidden]) ~ :not([hidden]),
.dark .dark\:divide-gray-800 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(55, 65, 81, 0.75) !important;
}

/* Dark Mode Hover States */
html.dark .dark\:hover\:bg-gray-700:hover,
.dark .dark\:hover\:bg-gray-700:hover,
html.dark [class~="dark:hover:bg-gray-700"]:hover,
.dark [class~="dark:hover:bg-gray-700"]:hover {
    background-color: #374151 !important;
    color: #ffffff !important;
}

html.dark .dark\:hover\:bg-gray-800\/40:hover,
.dark .dark\:hover\:bg-gray-800\/40:hover,
html.dark [class~="dark:hover:bg-gray-800/40"]:hover,
.dark [class~="dark:hover:bg-gray-800/40"]:hover {
    background-color: rgba(31, 41, 55, 0.5) !important;
}

html.dark .dark\:hover\:border-primary-600:hover,
.dark .dark\:hover\:border-primary-600:hover,
html.dark [class~="dark:hover:border-primary-600"]:hover,
.dark [class~="dark:hover:border-primary-600"]:hover {
    border-color: #2563eb !important;
}

/* Filter Buttons / Pills in Dark Mode: High-Contrast & Clearly Readable */
html.dark button[wire\:click*="setMajor"]:not(.bg-primary-600),
html.dark button[wire\:click*="setGrade"]:not(.bg-primary-600) {
    background-color: #1f2937 !important;
    color: #e5e7eb !important;
    border: 1px solid rgba(75, 85, 99, 0.7) !important;
}

html.dark button[wire\:click*="setMajor"]:not(.bg-primary-600):hover,
html.dark button[wire\:click*="setGrade"]:not(.bg-primary-600):hover {
    background-color: #374151 !important;
    color: #ffffff !important;
    border-color: rgba(107, 114, 128, 0.9) !important;
}

html.dark button[wire\:click*="setMajor"].bg-primary-600,
html.dark button[wire\:click*="setGrade"].bg-primary-600 {
    background-color: #2563eb !important;
    color: #ffffff !important;
    border: 1px solid #3b82f6 !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3) !important;
}

/* Ensure secondary text in buttons is clear in dark mode */
html.dark button[wire\:click*="setMajor"] span.opacity-80,
html.dark button[wire\:click*="setGrade"] span.opacity-80 {
    opacity: 0.85 !important;
    color: inherit !important;
}

/* Fallback border & card background overrides */
html.dark .dark .border-gray-200,
html.dark .dark .border-gray-800,
html.dark .border-gray-200,
html.dark .border-gray-800 {
    border-color: rgba(55, 65, 81, 0.75);
}

html.dark .bg-gray-50 {
    background-color: rgba(31, 41, 55, 0.5);
}

/* ==========================================================================
   4. Unfilled Journal Alert Widget Component (Light & Dark Mode)
   ========================================================================== */
.scp-alert-container {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.03) 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08);
}
.scp-alert-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.scp-alert-icon-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.scp-alert-icon-box {
    background-color: rgba(239, 68, 68, 0.15);
    padding: 0.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scp-alert-icon {
    width: 24px;
    height: 24px;
    color: #dc2626;
}
.scp-alert-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #b91c1c;
    margin: 0;
}
.scp-alert-subheading {
    font-size: 0.8rem;
    color: #ef4444;
    margin: 0.15rem 0 0 0;
    font-weight: 500;
}
.scp-alert-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.scp-alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.85rem 1.15rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    gap: 0.75rem;
    transition: all 150ms ease-in-out;
}
.scp-alert-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.scp-alert-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.scp-alert-card-subject {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1f2937;
}
.scp-alert-card-time {
    font-size: 0.8rem;
    color: #6b7280;
}
.scp-alert-card-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.scp-alert-card-due {
    font-size: 0.8rem;
    font-weight: 600;
    color: #dc2626;
}

/* Alert Widget in Dark Mode */
html.dark .scp-alert-container {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.06) 100%) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
}
html.dark .scp-alert-heading {
    color: #fca5a5 !important;
}
html.dark .scp-alert-subheading {
    color: #f87171 !important;
}
html.dark .scp-alert-card {
    background-color: rgba(31, 41, 55, 0.85) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}
html.dark .scp-alert-card-subject {
    color: #ffffff !important;
}
html.dark .scp-alert-card-time {
    color: #9ca3af !important;
}
html.dark .scp-alert-card-time strong {
    color: #f3f4f6 !important;
}
html.dark .scp-alert-card-due {
    color: #f87171 !important;
}

/* ==========================================================================
   5. Brand Logo Styles
   ========================================================================== */
/* Generic Brand Logo Wrapper */
.fi-brand-logo-wrapper {
    display: inline-flex;
    align-items: center;
}

/* 5.1 Topbar / Navbar Brand Logo */
.fi-topbar .fi-logo {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 0.85rem !important; /* Margin from left edge so it's not mepet */
    padding-right: 0.5rem !important;
}

.fi-topbar .fi-brand-logo-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important; /* Spacing between logo and text */
}

.fi-topbar .fi-brand-logo-img {
    height: 2.35rem !important;
    width: 2.35rem !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    margin: 0 0.25rem !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
    transition: transform 0.2s ease-in-out;
}

.fi-topbar .fi-brand-logo-img:hover {
    transform: scale(1.05);
}

.fi-topbar .fi-brand-logo-text {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    line-height: 1.25 !important;
}

html:not(.dark) .fi-topbar .fi-brand-logo-text {
    color: #111827 !important;
}

/* 5.2 Sidebar Brand Logo */
.fi-sidebar-header .fi-logo {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    padding-left: 0.5rem !important;
}

.fi-sidebar-header .fi-brand-logo-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.fi-sidebar-header .fi-brand-logo-img {
    height: 2.25rem !important;
    width: 2.25rem !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.2));
}

.fi-sidebar-header .fi-brand-logo-text {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

html:not(.dark) .fi-sidebar-header .fi-brand-logo-text {
    color: #111827 !important;
}

/* 5.3 Login / Auth Pages Brand Logo */
.fi-simple-header .fi-logo {
    height: auto !important;
    margin-bottom: 1.25rem !important;
}

.fi-simple-header .fi-brand-logo-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 0.5rem !important;
}

.fi-simple-header .fi-brand-logo-img {
    height: 4.5rem !important;
    width: 4.5rem !important;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
    transition: transform 0.2s ease-in-out;
}

.fi-simple-header .fi-brand-logo-img:hover {
    transform: scale(1.04);
}

.fi-simple-header .fi-brand-logo-text {
    display: none !important;
}

/* ==========================================================================
   6. User Profile Card Component (Human-Designed UI)
   ========================================================================== */
.scp-profile-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}
.scp-profile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
}
.scp-profile-identity {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.scp-avatar-container {
    position: relative;
    flex-shrink: 0;
    width: 4rem;
    height: 4rem;
}
.scp-avatar-img {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.scp-avatar-fallback {
    width: 4rem;
    height: 4rem;
    border-radius: 9999px;
    background-color: #f1f5f9;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}
.scp-identity-text {
    min-width: 0;
}
.scp-user-name-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
}
.scp-user-name {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
}
.scp-role-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
}
.scp-tag-super-admin {
    background-color: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}
.scp-tag-waka {
    background-color: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}
.scp-tag-guru {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.scp-tag-wali {
    background-color: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.scp-tag-bk {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.scp-tag-siswa {
    background-color: #f0fdfa;
    color: #0f766e;
    border: 1px solid #99f6e4;
}
.scp-tag-default {
    background-color: #f8fafc;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.scp-user-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.35rem;
}
.scp-meta-username {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.75rem;
    color: #64748b;
}
.scp-meta-dot {
    color: #cbd5e1;
}
.scp-card-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 1.25rem 0 1rem 0;
}
.scp-meta-heading {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.75rem;
}
.scp-data-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}
@media (max-width: 768px) {
    .scp-data-grid {
        grid-template-columns: 1fr;
    }
}
.scp-data-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
}
.scp-data-icon {
    width: 1.125rem;
    height: 1.125rem;
    color: #94a3b8;
    margin-top: 0.125rem;
    flex-shrink: 0;
}
.scp-data-content {
    min-width: 0;
    flex: 1;
}
.scp-data-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #64748b;
}
.scp-data-val {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scp-data-val-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    letter-spacing: 0.025em;
}

/* DARK MODE OVERRIDES */
html.dark .scp-profile-card,
.dark .scp-profile-card {
    background-color: #111827;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
}
html.dark .scp-avatar-fallback,
.dark .scp-avatar-fallback {
    background-color: #1f2937;
    color: #f3f4f6;
    border-color: rgba(255, 255, 255, 0.12);
}
html.dark .scp-avatar-img,
.dark .scp-avatar-img {
    border-color: rgba(255, 255, 255, 0.12);
}
html.dark .scp-user-name,
.dark .scp-user-name {
    color: #f9fafb;
}
html.dark .scp-user-meta,
.dark .scp-user-meta {
    color: #9ca3af;
}
html.dark .scp-meta-username,
.dark .scp-meta-username {
    color: #9ca3af;
}
html.dark .scp-meta-dot,
.dark .scp-meta-dot {
    color: #4b5563;
}
html.dark .scp-card-divider,
.dark .scp-card-divider {
    background-color: rgba(255, 255, 255, 0.08);
}
html.dark .scp-meta-heading,
.dark .scp-meta-heading {
    color: #9ca3af;
}
html.dark .scp-data-card,
.dark .scp-data-card {
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.07);
}
html.dark .scp-data-icon,
.dark .scp-data-icon {
    color: #6b7280;
}
html.dark .scp-data-label,
.dark .scp-data-label {
    color: #9ca3af;
}
html.dark .scp-data-val,
.dark .scp-data-val {
    color: #f9fafb;
}
html.dark .scp-data-val-mono,
.dark .scp-data-val-mono {
    color: #f9fafb;
}
html.dark .scp-tag-super-admin,
.dark .scp-tag-super-admin {
    background-color: rgba(126, 34, 206, 0.15);
    color: #d8b4fe;
    border-color: rgba(126, 34, 206, 0.3);
}
html.dark .scp-tag-waka,
.dark .scp-tag-waka {
    background-color: rgba(67, 56, 202, 0.15);
    color: #a5b4fc;
    border-color: rgba(67, 56, 202, 0.3);
}
html.dark .scp-tag-guru,
.dark .scp-tag-guru {
    background-color: rgba(22, 163, 74, 0.15);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.3);
}
html.dark .scp-tag-wali,
.dark .scp-tag-wali {
    background-color: rgba(29, 78, 216, 0.15);
    color: #93c5fd;
    border-color: rgba(29, 78, 216, 0.3);
}
html.dark .scp-tag-bk,
.dark .scp-tag-bk {
    background-color: rgba(180, 83, 9, 0.15);
    color: #fde68a;
    border-color: rgba(180, 83, 9, 0.3);
}
html.dark .scp-tag-siswa,
.dark .scp-tag-siswa {
    background-color: rgba(15, 118, 110, 0.15);
    color: #5eead4;
    border-color: rgba(15, 118, 110, 0.3);
}
html.dark .scp-tag-default,
.dark .scp-tag-default {
    background-color: rgba(255, 255, 255, 0.05);
    color: #d1d5db;
    border-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   7. Waka Schedule Monitoring Widget (Human-Designed UI)
   ========================================================================== */
.scp-waka-widget {
    font-family: inherit;
}
.scp-filter-section {
    margin-bottom: 1.25rem;
}
.scp-filter-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.5rem;
    display: block;
}
.scp-major-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}
.scp-major-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    color: #475569;
    line-height: 1.25;
}
.scp-major-tab:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}
.scp-major-tab.scp-tab-active {
    background-color: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}
.scp-major-subtext {
    font-size: 0.6875rem;
    opacity: 0.75;
}
.scp-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
@media (max-width: 768px) {
    .scp-filter-grid {
        grid-template-columns: 1fr;
    }
}
.scp-select {
    width: 100%;
    font-size: 0.8125rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #0f172a;
    padding: 0.45rem 0.75rem;
    line-height: 1.25;
}
.scp-select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}
.scp-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (max-width: 900px) {
    .scp-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .scp-metrics-grid {
        grid-template-columns: 1fr;
    }
}
.scp-metric-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.scp-metric-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 0.35rem;
}
.scp-metric-val-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}
.scp-metric-number {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    line-height: 1;
}
.scp-metric-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 500;
}
.scp-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    flex-shrink: 0;
}
.scp-dot-neutral { background-color: #94a3b8; }
.scp-dot-success { background-color: #10b981; }
.scp-dot-warning { background-color: #f59e0b; }
.scp-dot-danger { background-color: #f43f5e; }

.scp-table-container {
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    background-color: #ffffff;
}
.scp-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.scp-table thead {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.scp-table th {
    padding: 0.65rem 0.85rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}
.scp-table td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}
.scp-table tbody tr:last-child td {
    border-bottom: none;
}
.scp-table tbody tr:hover td {
    background-color: #f8fafc;
}
.scp-time-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #475569;
    white-space: nowrap;
}
.scp-class-title {
    font-weight: 600;
    color: #0f172a;
}
.scp-major-pill {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.25rem;
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
    margin-left: 0.35rem;
}
.scp-subject-title {
    font-weight: 500;
    color: #0f172a;
}
.scp-teacher-name {
    color: #334155;
}
.scp-room-val {
    color: #64748b;
    font-size: 0.75rem;
}
.scp-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.55rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.scp-status-success {
    background-color: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.scp-status-warning {
    background-color: #fefce8;
    color: #854d0e;
    border: 1px solid #fef08a;
}
.scp-status-danger {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.scp-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    border: 1px dashed #cbd5e1;
    border-radius: 0.5rem;
    background-color: #f8fafc;
}
.scp-empty-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-top: 0.5rem;
}
.scp-empty-desc {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* DARK MODE OVERRIDES */
html.dark .scp-major-tab,
.dark .scp-major-tab {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}
html.dark .scp-major-tab:hover,
.dark .scp-major-tab:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
}
html.dark .scp-major-tab.scp-tab-active,
.dark .scp-major-tab.scp-tab-active {
    background-color: #f8fafc;
    color: #0f172a;
    border-color: #f8fafc;
}
html.dark .scp-filter-grid,
.dark .scp-filter-grid {
    border-top-color: rgba(255, 255, 255, 0.08);
}
html.dark .scp-select,
.dark .scp-select {
    background-color: #111827;
    border-color: rgba(255, 255, 255, 0.12);
    color: #f1f5f9;
}
html.dark .scp-metric-card,
.dark .scp-metric-card {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.07);
}
html.dark .scp-metric-label,
.dark .scp-metric-label {
    color: #94a3b8;
}
html.dark .scp-metric-number,
.dark .scp-metric-number {
    color: #f8fafc;
}
html.dark .scp-table-container,
.dark .scp-table-container {
    background-color: #111827;
    border-color: rgba(255, 255, 255, 0.08);
}
html.dark .scp-table thead,
.dark .scp-table thead {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
html.dark .scp-table th,
.dark .scp-table th {
    color: #94a3b8;
}
html.dark .scp-table td,
.dark .scp-table td {
    border-bottom-color: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
}
html.dark .scp-table tbody tr:hover td,
.dark .scp-table tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.03);
}
html.dark .scp-class-title,
.dark .scp-class-title,
html.dark .scp-subject-title,
.dark .scp-subject-title {
    color: #f8fafc;
}
html.dark .scp-teacher-name,
.dark .scp-teacher-name {
    color: #e2e8f0;
}
html.dark .scp-major-pill,
.dark .scp-major-pill {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}
html.dark .scp-time-val,
.dark .scp-time-val,
html.dark .scp-room-val,
.dark .scp-room-val {
    color: #94a3b8;
}
html.dark .scp-status-success,
.dark .scp-status-success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.25);
}
html.dark .scp-status-warning,
.dark .scp-status-warning {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.25);
}
html.dark .scp-status-danger,
.dark .scp-status-danger {
    background-color: rgba(244, 63, 94, 0.12);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.25);
}
html.dark .scp-empty-state,
.dark .scp-empty-state {
    background-color: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}
html.dark .scp-empty-title,
.dark .scp-empty-title {
    color: #e2e8f0;
}
html.dark .scp-empty-desc,
.dark .scp-empty-desc {
    color: #94a3b8;
}

/* ==========================================================================
   Kalender Akademik Styles
   ========================================================================== */
.scp-cal-grid-header {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
    text-align: center;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.65rem 0;
    color: #4b5563;
}
html.dark .scp-cal-grid-header,
.dark .scp-cal-grid-header {
    border-bottom-color: #1f2937;
    background-color: rgba(31, 41, 55, 0.7);
    color: #9ca3af;
}

.scp-cal-grid-week {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-height: 110px;
    border-bottom: 1px solid #e5e7eb;
}
html.dark .scp-cal-grid-week,
.dark .scp-cal-grid-week {
    border-bottom-color: #1f2937;
}
.scp-cal-grid-week:last-child {
    border-bottom: none;
}

.scp-cal-cell {
    min-height: 110px;
    padding: 0.45rem 0.5rem;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-right: 1px solid #e5e7eb;
    background-color: #ffffff;
    transition: background-color 0.15s ease;
}
@media (min-width: 640px) {
    .scp-cal-cell {
        min-height: 125px;
        padding: 0.5rem 0.65rem;
    }
}
html.dark .scp-cal-cell,
.dark .scp-cal-cell {
    border-right-color: #1f2937;
    background-color: #111827;
}
.scp-cal-cell:last-child {
    border-right: none;
}

.scp-cal-cell-other-month {
    background-color: rgba(249, 250, 251, 0.75) !important;
    color: #9ca3af !important;
}
html.dark .scp-cal-cell-other-month,
.dark .scp-cal-cell-other-month {
    background-color: rgba(17, 24, 39, 0.5) !important;
    color: #4b5563 !important;
}

.scp-cal-cell-weekend {
    background-color: rgba(255, 241, 242, 0.45);
}
html.dark .scp-cal-cell-weekend,
.dark .scp-cal-cell-weekend {
    background-color: rgba(225, 29, 72, 0.05);
}

.scp-cal-cell-interactive:hover {
    background-color: rgba(239, 246, 255, 0.8) !important;
    cursor: pointer;
}
html.dark .scp-cal-cell-interactive:hover {
    background-color: rgba(30, 58, 138, 0.25) !important;
}

.scp-cal-day-num {
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
}

.scp-cal-today-badge {
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background-color: #2563eb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Event Badges in Legend */
.scp-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
}
.scp-legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 9999px;
}

.scp-badge-libur-nasional { background-color: #fee2e2; color: #991b1b; }
.scp-badge-libur-nasional .scp-legend-dot { background-color: #dc2626; }
html.dark .scp-badge-libur-nasional, .dark .scp-badge-libur-nasional { background-color: rgba(239, 68, 68, 0.25); color: #fca5a5; }

.scp-badge-libur-sekolah { background-color: #fef3c7; color: #92400e; }
.scp-badge-libur-sekolah .scp-legend-dot { background-color: #d97706; }
html.dark .scp-badge-libur-sekolah, .dark .scp-badge-libur-sekolah { background-color: rgba(245, 158, 11, 0.25); color: #fde68a; }

.scp-badge-upacara { background-color: #ffe4e6; color: #9f1239; }
.scp-badge-upacara .scp-legend-dot { background-color: #e11d48; }
html.dark .scp-badge-upacara, .dark .scp-badge-upacara { background-color: rgba(244, 63, 94, 0.25); color: #fda4af; }

.scp-badge-ujian { background-color: #e0f2fe; color: #075985; }
.scp-badge-ujian .scp-legend-dot { background-color: #0284c7; }
html.dark .scp-badge-ujian, .dark .scp-badge-ujian { background-color: rgba(14, 165, 233, 0.25); color: #7dd3fc; }

.scp-badge-pkl { background-color: #ccfbf1; color: #115e59; }
.scp-badge-pkl .scp-legend-dot { background-color: #0d9488; }
html.dark .scp-badge-pkl, .dark .scp-badge-pkl { background-color: rgba(20, 184, 166, 0.25); color: #5eead4; }

.scp-badge-ukk { background-color: #f3e8ff; color: #6b21a8; }
.scp-badge-ukk .scp-legend-dot { background-color: #9333ea; }
html.dark .scp-badge-ukk, .dark .scp-badge-ukk { background-color: rgba(168, 85, 247, 0.25); color: #d8b4fe; }

.scp-badge-kegiatan { background-color: #d1fae5; color: #065f46; }
.scp-badge-kegiatan .scp-legend-dot { background-color: #10b981; }
html.dark .scp-badge-kegiatan, .dark .scp-badge-kegiatan { background-color: rgba(16, 185, 129, 0.25); color: #6ee7b7; }

.scp-badge-rapat { background-color: #e0e7ff; color: #3730a3; }
.scp-badge-rapat .scp-legend-dot { background-color: #4f46e5; }
html.dark .scp-badge-rapat, .dark .scp-badge-rapat { background-color: rgba(99, 102, 241, 0.25); color: #a5b4fc; }

/* Calendar Event Pills */
.scp-event-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 3px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: filter 0.15s ease, transform 0.1s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.scp-event-pill:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.scp-pill-danger { background-color: #ef4444 !important; color: #ffffff !important; }
.scp-pill-warning { background-color: #d97706 !important; color: #ffffff !important; }
.scp-pill-rose { background-color: #e11d48 !important; color: #ffffff !important; }
.scp-pill-info { background-color: #0284c7 !important; color: #ffffff !important; }
.scp-pill-teal { background-color: #0d9488 !important; color: #ffffff !important; }
.scp-pill-purple { background-color: #9333ea !important; color: #ffffff !important; }
.scp-pill-success { background-color: #10b981 !important; color: #ffffff !important; }
.scp-pill-primary { background-color: #4f46e5 !important; color: #ffffff !important; }
.scp-pill-gray { background-color: #64748b !important; color: #ffffff !important; }

.scp-grade-tag {
    background-color: rgba(0, 0, 0, 0.28);
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ==========================================================================
   FullCalendar Plugin Visual Polish (Matching LaravelDaily Reference)
   ========================================================================== */
.fi-fc {
    border-radius: 0.75rem;
}

.fi-fc-toolbar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #e5e7eb;
}
html.dark .fi-fc-toolbar,
.dark .fi-fc-toolbar {
    border-bottom-color: #1f2937;
}

.fi-fc-toolbar-section {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.fi-fc-toolbar-heading {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 2rem !important;
    color: #111827 !important;
    letter-spacing: -0.02em;
}
html.dark .fi-fc-toolbar-heading,
.dark .fi-fc-toolbar-heading {
    color: #f9fafb !important;
}

/* FullCalendar Table Grid & Cell Styles */
.fc {
    font-family: inherit !important;
}

.fc .fc-scrollgrid {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    background-color: #ffffff !important;
}
html.dark .fc .fc-scrollgrid,
.dark .fc .fc-scrollgrid {
    border-color: #1f2937 !important;
    background-color: #111827 !important;
}

.fc .fc-col-header-cell {
    background-color: #f9fafb !important;
    padding: 0.65rem 0.25rem !important;
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #4b5563 !important;
    border-color: #e5e7eb !important;
}
html.dark .fc .fc-col-header-cell,
.dark .fc .fc-col-header-cell {
    background-color: rgba(31, 41, 55, 0.7) !important;
    color: #9ca3af !important;
    border-color: #1f2937 !important;
}

.fc .fc-daygrid-day-frame {
    min-height: 105px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
}
@media (min-width: 640px) {
    .fc .fc-daygrid-day-frame {
        min-height: 115px !important;
    }
}

.fc .fc-daygrid-day-top {
    flex-direction: row-reverse !important;
    padding: 2px 4px !important;
}

.fc .fc-daygrid-day-number {
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    padding: 2px 6px !important;
    border-radius: 9999px !important;
}
html.dark .fc .fc-daygrid-day-number,
.dark .fc .fc-daygrid-day-number {
    color: #cbd5e1 !important;
}

.fc .fc-day-other .fc-daygrid-day-number {
    color: #9ca3af !important;
    opacity: 0.7 !important;
}
html.dark .fc .fc-day-other .fc-daygrid-day-number,
.dark .fc .fc-day-other .fc-daygrid-day-number {
    color: #64748b !important;
}

/* Today Cell Highlight */
.fc .fc-day-today {
    background-color: rgba(59, 130, 246, 0.04) !important;
}
html.dark .fc .fc-day-today,
.dark .fc .fc-day-today {
    background-color: rgba(59, 130, 246, 0.08) !important;
}
.fc .fc-day-today .fc-daygrid-day-number {
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Event Bars & Badges */
.fc-event {
    border-radius: 4px !important;
    padding: 2px 6px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06) !important;
    transition: filter 0.15s ease, transform 0.1s ease !important;
    margin-bottom: 2px !important;
}
.fc-event:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-1px);
}

.fc-daygrid-dot-event {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 1px 4px !important;
}

.fc-daygrid-dot-event .fc-event-time {
    font-weight: 700 !important;
    font-size: 0.75rem !important;
}

.fc-daygrid-dot-event .fc-event-title {
    font-weight: 600 !important;
    font-size: 0.75rem !important;
}

/* FullCalendar Buttons & Dark Mode Polish */
html.dark .fc,
.dark .fc {
    --fc-border-color: #1f2937 !important;
    --fc-page-bg-color: #111827 !important;
    --fc-neutral-bg-color: #1f2937 !important;
    --fc-neutral-text-color: #9ca3af !important;
    --fc-today-bg-color: rgba(59, 130, 246, 0.08) !important;
}

html.dark .fc .fc-button-primary,
.dark .fc .fc-button-primary {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}

html.dark .fc .fc-button-primary:hover,
.dark .fc .fc-button-primary:hover {
    background-color: #374151 !important;
    border-color: #4b5563 !important;
    color: #ffffff !important;
}

html.dark .fc .fc-button-primary:not(:disabled).fc-button-active,
.dark .fc .fc-button-primary:not(:disabled).fc-button-active,
html.dark .fc .fc-button-primary:not(:disabled):active,
.dark .fc .fc-button-primary:not(:disabled):active {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}

html.dark .fc-theme-standard td,
html.dark .fc-theme-standard th,
.dark .fc-theme-standard td,
.dark .fc-theme-standard th {
    border-color: #1f2937 !important;
}

html.dark .fc-theme-standard .fc-scrollgrid {
    border-color: #1f2937 !important;
}

html.dark .fc .fc-toolbar-title {
    color: #f9fafb !important;
}

html.dark .fc .fc-list-day-cushion {
    background-color: #1a2234 !important;
    color: #e2e8f0 !important;
}

html.dark .fc .fc-list-event:hover td {
    background-color: #1f2937 !important;
}

/* ==========================================================================
   Full-Viewport Modal Backdrop Fix (No Gaps at Viewport Edges)
   ========================================================================== */
.scp-cal-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 16px !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

html.dark .scp-cal-modal-backdrop,
.dark .scp-cal-modal-backdrop {
    background-color: rgba(3, 7, 18, 0.75) !important;
}
