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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

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

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 2em;
}

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

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.tab {
    padding: 12px 20px;
    border: none;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
}

.tab:hover {
    background: #667eea;
    color: white;
}

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

.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

/* Table/List Layout */
.parts-table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.parts-table table {
    width: 100%;
    border-collapse: collapse;
}

.parts-table thead {
    background: #667eea;
    color: white;
}

.parts-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.parts-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.parts-table tbody tr:hover {
    background: #f8f9fa;
}

.parts-table tbody tr.critical {
    border-left: 5px solid #e74c3c;
}

.parts-table tbody tr.low-stock {
    border-left: 5px solid #f39c12;
}

.parts-table td {
    padding: 15px 10px;
    font-size: 14px;
}

.part-name-cell {
    font-weight: 600;
    color: #333;
}

.part-number-cell {
    color: #666;
    font-family: 'Courier New', monospace;
}

.badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

.badge.critical {
    background: #e74c3c;
    color: white;
}

.badge.low-stock {
    background: #f39c12;
    color: white;
}

.badge.category {
    background: #ecf0f1;
    color: #666;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-control button {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-control button:hover {
    background: #764ba2;
}

.quantity-display {
    font-size: 1.2em;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

.action-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #764ba2;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

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

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

.btn-link {
    background: #3498db;
    color: white;
}

.btn-link:hover {
    background: #2980b9;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

form label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

form textarea {
    resize: vertical;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.checkbox-label input {
    width: auto;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
}

/* Shopping List */
.shopping-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.shopping-item.urgent {
    border-left-color: #e74c3c;
}

.shopping-item.high {
    border-left-color: #f39c12;
}

.shopping-item.medium {
    border-left-color: #3498db;
}

.shopping-item.low {
    border-left-color: #95a5a6;
}

.shopping-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.shopping-title {
    font-size: 1.1em;
    font-weight: 600;
}

.shopping-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
    }
    
    .parts-table {
        overflow-x: auto;
    }
    
    .parts-table table {
        min-width: 800px;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
}
