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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

.hidden {
    display: none !important;
}

/* Login */
.login-box {
    max-width: 400px;
    margin: 100px auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h2 {
    margin-bottom: 20px;
    text-align: center;
}

/* Forms */
.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

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

.form-row.inline {
    align-items: flex-end;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

button:hover {
    background: #0056b3;
}

.btn-small {
    padding: 5px 10px;
    font-size: 0.875rem;
    margin: 0 2px;
}

.danger {
    background-color: #dc2626;
}

.danger:hover {
    background-color: #b91c1c;
}

button.primary {
    background: #28a745;
}

button.primary:hover {
    background: #218838;
}

button.secondary {
    background: #007bff;
    color: white;
}

button.secondary:hover {
    background: #0056b3;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

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

.role-badge {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    background: none;
    color: #666;
    padding: 10px 20px;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-button:hover {
    color: #333;
    background: #f8f9fa;
}

.tab-button.active {
    color: #007bff;
    border-bottom-color: #007bff;
}

/* AutoERP Sync button */
#syncTabButton {
    background-color: #ff6b6b;
    color: white;
}

#syncTabButton:hover {
    background-color: #ff5252;
    color: white;
}

/* Sync section styles */
.sync-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.sync-section h3 {
    margin-top: 0;
    color: #495057;
}

.sync-result {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 4px;
    display: none;
}

.sync-result.success {
    border-left: 4px solid #28a745;
    color: #155724;
}

.sync-result.error {
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.status-message {
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
    text-align: center;
}

.status-message.info {
    background: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

/* Content */
.tab-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.form-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

/* Tables */
.data-table {
    overflow-x: auto;
}

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

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

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

tr:hover {
    background: #f8f9fa;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status.approved {
    background: #d4edda;
    color: #155724;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.rejected {
    background: #f8d7da;
    color: #721c24;
}

/* Messages */
.error {
    color: #dc3545;
    margin-top: 10px;
}

.success {
    color: #28a745;
    margin-top: 10px;
}

.demo-info {
    margin-top: 20px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 4px;
}

.demo-info h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.demo-info p {
    font-size: 13px;
    margin: 5px 0;
    font-family: monospace;
}

/* Summary box */
.summary-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.summary-box h3 {
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 18px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 2px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }
    
    .tabs {
        overflow-x: auto;
    }
    
    .actions {
        flex-wrap: wrap;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}