* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #333;
    min-height: 100vh;
}

.navbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar .brand {
    font-size: 18px;
    font-weight: 600;
    color: #2563eb;
}

.navbar .nav-links {
    display: flex;
    gap: 16px;
    align-items: center;
}

.navbar .nav-links a {
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

.navbar .nav-links a:hover {
    color: #2563eb;
}

.navbar .nav-links .btn-logout {
    background: none;
    border: 1px solid #ddd;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #666;
}

.navbar .nav-links .btn-logout:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px;
}

/* Login page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 56px);
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    width: 380px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 28px;
    color: #2563eb;
    font-size: 22px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #2563eb;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
    width: 100%;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.error-msg {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
}

/* Transfer section */
.transfer-box {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.transfer-box h3 {
    font-size: 16px;
    margin-bottom: 16px;
    color: #333;
}

.transfer-input-row {
    display: flex;
    gap: 12px;
}

.transfer-input-row input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.transfer-input-row input:focus {
    border-color: #2563eb;
}

/* Progress display */
.progress-box {
    background: #f8f9ff;
    border: 1px solid #e0e6ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 16px;
    display: none;
}

.progress-box.active {
    display: block;
}

.progress-status {
    font-size: 14px;
    color: #2563eb;
    font-weight: 500;
}

.progress-message {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.progress-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e0e6ff;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Account cards */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.account-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
}

.account-card .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e0e6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.account-card .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-card .name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.account-card .mid {
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    word-break: break-all;
}

.account-card .field {
    margin-bottom: 8px;
}

.account-card .field-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-card .field-value {
    font-size: 13px;
    color: #333;
    word-break: break-all;
    background: #f5f6fa;
    padding: 6px 10px;
    border-radius: 6px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-card .field-value .copy-btn {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    margin-left: 8px;
}

.account-card .field-value .copy-btn:hover {
    text-decoration: underline;
}

.account-card .card-actions {
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.account-card .created-time {
    font-size: 11px;
    color: #aaa;
}

.account-card .delete-btn {
    background: none;
    border: 1px solid #fdd;
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.account-card .delete-btn:hover {
    background: #fef2f2;
}

/* Admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-table th,
.admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.admin-table th {
    background: #f8f9ff;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-admin {
    background: #ede9fe;
    color: #7c3aed;
}

.badge-user {
    background: #dbeafe;
    color: #2563eb;
}

.badge-active {
    background: #d1fae5;
    color: #059669;
}

.badge-inactive {
    background: #fee2e2;
    color: #dc2626;
}

/* Section headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    color: #333;
}

/* Modal overlay (admin) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal-overlay .modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    width: 400px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.modal-overlay .modal-box h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

/* Claim button */
.account-card .claim-btn {
    background: #2563eb;
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
}

.account-card .claim-btn:hover {
    background: #1d4ed8;
}

/* Claim modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal.active {
    display: flex;
}

.claim-modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25);
    max-width: 380px;
    width: 90%;
}

.claim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.claim-header h3 {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.claim-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.claim-close:hover {
    color: #333;
}

.claim-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    margin-bottom: 16px;
    background: #fff;
    border-radius: 12px;
    padding: 8px;
}

.claim-qr canvas,
.claim-qr img {
    border-radius: 4px;
}

.claim-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e6ff;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.claim-status {
    font-size: 14px;
    color: #2563eb;
    min-height: 20px;
    padding: 8px 0;
}

.claim-status.claim-done {
    color: #059669;
    font-weight: 500;
}

.claim-status.claim-error {
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }
    .transfer-input-row {
        flex-direction: column;
    }
    .accounts-grid {
        grid-template-columns: 1fr;
    }
}
