* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    background-color: #f0f0f0;
    color: #333;
}

/* Navigation */
.navbar {
    background-color: #1565C0;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 10px;
}

.nav-menu li a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background-color: #1976D2;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.page-header {
    background-color: #003366;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 24px;
}

/* Filter Section */
.filter-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-section h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-control {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #2196F3;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #2196F3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976D2;
}

.btn-success {
    background-color: #4CAF50;
    color: white;
}

.btn-success:hover {
    background-color: #45a049;
}

.btn-danger {
    background-color: #F44336;
    color: white;
}

.btn-danger:hover {
    background-color: #da190b;
}

.btn-secondary {
    background-color: #9E9E9E;
    color: white;
}

.btn-secondary:hover {
    background-color: #757575;
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Data Section */
.data-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.data-header {
    margin-bottom: 15px;
    font-size: 14px;
}

.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.data-table tbody tr:hover {
    background-color: #f9f9f9;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    width: 80%;
    max-width: 900px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Copyright */
.copyright {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    font-size: 12px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 10px 15px;
    }
    
    .nav-brand {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .nav-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        justify-content: center;
        width: 100%;
    }
    
    .nav-menu li a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .container {
        padding: 0 10px;
        margin: 10px auto;
    }
    
    .page-header h1 {
        font-size: 18px;
    }
    
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-row,
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .data-table {
        font-size: 13px;
    }
    
    .data-table th,
    .data-table td {
        padding: 6px;
        white-space: nowrap;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    
    .btn-small {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Loading spinner */
.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

