/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Navigation */
.navbar {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar h1 a {
    color: #2563eb;
    text-decoration: none;
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.user-name {
    color: #333;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    display: inline-block;
}

.role-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.role-admin {
    background: #dc3545;
    color: white;
}

.role-distributor {
    background: #28a745;
    color: white;
}

.role-organization {
    background: #007bff;
    color: white;
}

.nav-links a {
    color: #666;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

.nav-links a:hover {
    background-color: #f0f0f0;
}

/* Logout button styling to match navigation links */
.btn-logout {
    color: #666;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}

.btn-logout:hover {
    background-color: #f0f0f0;
}

/* Mobile responsiveness for header */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .navbar h1 a {
        font-size: 1.2rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-container {
        flex-wrap: wrap;
    }
    
    .user-name {
        font-size: 0.8rem;
    }
    
    .role-badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
    
    .nav-links a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
    min-height: calc(100vh - 200px);
}

/* Hero section */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.welcome-message {
    font-size: 1.25rem;
    color: #666;
    margin-bottom: 2rem;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #2563eb;
    color: white;
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

/* Dashboard */
.dashboard {
    max-width: 800px;
    margin: 0 auto;
}

.dashboard h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #1f2937;
}

.user-info, .quick-actions {
    margin-bottom: 3rem;
}

.user-info h2, .quick-actions h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #374151;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.info-card p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.action-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.action-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.action-card p {
    color: #666;
}

.action-card.logout h3 {
    color: #dc2626;
}

/* Footer */
.footer {
    background: #f9fafb;
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid #e5e7eb;
    margin-top: 4rem;
}

.footer p {
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* Form styles */
.form-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.form-header {
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.header-row {
    font-weight: bold;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.action-column {
    flex: 0 0 80px;
    text-align: center;
}

.required {
    color: #dc3545;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Bulk input styles */
.bulk-input {
    width: 100%;
    font-family: monospace;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
}

.form-help {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.form-help code {
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}