* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f5f5;
    color: #333;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    color: #667eea;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.nav-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-content h1 {
    font-size: 24px;
    color: #667eea;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.username {
    color: #666;
    font-weight: 500;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 20px;
}

/* Controls */
.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #38a169;
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group.checkbox {
    display: flex;
    align-items: center;
}

.form-group.checkbox label {
    margin: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.form-group.checkbox input {
    width: auto;
    margin-right: 8px;
}

/* Messages */
.error-message {
    display: none;
    padding: 10px;
    background: #fed7d7;
    color: #c53030;
    border-radius: 5px;
    margin-top: 15px;
}

.message-box {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: none;
}

.message-box.success {
    background: #c6f6d5;
    color: #22543d;
    display: block;
}

.message-box.error {
    background: #fed7d7;
    color: #c53030;
    display: block;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Stats */
.stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-weight: 600;
}

.stats span {
    background: white;
    padding: 10px 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
}

td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

tr:hover {
    background: #f7fafc;
}

.price-input {
    width: 100px;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
}

.price-input:focus {
    outline: none;
    border-color: #667eea;
}

.price-input.changed {
    border-color: #48bb78;
    background: #f0fff4;
}

.change-indicator {
    font-weight: 600;
    font-size: 13px;
}

.change-indicator.positive {
    color: #38a169;
}

.change-indicator.negative {
    color: #e53e3e;
}

.history-btn {
    background: #edf2f7;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
}

.history-btn:hover {
    background: #e2e8f0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.history-content {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.history-item:last-child {
    border-bottom: none;
}

.history-date {
    font-size: 12px;
    color: #718096;
}

.history-prices {
    margin: 5px 0;
    font-weight: 600;
}

.history-user {
    font-size: 13px;
    color: #4a5568;
}

/* Admin Page */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.admin-card {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-card h2 {
    margin-bottom: 20px;
    color: #667eea;
    font-size: 20px;
}

.admin-card form {
    margin-bottom: 0;
}

@media (max-width: 1024px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}