/* --- BASE STYLES --- */
body {
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: #f8fafc;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-item.active {
    background: rgba(255, 255, 255, 0.15);
    border-left: 3px solid #fbbf24;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.modal-overlay {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px) saturate(180%);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    /* Removed high z-index to avoid covering content */
}

.modal-blur {
    filter: blur(10px) brightness(0.9);
    transition: filter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    user-select: none;
}

/* Glassmorphism for Modals */
.glass-panel {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin 1s linear infinite;
}

.animate-slide {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

.animate-scale {
    animation: scaleUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}


/* --- LAPORAN GLOBAL STYLES --- */
#page-laporan {
    background-color: #f8fafc;
    min-height: 100vh;
}

#report-editable-area {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 4px 50px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.report-section {
    page-break-inside: avoid;
}

/* Status Chart Colors */
#chart-status .status-row {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Word Editor Utility */
.editing-active [contenteditable="true"] {
    outline: 2px dashed #6366f1 !important;
    outline-offset: 2px;
    cursor: text;
    transition: all 0.2s ease;
}

.editing-active [contenteditable="true"]:hover {
    background: rgba(99, 102, 241, 0.05);
}

.editing-active [contenteditable="true"]:focus {
    outline-color: #4f46e5;
    background: rgba(99, 102, 241, 0.08);
}

/* --- PRINT STYLES --- */
@media print {

    /* Fixed Header Positioning */
    #print-only-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 4.5cm;
        z-index: 1000;
        background: white !important;
        margin-bottom: 0 !important;
        padding: 0.5cm 1cm;
        box-sizing: border-box;
        overflow: hidden;
        border-bottom: 2px solid #e2e8f0;
    }

    /* Fixed Footer Positioning */
    #print-only-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 2cm;
        z-index: 1000;
        background: white !important;
        padding: 0.2cm 1cm;
        box-sizing: border-box;
        border-top: 2px solid #e2e8f0;
    }

    /* Icon Scaling Fixes for Print */
    .w-5 {
        width: 20px !important;
    }

    .h-5 {
        height: 20px !important;
    }

    .w-6 {
        width: 24px !important;
    }

    .h-6 {
        height: 24px !important;
    }

    .w-7 {
        width: 28px !important;
    }

    .h-7 {
        height: 28px !important;
    }

    .w-8 {
        width: 32px !important;
    }

    .h-8 {
        height: 32px !important;
    }

    .w-10 {
        width: 40px !important;
    }

    .h-10 {
        height: 40px !important;
    }

    .w-12 {
        width: 48px !important;
    }

    .h-12 {
        height: 48px !important;
    }

    .rounded-full {
        border-radius: 9999px !important;
    }

    .rounded-xl {
        border-radius: 12px !important;
    }

    svg {
        display: block !important;
        max-width: 100%;
        max-height: 100%;
    }

    #report-editable-area {
        box-shadow: none;
        max-width: 100%;
    }

    .report-section {
        page-break-inside: avoid;
    }

    .report-print-table {
        width: 100%;
        border-collapse: collapse;
    }

    table {
        page-break-inside: auto;
    }

    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
}

/* --- MODAL STYLES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 0;
    border: 1px solid #888;
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    opacity: 0.9;
}

.close:hover,
.close:focus {
    opacity: 1;
    transform: scale(1.1);
}

/* Report Preview Modal Specific Styles */
.report-preview-content {
    max-width: 95vw;
    max-height: 95vh;
}

/* Compact Toolbar Styles */
.compact-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.compact-select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    min-width: 100px;
}

.compact-input {
    width: 45px;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-align: center;
}

.compact-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.compact-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.compact-btn:active {
    transform: scale(0.95);
}

.compact-btn-file {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.compact-btn-file:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.compact-color {
    width: 28px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
}

.compact-slider {
    width: 80px;
    height: 4px;
    cursor: pointer;
}

.compact-value {
    font-size: 10px;
    color: #64748b;
    font-weight: 600;
    min-width: 40px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: #d1d5db;
}

/* Editor Area Styles */
.report-editable-container {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    background: #9ca3af;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

#reportEditableArea {
    width: 210mm;
    min-height: 297mm;
    background: white;
    padding: 0;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.3);
    outline: none;
    color: #000;
    position: relative;
}

/* Report Document Styles */
.report-document {
    width: 100%;
    min-height: 100%;
}

.report-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-bottom: 5px solid #4c51bf;
}

.report-header h1 {
    font-size: 28pt;
    font-weight: 900;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.report-header h2 {
    font-size: 14pt;
    font-weight: 600;
    margin: 5px 0 0;
    opacity: 0.95;
    text-transform: uppercase;
}

.report-header .date-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 10pt;
}

.logo-container {
    flex-shrink: 0;
    background: white;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.report-body {
    padding: 35px 40px;
    background: #f8fafc;
    min-height: 500px;
}

.report-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 30px;
    page-break-inside: avoid;
}

.report-section h3 {
    font-size: 16pt;
    font-weight: 900;
    text-transform: uppercase;
    color: #1e293b;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-section table {
    width: 100%;
    border-collapse: collapse;
}

