/* Selected asset row highlight — persists after modal closes */
.asset-row.selected,
.asset-row[style*="background: rgb(237, 233, 254)"] {
    background: #ede9fe !important;
    border-left: 3px solid #667eea !important;
}
.asset-row {
    border-left: 3px solid transparent;
}

@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; }
.animate-pulse-soft { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.gradient-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.gradient-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.gradient-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.gradient-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.card-hover { transition: all 0.3s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.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); }
.badge-glow { box-shadow: 0 0 10px rgba(0,0,0,0.1); }
.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 { visibility: hidden; }
body.ready { visibility: visible; }

#appContent.fade-in {
    animation: appFadeIn 0.6s ease forwards;
}

.modal {
    background: white;
    width: 90%; max-width: 400px;
    border-radius: 24px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.08);
    overflow: hidden;
    padding: 0;
}
.modal::before {
    content: '';
    display: block;
    height: 7px;
    background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
    background-size: 200% 100%;
    animation: shimmerBar 3s linear infinite;
}
@keyframes shimmerBar {
    0%   { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
.modal-body {
    padding: 28px 32px 28px;
}

#processingOverlay {
    position: fixed; inset: 0;
    background: rgba(15, 15, 40, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    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: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 2.2rem 2.8rem;
    text-align: center;
    box-shadow: 0 32px 64px rgba(0,0,0,0.2);
    animation: cardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 280px;
}

.overlay-logo {
    width: 56px; height: 56px;
    border-radius: 50%; overflow: hidden;
    background: #0a1628;
    border: 2px solid rgba(55,48,163,0.2);
    box-shadow: 0 0 0 6px rgba(55,48,163,0.08);
    margin: 0 auto 18px;
}
.overlay-logo img { width: 100%; height: 100%; object-fit: cover; }

.overlay-title {
    font-size: 16px; font-weight: 700;
    color: #1e293b; margin: 0 0 4px;
}
.overlay-subtitle {
    font-size: 12px; color: #94a3b8;
    margin: 0 0 4px;
}

.spinner-ring {
    width: 52px; height: 52px;
    border-radius: 50%;
    border: 4px solid rgba(55,48,163,0.12);
    border-top-color: #3730A3;
    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: 7px; height: 7px; border-radius: 50%;
    background: #3730A3;
    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: 3px;
    background: rgba(55,48,163,0.1);
    border-radius: 99px;
    margin-top: 1.25rem;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3730A3, #6366f1);
    border-radius: 99px;
    animation: progressBar 2.5s ease forwards;
}
.progress-fill.green { background: linear-gradient(90deg, #10b981, #059669); }
.progress-fill.orange { background: linear-gradient(90deg, #f59e0b, #d97706); }

.shimmer-row td { padding: 1rem 1.5rem; }
.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; }

/* ── LOGIN PAGE ───────────────────────────────────────────── */
#loginModal {
    background: linear-gradient(rgba(15,15,40,0.28), rgba(15,15,40,0.35)), url('bg.webp');
    background-size: cover; background-position: center; background-repeat: no-repeat;
    align-items: center; justify-content: center;
}
#loginModal::after {
    content: ''; position: fixed; inset: 0; background: white; z-index: 0;
    animation: overlayFadeOut 1s ease forwards; pointer-events: none;
}

.login-split {
    position: relative; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 100vh;
    padding: 40px 20px;
    box-sizing: border-box;
    animation: loginFadeIn 0.5s ease both;
}

/* FORM CARD */
.login-split-right {
    background: white;
    border-radius: 20px;
    padding: 32px 36px;
    width: 100%; max-width: 370px;
    box-shadow: 0 32px 80px rgba(0,0,0,0.35);
}

/* hide left panel — no longer needed */
.login-split-left { display: none; }
.lp-circle, .lp-left-content { display: none; }

.lp-form-wrap { width: 100%; }

/* Logo + branding inside form card */
.lp-card-header {
    display: flex; flex-direction: column; align-items: center;
    margin-bottom: 16px;
}
.lp-card-logo {
    width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    background: #0a1628;
    box-shadow: 0 6px 18px rgba(102,126,234,0.3);
    margin-bottom: 10px;
}
.lp-card-logo img { width: 100%; height: 100%; object-fit: cover; }
.lp-company { color: #2f318e; }
.lp-card-company {
    font-size: 16px; font-weight: 800; color: #2f318e;
    text-align: center; margin-bottom: 3px;
    white-space: nowrap;
}
.lp-card-sub {
    font-size: 11px; font-weight: 600; color: #94a3b8;
    letter-spacing: 0.08em; text-transform: uppercase;
}
.lp-card-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin-bottom: 24px;
}

.lp-welcome { font-size: 22px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.lp-welcome-sub { font-size: 13px; color: #94a3b8; margin-bottom: 28px; }
.lp-form { display: flex; flex-direction: column; gap: 14px; }
.lp-field { display: flex; flex-direction: column; gap: 5px; }
.lp-label { font-size: 10px; font-weight: 700; color: #475569; letter-spacing: 0.05em; text-transform: uppercase; }
.lp-input-wrap { position: relative; }
.lp-input-icon {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: #94a3b8; pointer-events: none;
}
.lp-input {
    width: 100%; box-sizing: border-box;
    padding: 9px 14px 9px 38px;
    background: #f8fafc; border: 1.5px solid #e2e8f0;
    border-radius: 10px; font-size: 13px; color: #1e293b;
    outline: none; transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.lp-input:focus { background: white; border-color: #667eea; box-shadow: 0 0 0 4px rgba(102,126,234,0.1); }
.lp-input::placeholder { color: #cbd5e1; }
.lp-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #1e293b !important;
}
.lp-error {
    font-size: 13px; color: #ef4444;
    background: #fef2f2; border: 1px solid #fecaca;
    border-radius: 10px; padding: 9px 14px; text-align: center;
}
.lp-btn {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white; border: none; border-radius: 12px;
    font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 4px;
    box-shadow: 0 6px 20px rgba(102,126,234,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}
.lp-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(102,126,234,0.55); }
.lp-btn:active { transform: translateY(0); }
.lp-footer { font-size: 11px; color: #cbd5e1; text-align: center; margin-top: 24px; }

@media (max-width: 480px) {
    .login-split-right { padding: 36px 24px; border-radius: 20px; }
}

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; }

#inventoryTable {
    border-collapse: collapse;
    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 th {
    padding: 14px 16px;
    border-bottom: 2px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f1f5f9;
    color: #374151;
    box-shadow: 0 1px 0 #e5e7eb;
}
#inventoryTable thead th:first-child {
    padding: 14px 0;
    text-align: center;
}
#inventoryTable th:nth-child(1),
#inventoryTable td:nth-child(1) { width: 48px;  min-width: 48px;  max-width: 48px;  text-align: center; }
#inventoryTable th:nth-child(2),
#inventoryTable td:nth-child(2) { width: 110px; min-width: 110px; max-width: 110px; cursor: default; pointer-events: none; text-align: center; }
#inventoryTable th:nth-child(3),
#inventoryTable td:nth-child(3) { width: 130px; min-width: 175px; max-width: 175px; cursor: default; pointer-events: none; text-align: center; }
#inventoryTable th:nth-child(4),
#inventoryTable td:nth-child(4) { width: 130px; min-width: 180px; max-width: 180px; cursor: default; pointer-events: none; text-align: center; }
#inventoryTable th:nth-child(5),
#inventoryTable td:nth-child(5) { width: 185px; min-width: 185px; max-width: 185px; cursor: default; pointer-events: none; text-align: center; }
#inventoryTable th:nth-child(6),
#inventoryTable td:nth-child(6) { width: 150px; min-width: 130px; max-width: 130px; cursor: default; pointer-events: none; text-align: center; }
#inventoryTable th:nth-child(7),
#inventoryTable td:nth-child(7) { width: 190px; min-width: 160px; max-width: 160px; text-align: center; }
#inventoryTable th { pointer-events: auto; cursor: default; }
#inventoryTable td:nth-child(1) { pointer-events: auto; }
#inventoryTable tbody tr { border-bottom: 1px solid #e5e7eb; }

/* ── 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; }
.donut-wrap { position: relative; width: 150px; height: 150px; 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: 28px; 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; }
