:root {
    --bg: #1a1a2e;
    --bg-card: #16213e;
    --fg: #ffffff;
    --fg-muted: #888;
    --accent: #ff6d5a;
    --accent-hover: #ff8a7a;
    --success: #30d158;
    --error: #ff453a;
    --border: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
}

/* Login Wrapper */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

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

.login-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #ff6d5a, #ff9f0a);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-header p {
    color: var(--fg-muted);
    font-size: 14px;
}

/* Form Styles */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--fg-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--fg);
    transition: all 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

input::placeholder {
    color: var(--fg-muted);
}

.code-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: bold;
}

button {
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

/* Messages */
.error-message {
    background: rgba(255, 69, 58, 0.15);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.success-message {
    background: rgba(48, 209, 88, 0.15);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.code-info {
    text-align: center;
    color: var(--fg-muted);
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.5;
}

.code-info strong {
    color: var(--fg);
}

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

.back-link a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 14px;
}

.back-link a:hover {
    color: var(--fg);
}

.info-text {
    text-align: center;
    color: var(--fg-muted);
    font-size: 13px;
    margin-top: 20px;
    line-height: 1.5;
}

/* Admin Styles */
.admin-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.admin-header h1 {
    font-size: 24px;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.admin-nav a {
    color: var(--fg-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-nav a:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.1);
}

.admin-section {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.admin-section h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--fg);
}

.add-user-form .form-row {
    display: flex;
    gap: 10px;
}

.add-user-form input {
    flex: 1;
}

.add-user-form button {
    white-space: nowrap;
}

/* Table */
.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.users-table th {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--fg-muted);
    font-weight: 600;
}

.users-table tr.inactive td {
    opacity: 0.5;
}

.users-table .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background: rgba(48, 209, 88, 0.2);
    color: var(--success);
}

.status-badge.inactive {
    background: rgba(255, 69, 58, 0.2);
    color: var(--error);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.btn-danger {
    background: var(--error);
}

.btn-danger:hover {
    background: #ff6b6b;
}

.muted {
    color: var(--fg-muted);
    font-size: 12px;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .add-user-form .form-row {
        flex-direction: column;
    }

    .users-table {
        font-size: 14px;
    }

    .users-table th,
    .users-table td {
        padding: 8px;
    }

    .users-table .actions {
        flex-direction: column;
    }
}