.report-section th,
.report-section td {
    padding: 10px;
    border: 1px solid #d1d5db;
    text-align: left;
    font-size: 9pt;
}

.report-section th {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    font-size: 8pt;
    letter-spacing: 0.5px;
}

.report-section tbody tr:nth-child(even) {
    background: #f9fafb;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: white;
    border-radius: 10px;
    font-size: 18pt;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 12px;
}

.stat-card {
    padding: 22px;
    border-radius: 10px;
    border: 2px solid;
    text-align: center;
}

.stat-card p:first-child {
    font-size: 8pt;
    margin: 0;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.stat-card p:last-child {
    font-size: 20pt;
    font-weight: 900;
    margin: 10px 0 0;
}

.report-footer {
    background: #1e293b;
    color: white;
    padding: 25px 40px;
    border-top: 5px solid #475569;
}

.footer-left p:first-child {
    font-weight: 800;
    font-size: 11pt;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.footer-left p:last-child {
    font-size: 9pt;
    opacity: 0.7;
    margin: 5px 0 0;
}

.footer-right {
    text-align: right;
}

.footer-right p:first-child {
    font-size: 9pt;
    opacity: 0.8;
    margin: 0;
}

.footer-right p:last-child {
    font-weight: 700;
    font-size: 10pt;
    margin: 5px 0 0;
}

/* Button Utilities for Modal */
.btn-small {
    padding: 4px 12px !important;
    font-size: 12px !important;
}

.btn-primary {
    background-color: #4f46e5;
    color: white;
}

.btn-primary:hover {
    background-color: #4338ca;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

.modal-footer {
    padding: 15px 20px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.modal-footer .footer-left {
    flex: 1;
}

.modal-footer .footer-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Image Helpers */
#bg-preview img,
#logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Premium DateTime Widget */
.datetime-container {
    text-align: right;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.datetime-container:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#clock {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

#date {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive adjustment for mobile */
@media (max-width: 640px) {
    .datetime-container {
        display: none;
        /* Hide on small screens to save space in header */
    }
}

/* ===== MOBILE RESPONSIVE TABLES ===== */
@media (max-width: 768px) {

    /* Hide table headers on mobile */
    table thead {
        display: none;
    }

    /* Make table rows display as cards */
    table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    /* Make table cells display as rows */
    table tbody td {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 20px;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: left;
        overflow-wrap: anywhere;
    }

    table tbody td>* {
        flex: 1;
        min-width: 0;
    }

    table tbody td:last-child {
        border-bottom: none;
    }

    /* Add labels before each cell using data-label attribute */
    table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: #64748b;
        letter-spacing: 0.05em;
        text-align: left;
        flex: 0 0 40%;
        max-width: 140px;
    }

    /* Special handling for action buttons */
    table tbody td:last-child {
        justify-content: flex-end;
        padding-top: 1rem;
        margin-top: 0.5rem;
        border-top: 2px solid #e2e8f0;
    }

    table tbody td:last-child::before {
        content: '';
        display: none;
    }

    /* Adjust button containers in mobile */


    /* Status badges in mobile */
    .status-badge {
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Overflow scroll for tables that can't be restructured */
    .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Compact table text on mobile */
    table {
        font-size: 0.875rem;
    }

    /* Modal adjustments for mobile */
    .modal-content {
        width: 95%;
        max-height: 95vh;
        margin: 1rem;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }

    /* Form adjustments */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }

    /* Stats grid mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Report sections mobile */
    .report-editable-container {
        padding: 1rem;
    }

    #reportEditableArea {
        width: 100%;
        min-height: auto;
    }

    .report-body {
        padding: 1.5rem 1rem;
    }

    .report-section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    .report-section h3 {
        font-size: 1.125rem;
    }
}

/* Tablet responsive (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    table {
        font-size: 0.9rem;
    }

    table th,
    table td {
        padding: 0.625rem;
    }

    .modal-content {
        width: 90%;
    }
}

/* ============================================================
   USER MODE - GOOGLE FORMS STYLE
   ============================================================ */

body.user-mode {
    background-color: transparent !important;
    height: auto !important;
    min-height: 100vh;
    overflow-y: auto !important;
}

/* When in user mode, the modal should not feel like a modal */
body.user-mode #modal-user-form {
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    background-color: transparent;
    min-height: 100vh;
    height: auto !important;
}

body.user-mode #login-page,
body.user-mode #app {
    display: none !important;
}

body.user-mode #modal-user-form .modal-overlay {
    display: none !important;
}

#global-portal-bg {
    background-color: #f8fafc;
}

body.user-mode #global-portal-bg {
    background-color: #f0ebf8;
}

body.user-mode #modal-user-form>div.absolute.inset-0 {
    position: relative !important;
    padding-top: 2rem;
    padding-bottom: 4rem;
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
}

body.user-mode .glass-panel {
    background: white !important;
    backdrop-filter: none !important;
    border: 1px solid #dadce0 !important;
    box-shadow: 0 1px 2px 0 rgba(14, 18, 22, 0.44), 0 1px 3px 1px rgba(11, 14, 16, 0.15) !important;
    border-radius: 8px !important;
}

