@keyframes slideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes progressBar { 0% { width: 0%; } 30% { width: 40%; } 60% { width: 70%; } 85% { width: 88%; } 100% { width: 100%; } }
@keyframes dotBounce { 0%, 80%, 100% { transform: scale(0); opacity: 0.3; } 40% { transform: scale(1); opacity: 1; } }
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes cardPop { 0% { opacity: 0; transform: scale(0.85) translateY(20px); } 70% { transform: scale(1.03) translateY(-2px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes rowAppear { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes appFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlayFadeOut { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes loginFadeIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.animate-slide { animation: slideIn 0.4s ease-out; }
.animate-fade  { animation: fadeIn 0.3s ease-out; }
.gradient-primary { background: #6366f1; }
.glass { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); }
.input-modern { transition: all 0.2s ease; }
.input-modern:focus { transform: translateY(-1px); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.btn-modern { transition: all 0.2s ease; }
.btn-modern:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.btn-modern:active { transform: translateY(0); }
.readonly-input { background-color: #f9fafb; color: #6b7280; cursor: not-allowed; }

.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: none; display: flex; align-items: center; justify-content: center; z-index: 1000; }
body { opacity: 0; transition: opacity 0.3s; }
body.ready { opacity: 1; }
#appContent.fade-in { animation: appFadeIn 0.6s ease forwards; }
.modal { background: white; padding: 2rem; border-radius: 1rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); max-width: 400px; width: 90%; }
#loginModal .modal { max-width: 380px; padding: 2rem 2rem 1.75rem; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,0.22); }

#loginModal { background: linear-gradient(rgba(0,0,0,0.2),rgba(0,0,0,0.4)), url('../bg.webp'); background-size: cover; background-position: center; }
#loginModal::after { content: ''; position: fixed; inset: 0; background: white; z-index: 0; animation: overlayFadeOut 1s ease forwards; pointer-events: none; }
#loginModal .modal { position: relative; z-index: 1; animation: loginFadeIn 0.45s cubic-bezier(0.34,1.56,0.64,1) both; }

#processingOverlay { position: fixed; inset: 0; background: rgba(15,15,35,0.45); backdrop-filter: blur(6px); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 9999; animation: overlayFadeIn 0.25s ease; }
#processingOverlay.hidden { display: none; }
.processing-card { background: white; border-radius: 1.5rem; padding: 2.5rem 3rem; text-align: center; box-shadow: 0 30px 60px rgba(0,0,0,0.3); animation: cardPop 0.4s cubic-bezier(0.34,1.56,0.64,1); min-width: 280px; }
.spinner-ring { width: 64px; height: 64px; border-radius: 50%; border: 5px solid #e0e7ff; border-top-color: #6366f1; border-right-color: #6366f1; animation: spin 0.8s linear infinite; margin: 0 auto 1.25rem; }
.spinner-ring.green  { border-color: #d1fae5; border-top-color: #10b981; border-right-color: #059669; }
.spinner-ring.red    { border-color: #fee2e2; border-top-color: #ef4444; border-right-color: #dc2626; }
.spinner-ring.orange { border-color: #fef3c7; border-top-color: #f59e0b; border-right-color: #d97706; }
.dot-loader { display: flex; gap: 6px; justify-content: center; margin-top: 0.75rem; }
.dot-loader span { width: 8px; height: 8px; border-radius: 50%; background: #6366f1; animation: dotBounce 1.4s ease-in-out infinite; }
.dot-loader span:nth-child(1) { animation-delay: 0s; }
.dot-loader span:nth-child(2) { animation-delay: 0.2s; }
.dot-loader span:nth-child(3) { animation-delay: 0.4s; }
.dot-loader.green span  { background: #10b981; }
.dot-loader.red span    { background: #ef4444; }
.dot-loader.orange span { background: #f59e0b; }
.progress-track { width: 100%; height: 4px; background: #e0e7ff; border-radius: 99px; margin-top: 1.25rem; overflow: hidden; }
.progress-fill { height: 100%; background: #6366f1; border-radius: 99px; animation: progressBar 2.5s ease forwards; }
.progress-fill.green  { background: #10b981; }
.progress-fill.orange { background: #f59e0b; }

.shimmer-block { height: 16px; border-radius: 6px; background: linear-gradient(90deg,#f0f0f0 25%,#e0e0e0 50%,#f0f0f0 75%); background-size: 1000px 100%; animation: shimmer 1.5s infinite linear; }
.login-btn-loading { pointer-events: none; opacity: 0.85; }

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

#assetTableBody tr { animation: rowAppear 0.25s ease both; }
#searchInput:focus { outline: none !important; box-shadow: none !important; }

/* ── TABLE ── */
#inventoryTable { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: 100%; min-width: 860px; }
#inventoryTable th, #inventoryTable td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; padding: 0; }
#inventoryTable thead tr { background: transparent; }
#inventoryTable thead th { padding: 10px 16px; background: #6366f1; color: #fff; border-right: 1px solid rgba(255,255,255,0.15); box-shadow: none; }
#inventoryTable thead th:last-child { border-right: none; }
#inventoryTable thead th:first-child { padding: 10px 0; text-align: center; }
#inventoryTable th:nth-child(1), #inventoryTable td:nth-child(1) { width: 48px;  text-align: center; }
#inventoryTable th:nth-child(2), #inventoryTable td:nth-child(2) { width: 145px; text-align: center; }
#inventoryTable th:nth-child(3), #inventoryTable td:nth-child(3) { width: 135px; text-align: center; }
#inventoryTable th:nth-child(4), #inventoryTable td:nth-child(4) { width: 210px; text-align: center; }
#inventoryTable th:nth-child(5), #inventoryTable td:nth-child(5) { width: 100px; text-align: center; }
#inventoryTable th:nth-child(6), #inventoryTable td:nth-child(6) { width: 85px;  text-align: center; }
#inventoryTable th:nth-child(7), #inventoryTable td:nth-child(7) { width: 115px; text-align: center; }
#inventoryTable tbody tr { border-bottom: 1px solid #d1d5db; }
#inventoryTable tbody td { border-bottom: 1px solid #d1d5db; }

/* ── ACTION BUTTONS ── */
.action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 7px; border: none;
    cursor: pointer; transition: all 0.15s ease; margin: 0 2px;
}
.action-btn svg { width: 14px; height: 14px; }
.action-btn-view   { background: #f1f5f9; color: #64748b; }
.action-btn-view:hover   { background: #e2e8f0; color: #334155; }
.action-btn-edit   { background: #ede9fe; color: #7c3aed; }
.action-btn-edit:hover   { background: #ddd6fe; color: #5b21b6; }
.action-btn-delete { background: #fff1f2; color: #e11d48; }
.action-btn-delete:hover { background: #ffe4e6; color: #be123c; }

/* ── CHART CARDS ── */
.chart-card { background: white; border-radius: 16px; padding: 20px; box-shadow: 0 2px 16px rgba(0,0,0,0.07); }
.chart-card-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: #94a3b8; text-transform: uppercase; margin-bottom: 16px; }
.donut-layout { display: flex; align-items: center; gap: 20px; min-height: 220px; }
.donut-wrap { position: relative; width: 160px; height: 160px; flex-shrink: 0; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center-num { font-size: 32px; font-weight: 800; color: #1e293b; line-height: 1; }
.donut-center-lbl { font-size: 10px; color: #94a3b8; font-weight: 600; margin-top: 2px; }
.status-legend { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.status-legend-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; transition: background 0.15s; cursor: default; }
.status-legend-item:hover { background: #f8fafc; }
.status-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-legend-text { font-size: 11px; color: #475569; flex: 1; }
.status-legend-count { font-size: 12px; font-weight: 700; color: #1e293b; min-width: 24px; text-align: right; }

/* ── EMPLOYEE AUTOCOMPLETE ── */
#empDropdown .emp-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0fdf4; transition: background 0.15s; }
#empDropdown .emp-item:last-child { border-bottom: none; }
#empDropdown .emp-item:hover { background: #f0fdf4; }
#empDropdown .emp-item .emp-name { font-size: 13px; font-weight: 700; color: #111827; text-transform: uppercase; }
#empDropdown .emp-item .emp-id { font-size: 11px; color: #059669; font-weight: 600; margin-top: 1px; }
#empDropdown .emp-loading, #empDropdown .emp-empty { padding: 10px 12px; font-size: 12px; color: #9ca3af; text-align: center; }

#clearSearch { display: none; }
#clearSearch.visible { display: flex; }

/* ── VIEW MODAL TABLE ── */
.view-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.view-detail-table tr { border-bottom: 1px solid #f3f4f6; }
.view-detail-table tr:last-child { border-bottom: none; }
.view-detail-table td { padding: 7px 10px; vertical-align: top; }
.view-detail-table td:first-child { width: 38%; color: #6b7280; font-weight: 600; font-size: 12px; white-space: nowrap; }
.view-detail-table td:last-child  { color: #111827; font-weight: 600; word-break: break-word; }
.view-section-label { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #94a3b8; padding: 10px 10px 4px; }
