* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
}

/* Login Page */
.login-container {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.error-message {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 14px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-login:hover {
    transform: translateY(-2px);
}

.demo-info {
    text-align: center;
    color: #999;
    font-size: 12px;
    margin-top: 20px;
}

/* Dashboard */
.welcome-section {
    padding: 20px 0;
}

.welcome-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.welcome-card p {
    margin-bottom: 10px;
    color: #444;
}

.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 {
    font-size: 28px;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

#userInfo {
    font-size: 14px;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid white;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.admin-panel h2 {
    color: #333;
    margin-bottom: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
}

.add-part-form {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-top: 20px;
    display: grid;
    gap: 12px;
}

.add-part-form h3 {
    margin-bottom: 10px;
}

.add-part-form input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.parts-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.parts-section h2 {
    color: #333;
    margin-bottom: 25px;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.part-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.part-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.part-card h3 {
    color: #333;
    margin-bottom: 12px;
    font-size: 18px;
}

.part-card p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.5;
}

.part-card strong {
    color: #333;
}

.btn-small {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    margin-right: 8px;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #5568d3;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Ribbon Navigation */
.ribbon {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 10px 0;
}

.ribbon-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 10px;
}

.ribbon-tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #495057;
    border-radius: 4px;
    transition: all 0.2s;
}

.ribbon-tab:hover {
    background: #e9ecef;
    color: #212529;
}

.ribbon-tab.active {
    background: #667eea;
    color: white;
}

/* Lost Sale Section */
.form-container, .records-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.lost-sale-form {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.lost-sale-form .btn-primary {
    grid-column: span 2;
    margin-top: 10px;
}

.lost-sale-form input[readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

.form-row {
    display: flex;
    gap: 20px;
    grid-column: span 2;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Fuzzy Search Results Table */
.lost-sale-form .form-group:has(#lsPartNumber) {
    position: relative;
}

.search-result-container {
    position: absolute;
    width: 200%; /* Wider than the input */
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    top: 100%;
    left: 0;
}

.search-results-table {
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.search-results-table th, .search-results-table td {
    padding: 8px 12px;
    font-size: 13px;
}

.search-results-table tr:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.no-match {
    padding: 10px;
    color: #e74c3c;
    font-size: 14px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 5px;
}

/* Table Styling */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 600;
}

table tr:hover {
    background-color: #f8f9fa;
}

@media (max-width: 768px) {
    .navbar-content {
        flex-direction: column;
        gap: 10px;
    }

    .parts-grid {
        grid-template-columns: 1fr;
    }

    .login-box {
        margin: 20px;
    }
}