/* Target the header row to look more like GForms */
body.user-mode #modal-user-form .bg-gradient-to-r {
    border-top: 10px solid #673ab7;
    /* GForms accent top border */
    border-radius: 8px 8px 0 0 !important;
}

/* Desktop spacing */
@media (min-width: 768px) {
    body.user-mode #modal-user-form>div.absolute.inset-0 {
        padding-top: 4rem;
    }
}

/* ============================================================
   RESPONSIVE TABLES (CARDS ON MOBILE)
   ============================================================ */

@media (max-width: 1024px) {
    .responsive-table {
        border: 0 !important;
    }

    .responsive-table thead {
        display: none !important;
    }

    .responsive-table tr {
        display: block !important;
        margin-bottom: 1.5rem !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 1rem !important;
        background: white !important;
        overflow: hidden !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
    }

    .responsive-table td {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        text-align: right !important;
        padding: 1rem !important;
        border-bottom: 1px solid #f1f5f9 !important;
        font-size: 0.875rem !important;
        min-height: 4rem;
    }

    .responsive-table td:last-child {
        border-bottom: none !important;
        background: #f8fafc !important;
        justify-content: center !important;
    }

    .responsive-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 800;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: #64748b;
        margin-right: 1.5rem;
        text-align: left;
        flex-shrink: 0;
        width: 35%;
    }

    .responsive-table td>div,
    .responsive-table td>span {
        flex: 1;
        display: flex;
        justify-content: flex-end;
    }
}

@keyframes bounce-subtle {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s infinite ease-in-out;
}

#user-floating-reminder {
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 2px;
    border-radius: 4px;
    background: white;
    border: 1px solid #e2e8f0;
    font-weight: 500;
}

.cal-day-available {
    background: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.cal-day-pending {
    background: repeating-linear-gradient(45deg,
            #eff6ff,
            #eff6ff 5px,
            #dbeafe 5px,
            #dbeafe 10px) !important;
    border-color: #60a5fa !important;
    color: #1e40af !important;
    font-weight: 700;
    text-shadow: 0 0 2px white;
}

.cal-day-blocked {
    background: repeating-linear-gradient(45deg,
            #fee2e2,
            #fee2e2 5px,
            #fecaca 5px,
            #fecaca 10px) !important;
    border-color: #f87171 !important;
    color: #991b1b !important;
    font-weight: 800;
    text-shadow: 0 0 2px white;
}


.cal-empty {
    visibility: hidden;
}

.cal-picker-card {
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 1rem;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 0.75rem;
    animation: calScaleUp 0.15s ease-out;
}

@keyframes calScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.cal-picker-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem;
}

.month-btn {
    padding: 0.4rem;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    border-radius: 0.5rem;
    transition: all 0.2s;
    border: 1px solid #f1f5f9;
    color: #475569;
    cursor: pointer;
}

.month-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.month-btn.active {
    background: #6366f1;
    color: white !important;
    border-color: #6366f1;
}

.year-nav-btn {
    padding: 0.2rem 0.5rem;
    border-radius: 0.4rem;
    color: #64748b;
    font-weight: bold;
    cursor: pointer;
}

.year-nav-btn:hover {
    background: #f1f5f9;
}

/* --- DASHBOARD CALENDAR STYLES --- */
.calendar-day {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-radius: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: default;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: #f8fafc;
    transform: translateY(-2px);
}

.calendar-day.today {
    background: #fffbeb;
    border: 1px solid #fde68a;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.1);
}

.calendar-day.not-current {
    opacity: 0.3;
}

.calendar-day-num {
    font-size: 14px;
    font-weight: 800;
    color: #475569;
}

.calendar-day-num {
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
    padding: 0 8px;
    line-height: 1;
}

.calendar-day.today .calendar-day-num {
    color: #b45309;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}

.event-tag {
    font-size: 10px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    color: white;
    width: 100%;
    position: relative;
    display: block;
    box-sizing: border-box;
    line-height: 1.2;
}

.event-tag.span-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: -2px;
    width: calc(100% + 4px);
}

.event-tag.span-mid {
    border-radius: 0;
    margin-left: -2px;
    margin-right: -2px;
    width: calc(100% + 4px);
}

.event-tag.span-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -2px;
    width: calc(100% + 4px);
}

.event-tag.dewan {
    background: #6366f1;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
}

.event-tag.peralatan {
    background: #a855f7;
    box-shadow: 0 2px 4px rgba(168, 85, 247, 0.2);
}

.event-tag.more {
    background: #cbd5e1;
    color: #475569;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.event-dot.dewan {
    background: #6366f1;
}

.event-dot.peralatan {
    background: #a855f7;
}

.calendar-day-active-bg {
    position: absolute;
    inset: 4px;
    background: #6366f1;
    border-radius: 10px;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s ease;
    z-index: 0;
}

.calendar-day.has-event:hover .calendar-day-active-bg {
    opacity: 0.05;
    transform: scale(1);
}

.calendar-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #1e293b;
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.4;
    white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.calendar-day:hover .calendar-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

.calendar-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}