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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #1f2933;
}

.container {
    width: 100%;
    max-width: 1000px;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
    position: relative;
    min-height: 120px;
    padding-top: 50px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

.user-info {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.85em;
    flex-wrap: wrap;
}

.user-info span {
    color: white;
    opacity: 0.9;
    white-space: nowrap;
}

.admin-link,
.logout-link {
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    white-space: nowrap;
}

.admin-link:hover,
.logout-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Dashboard */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.tool-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    padding: 30px;
    text-decoration: none;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.tool-card h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

.tool-card p {
    opacity: 0.9;
    font-size: 0.95em;
    line-height: 1.5;
}

.welcome-text {
    text-align: center;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 30px;
}

/* Invoice detail page */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.container-content {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.coming-soon {
    color: #666;
    margin-top: 20px;
}

h2 {
    color: #333;
    margin-bottom: 20px;
}

/* Form styles */
.invoice-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #adb5bd;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    background: white;
    border-radius: 15px;
    padding: 40px 60px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.loading-content h3 {
    margin: 20px 0 10px 0;
    color: #667eea;
    font-size: 1.5em;
}

.loading-content p {
    color: #6c757d;
    margin-bottom: 0;
}

/* Spinner Animation */
.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Authentication links and help text */
.auth-links {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.auth-links p {
    color: #666;
    font-size: 0.9em;
}

.auth-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.auth-links a:hover {
    text-decoration: underline;
}

.help-text {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-top: 5px;
}

/* Messages and errors */
.error-message {
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    color: #c33;
    text-align: center;
}

.error-message p {
    margin: 0;
    font-size: 0.95em;
}

.messages {
    margin-bottom: 20px;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.message.error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.message.info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* User management */
.user-management {
    max-width: 1200px;
    margin: 0 auto;
}

.user-management h2 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.users-section {
    margin-bottom: 40px;
}

.users-section h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.users-table th,
.users-table td {
    padding: 15px;
    text-align: left;
}

.users-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.users-table tbody tr:last-child {
    border-bottom: none;
}

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

.users-table .actions {
    text-align: right;
}

.btn-approve,
.btn-reject,
.btn-unapprove,
.btn-superuser {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-approve {
    background: #28a745;
    color: white;
}

.btn-approve:hover {
    background: #218838;
    transform: translateY(-2px);
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-reject:hover {
    background: #c82333;
    transform: translateY(-2px);
}

.btn-unapprove {
    background: #ffc107;
    color: #212529;
}

.btn-unapprove:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

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

.btn-superuser:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.status-approved {
    display: inline-block;
    padding: 5px 12px;
    background: #d4edda;
    color: #155724;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.no-users {
    color: #666;
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.back-link-container {
    text-align: center;
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        padding-top: 80px;
        min-height: 140px;
    }
    
    .user-info {
        font-size: 0.75em;
        gap: 8px;
    }
    
    .user-info span {
        width: 100%;
        text-align: right;
    }
    
    .admin-link,
    .logout-link {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2em;
    }
    
    header {
        padding-top: 100px;
    }
    
    .user-info {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }
}
