:root {
    --primary-color: #4f46e5;
    --secondary-color: #818cf8;
    --accent-color: #c7d2fe;
    --bg-color: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --danger-color: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Blobs */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 10s infinite alternate;
}

.blob-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-color);
    top: -50px;
    left: -50px;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    bottom: -100px;
    right: -50px;
    animation-delay: -5s;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-color);
    top: 40%;
    left: 30%;
    animation-duration: 15s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Common Layout */
.container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Glassmorphism Components */
.glass-card,
.glass-header,
.glass-input-wrapper,
.glass-dropdown {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Login Screen */
#login-container {
    justify-content: center;
    align-items: center;
}

.login-card {
    padding: 40px;
    width: 100%;
    text-align: center;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.login-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* Forms */
.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s;
    margin-top: 10px;
}

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

.error-msg {
    color: var(--danger-color);
    margin-top: 10px;
    font-size: 0.9rem;
    min-height: 20px;
}

/* Dashboard */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details h2 {
    font-size: 1rem;
    font-weight: 600;
}

.badge {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--accent-color);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

/* Search */
.search-area {
    margin-bottom: 25px;
    position: relative;
}

.glass-input-wrapper {
    display: flex;
    position: relative;
}

.glass-input-wrapper input {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.spinner {
    position: absolute;
    right: 15px;
    top: 50%;
    /* Adjusted from 12px to 50% for explicit centering */
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--secondary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Maintain translateY in animation */

.glass-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    z-index: 10;
}

.search-item {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.2s;
}

.search-item:last-child {
    border-bottom: none;
}

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

.item-name {
    display: block;
    font-weight: 500;
    color: white;
}

.item-codes {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Inventory List */
.inventory-list-area h3 {
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--accent-color);
}

.inventory-item {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
}

.inv-details h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.inv-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    gap: 10px;
}

.inv-qty {
    background: var(--primary-color);
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.inv-qty-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.inv-actions {
    display: flex;
    gap: 8px;
}

.btn-icon-small {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    background: var(--primary-color);
    color: white;
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Mobile Bottom Sheet feel */
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    /* Bottom sheet radius */
    padding: 25px;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.modal.active .modal-content {
    transform: translateY(0);
}

@media (min-width: 600px) {
    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: 20px;
        transform: scale(0.9);
    }

    .modal.active .modal-content {
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.product-info-highlight {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 10px;
}

.mb-3 {
    margin-bottom: 20px;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 5px;
}

.modal-actions {
    margin-top: 25px;
}

.row-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: white;
    border-radius: 12px;
    cursor: pointer;
}

.full-width {
    width: 100%;
}

/* Dashboard Actions */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-bar h3 {
    color: var(--accent-color);
    font-size: 1.2rem;
}

.btn-primary-small {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Details Header */
.details-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tech-info h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tech-info h3 {
    font-size: 1.1rem;
    color: white;
}

.mb-3 {
    margin-bottom: 15px;
}

/* Employee Search List */
.employee-list {
    max-height: 250px;
    overflow-y: auto;
    margin-top: 10px;
}

.employee-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.employee-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.employee-item strong {
    display: block;
    color: white;
}

.employee-item span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hint-text {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 5px;
    margin-bottom: 15px;
}

/* Finalized Inventory Item */
.inventory-item.finalized-item {
    background: rgba(15, 23, 42, 0.6);
    border-left-color: var(--text-muted);
    opacity: 0.8;
}

.inventory-item.finalized-item h4 {
    color: var(--text-muted);
}

.inventory-item.finalized-item .inv-qty {
    background: var(--text-muted);
}