* {
    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;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2em;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}
.description {
    text-align: center;
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
    margin: -15px auto 30px;
    max-width: 650px;
    padding: 0 20px;
}


h3 {
    color: #764ba2;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 8px;
}

.back-link:hover {
    background: #f0f0f0;
    transform: translateX(-5px);
}

.nav-list {
    list-style: none;
    display: grid;
    gap: 15px;
    margin-top: 30px;
}

.nav-list li a {
    display: block;
    padding: 20px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.nav-list li a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

form {
    margin-top: 30px;
}

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

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    background-color: white;
    cursor: pointer;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
}

input[type="date"] {
    color: #999;
    font-size: 1.35em;
}

input[type="date"]:focus,
input[type="date"]:valid {
    color: #333;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23667eea' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    color: #999;
}
select:valid {
    color: #333;
}

.checkbox-group {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    vertical-align: middle;
}

.checkbox-group label {
    display: inline;
    margin-left: 5px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-item {
    margin-bottom: 10px;
}

button[type="submit"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-top: 10px;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

button[type="submit"]:active {
    transform: translateY(0);
}

.message {
    margin-top: 25px;
    padding: 15px 20px;
    background: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 8px;
    color: #155724;
    font-weight: 500;
}

.output-box {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
}

pre {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.config-item {
    margin-bottom: 25px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
    background: white;
}

.result-table th {
    background: #667eea;  /* Simple solid color instead of gradient */
    color: white;
    font-weight: 700;  /* Bold text */
    text-align: center;  /* Center the header text */
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.result-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: center;  /* Center all table data */
}

.result-table td:first-child,
.result-table th:first-child {
    text-align: center;  /* Center the first column too */
    font-weight: 600;
    background: #7c8ff5;  /* Slightly lighter shade for row labels */
    color: white;
}

.result-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.result-table tr:hover {
    background-color: #f0f0f0;
    transition: background-color 0.2s ease;
}

/* Username link styling - needs !important to override td:first-child color */
.result-table a.username-link {
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.result-table a.username-link:hover {
    color: #FFE082 !important;
    text-decoration-thickness: 2px;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.result-table a.username-link:visited {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.result-section {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border-radius: 8px;
    overflow-x: auto;
}

.result-section h4 {
    margin-bottom: 15px;
    color: #667eea;
    font-size: 1.2em;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

/* Error Message Styles */
.error-message {
    background-color: #fee;
    border: 2px solid #fcc;
    border-left: 4px solid #e53e3e;
    border-radius: 8px;
    color: #c53030;
    padding: 20px;
    margin: 25px 0;
    font-weight: 500;
    font-size: 1em;
    line-height: 1.6;
    animation: shake 0.3s ease-in-out;
}

.error-message::before {
    content: '⚠️ ';
    font-size: 1.2em;
    margin-right: 8px;
}

.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    color: #333;
    font-size: 16px;
    margin-top: 10px;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   CSV VIEWER TABLE STYLES
   ============================================ */

.csv-viewer-section {
    margin: 30px 0;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.record-count {
    font-weight: 600;
    font-size: 0.95em;
}

/* Style for grouping the action buttons */
.table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Make download-csv-btn work as both link and button */
.download-csv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: white;
    color: #667eea;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.download-csv-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.9em;
    min-width: 600px;
}

.csv-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.csv-table thead tr {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: left;
}

.csv-table th {
    padding: 16px 20px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
    border-bottom: 3px solid #5568d3;
    white-space: nowrap;
}

.csv-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.csv-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.csv-table tbody tr:hover {
    background-color: #e8ebff;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.csv-table td {
    padding: 14px 20px;
    color: #333;
    vertical-align: middle;
}

.csv-table td:first-child {
    font-weight: 600;
    color: #667eea;
}

/* Alternating column colors for better readability */
.csv-table td:nth-child(odd) {
    background-color: rgba(102, 126, 234, 0.02);
}

/* Empty state */
.csv-table tbody tr.empty-state td {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Optional: Search box styling (if you add search functionality) */
.table-search {
    margin-bottom: 20px;
}

.table-search input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

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

/* Number cell styling */
.csv-table td.number {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Status badge styling (optional - for status columns) */
.csv-table .status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.inactive {
    background: #f8d7da;
    color: #721c24;
}

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

/* Responsive table */
@media (max-width: 768px) {
    .table-wrapper {
        margin: 0 -20px;
        border-radius: 0;
    }
    
    .csv-table {
        font-size: 0.8em;
    }
    
    .csv-table th,
    .csv-table td {
        padding: 10px 12px;
    }
    
    .table-info {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .download-csv-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   LOGOUT LINK STYLES
   ============================================ */

.logout-link {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.logout-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* ============================================
   LOGIN PAGE SPECIFIC STYLES
   ============================================ */

/* Center the login page */
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

body.login-page .container {
    max-width: 450px;
    width: 100%;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

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

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-100%);
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    color: #667eea;
    user-select: none;
}

.toggle-password:hover {
    color: #764ba2;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 45px;
}

body.login-page button[type="submit"] {
    width: 100%;
    margin-top: 10px;
}

body.login-page .error-message {
    margin-bottom: 20px;
    animation: shake 0.3s ease-in-out;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 0.9em;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ============================================
   END LOGIN PAGE STYLES
   ============================================ */

@media (max-width: 768px) {
    .container {
        padding: 25px;
        margin: 10px;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    button[type="submit"] {
        width: 100%;
    }
}