:root {
    --bg: #0f1117;
    --bg-card: #1a1d27;
    --bg-input: #252836;
    --border: #2d3041;
    --text: #e4e6ed;
    --text-muted: #8b8fa3;
    --primary: #6366f1;
    --primary-hover: #5558e6;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 8px;
    --radius-lg: 12px;
}

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

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

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

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-header { text-align: center; margin-bottom: 32px; }
.login-header h1 { font-size: 24px; margin-bottom: 4px; }
.login-header p { color: var(--text-muted); font-size: 14px; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-group input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--primary); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-muted); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-full { width: 100%; padding: 12px; }

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.nav-brand { font-size: 16px; font-weight: 600; }

/* Layout */
.container { max-width: 900px; margin: 0 auto; padding: 24px; }

/* Card */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header h2 { font-size: 18px; }

/* Profile */
.profile-content { display: flex; gap: 32px; }

.avatar-section { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-input);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { font-size: 36px; font-weight: 600; color: var(--primary); }
.avatar-actions { display: flex; gap: 8px; }

.profile-info { flex: 1; }
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-size: 14px; }
.info-value { font-size: 14px; text-align: right; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

/* Table */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 14px; }
th { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
td { border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
td:last-child { text-align: right; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 460px;
}
.modal-header { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

.secret-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-input);
    padding: 12px;
    border-radius: var(--radius);
    margin-top: 12px;
}
.secret-display code {
    flex: 1;
    font-size: 13px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.warning-text { color: var(--warning); font-size: 14px; }
.error-text { color: var(--danger); font-size: 14px; margin-top: 8px; }
.empty-text { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 0; }
.loading { color: var(--text-muted); font-size: 14px; text-align: center; padding: 24px 0; }

/* Toast */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    color: #fff;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 3.7s;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* Responsive */
@media (max-width: 640px) {
    .profile-content { flex-direction: column; align-items: center; }
    .info-row { flex-direction: column; gap: 4px; }
    .info-value { text-align: left; }
}
