/* ==========================================================================
   Loading Animation
   ========================================================================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9375rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Scroll to Top Button
   ========================================================================== */
.scroll-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.5);
}

.scroll-top-btn:active {
    transform: translateY(-2px) scale(0.95);
}

/* ==========================================================================
   SweetAlert2 Custom Styles
   ========================================================================== */
.repair-swal-popup {
    border-radius: 16px !important;
    padding: 2rem !important;
}

.repair-swal-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
}

.swal2-html-container {
    margin: 0 !important;
    padding: 0 !important;
}

.swal2-confirm {
    padding: 0.75rem 2rem !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.2s ease !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2) !important;
}

/* ==========================================================================
   Clickable Table Rows
   ========================================================================== */
.repairs-table tbody tr {
    cursor: pointer;
    transition: all 0.2s ease;
}

.repairs-table tbody tr:hover {
    background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

.repairs-table tbody tr:active {
    transform: translateX(2px) scale(0.98);
}

/* ==========================================================================
   Looker Studio Link
   ========================================================================== */
.looker-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: all 0.3s ease;
}

.looker-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    text-decoration: none;
    color: white;
}

.looker-link:active {
    transform: translateY(0);
}

/* ==========================================================================
   Repair Form Link Button
   ========================================================================== */
.repair-form-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.repair-form-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    text-decoration: none;
    color: white;
}

/* ==========================================================================
   Telegram-Style Summary Card
   ========================================================================== */
.tg-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 600px;
    border: 1px solid #e5e7eb;
}

.tg-header {
    background: linear-gradient(135deg, #0088cc, #0077b5);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.tg-bot-icon {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.2);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tg-time {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.tg-body {
    padding: 1.5rem;
}

.tg-title {
    font-weight: 700;
    font-size: 1.0625rem;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.tg-date {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin: 0 0 1rem 0;
}

.tg-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tg-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 0.9rem;
}

.tg-stat-row.tg-success {
    background: #f0fdf4;
}

.tg-stat-row.tg-success strong {
    color: #22c55e;
}

.tg-stat-row.tg-warning {
    background: #fffbeb;
}

.tg-stat-row.tg-warning strong {
    color: #f59e0b;
}

.tg-stat-row.tg-purple {
    background: #f5f3ff;
}

.tg-stat-row.tg-purple strong {
    color: #8b5cf6;
}

.tg-stat-row.tg-danger {
    background: #fef2f2;
}

.tg-stat-row.tg-danger strong {
    color: #ef4444;
}

.tg-subtitle {
    font-weight: 700;
    font-size: 0.9375rem;
    color: #111827;
    margin: 0 0 0.75rem 0;
}

/* Department Ranking Bars */
.tg-departments,
.tg-workload {
    margin-bottom: 1.25rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.tg-dept-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.tg-dept-rank {
    font-weight: 700;
    color: #6b7280;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.tg-dept-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #374151;
}

.tg-dept-bar {
    width: 80px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.tg-dept-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 4px;
    transition: width 0.6s ease;
}

.tg-dept-count {
    font-weight: 600;
    color: #111827;
    min-width: 2rem;
    text-align: right;
    flex-shrink: 0;
}

.tg-footer {
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ==========================================================================
   Visitor Counter
   ========================================================================== */
.visitor-card {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(59, 130, 246, 0.05));
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.visitor-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.visitor-icon {
    font-size: 1.5rem;
}

.visitor-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.visitor-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.visitor-divider {
    width: 1px;
    height: 40px;
    background: #e5e7eb;
}