* {
    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;
    color: #333;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hidden {
    display: none !important;
}

/* Login Styles */
.login-box {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 60px;
    height: auto;
    margin-bottom: 10px;
}

.login-box h1 {
    color: #667eea;
    margin-bottom: 10px;
    text-align: center;
}

.login-box h2 {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-delete:active {
    background-color: #bd2130;
}

.btn-view {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-view:hover {
    background-color: #2980b9;
}

.btn-view:active {
    background-color: #21618c;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: #5568d3;
}

.error-message {
    color: #e74c3c;
    margin-top: 10px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Dashboard Styles */
#dashboard-container {
    display: block;
    padding: 0;
    align-items: flex-start;
}

.header {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    max-width: 35px;
    height: auto;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
    margin: 0;
}

.btn-secondary {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #c0392b;
}

.dashboard-content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    color: #667eea;
    font-size: 36px;
    font-weight: bold;
}

.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters select,
.filters input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 14px;
}

/* Hide Referral Link and Referred By columns by default */
/* But keep the "Referral Link" header visible so it can be clicked */
#toggle-referral-header {
    display: table-cell !important; /* Always show the header */
}

thead th.col-referred-by,
tbody td.col-referral-link,
tbody td.col-referred-by {
    display: none; /* Hide body cells and "Referred By" header by default */
}

/* Style for clickable header */
.toggle-header {
    user-select: none;
    transition: background-color 0.2s;
}

.toggle-header:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.filters input {
    flex: 1;
    min-width: 250px;
}

.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #667eea;
    color: white;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

tbody tr:hover {
    background: #f5f5f5;
}

.loading {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge.registered {
    background: #2ecc71;
    color: white;
}

.badge.unregistered {
    background: #95a5a6;
    color: white;
}

.badge.student {
    background: #3498db;
    color: white;
}

.badge.teacher {
    background: #9b59b6;
    color: white;
}

.badge.simple_person {
    background: #e67e22;
    color: white;
}

.actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.actions button {
    padding: 12px 24px;
}

@media (max-width: 768px) {
    .dashboard-content {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        width: 100%;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }
}

