@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.tab-btn {
    position: relative;
    border-bottom: 3px solid transparent;
    color: #6b7280;
}

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

.tab-btn.active {
    color: #4338ca;
    border-bottom-color: #4338ca;
    background-color: #eef2ff;
}

.metric-card {
    transition: all 0.15s ease;
}

.metric-card:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.metric-input:focus {
    background-color: #fff;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
    height: 28px;
}

#department-tabs::-webkit-scrollbar {
    height: 3px;
}

#department-tabs::-webkit-scrollbar-track {
    background: #f3f4f6;
}

#department-tabs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

@media (max-width: 640px) {
    .tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.96); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(40px) scale(0.96); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0); }
}

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

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

.animate-slide-in-right {
    animation: slideInRight 0.4s ease-out forwards;
}

.animate-slide-in-down {
    animation: slideInDown 0.3s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.25s ease-out forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.skeleton-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.skeleton-line {
    height: 14px;
    margin-bottom: 12px;
    border-radius: 6px;
}

.skeleton-line-short { width: 40%; }
.skeleton-line-medium { width: 65%; }
.skeleton-line-long { width: 90%; }

.skeleton-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-block {
    height: 120px;
    border-radius: 12px;
}

#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    pointer-events: auto;
    animation: toastIn 0.35s ease-out forwards;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 320px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.toast:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.16);
}

.toast.removing {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-success {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-color: #a7f3d0;
    color: #065f46;
}

.toast-error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
    color: #991b1b;
}

.toast-warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fde68a;
    color: #92400e;
}

.toast-info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #bfdbfe;
    color: #1e40af;
}

.toast-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 700;
    font-size: 0.875rem;
    line-height: 1.3;
}

.toast-message {
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 2px;
    line-height: 1.4;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

.toast-success .toast-progress { background: #10b981; }
.toast-error .toast-progress { background: #ef4444; }
.toast-warning .toast-progress { background: #f59e0b; }
.toast-info .toast-progress { background: #3b82f6; }

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    animation: scaleIn 0.25s ease-out;
}

.confirm-icon-danger {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-icon-danger svg {
    width: 28px;
    height: 28px;
    color: #ef4444;
}

.confirm-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    outline: none;
}

.confirm-btn-cancel {
    background: #f3f4f6;
    color: #374151;
}

.confirm-btn-cancel:hover {
    background: #e5e7eb;
}

.confirm-btn-danger {
    background: #ef4444;
    color: white;
}

.confirm-btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

nav {
    transition: box-shadow 0.2s ease;
}

nav.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.nav-link {
    position: relative;
    transition: color 0.2s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #4f46e5;
    border-radius: 1px;
    transition: width 0.2s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.card-hover {
    transition: all 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease;
}

.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:active {
    transform: scale(0.98);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot-green { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot-yellow { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.status-dot-red { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.status-dot-gray { background: #9ca3af; }

.kpi-bar {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 24px;
}

.kpi-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    position: relative;
    transition: all 0.2s ease;
}

.kpi-item:hover {
    transform: translateY(-2px);
}

.kpi-item + .kpi-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: #e5e7eb;
}

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

.kpi-change {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

.change-up-good { color: #10b981; }
.change-down-good { color: #10b981; }
.change-up-bad { color: #ef4444; }
.change-down-bad { color: #ef4444; }
.change-neutral { color: #9ca3af; }

.footer-pro {
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e5e7eb;
}
